What is FIFO and why does it matter?
FIFO (First In, First Out) is an inventory costing method that assumes the first units purchased are the first units sold. It does not track the physical movement of goods — it is purely a cost allocation rule that determines which costs flow through to Cost of Goods Sold (COGS) and which costs remain in ending inventory.
Under FIFO, ending inventory is valued at the most recent (newest) purchase costs, while COGS reflects the oldest purchase costs. This has three practical consequences:
- In a period of rising prices, FIFO produces lower COGS and higher ending inventory value compared to LIFO — resulting in higher reported gross profit.
- In a period of falling prices, the opposite is true: FIFO produces higher COGS and lower ending inventory value.
- FIFO ending inventory is generally considered to better reflect current replacement cost since the balance sheet carries the most recent prices.
FIFO is the most widely used inventory method globally and is the only method permitted under IFRS. It is also permitted under US GAAP, alongside LIFO and weighted average cost.
FIFO ending inventory formula
The core relationship that governs all inventory calculations — regardless of costing method — is the inventory equation:
Under FIFO specifically, the calculation works layer by layer. You identify how many total units are available for sale, subtract units sold (starting from the oldest layer), and the remaining units — valued at the newest costs — become ending inventory.
Units in ending inventory = Units available − Units sold
Ending inventory cost = Remaining units × their cost layers (newest first)
Here is a full cost flow waterfall for a worked example: 100 units on hand at start ($8 each), 200 units purchased ($10 each), 220 units sold during the period.
FIFO exhausts the oldest layer (100 units at $8) first, then dips into the newer layer (120 of the 200 units at $10) to reach the 220 units sold. The 80 remaining units carry the newest cost of $10.
FIFO cost layer table — how the math works
The most reliable way to calculate FIFO ending inventory is to build a cost layer table. Each purchase creates a new layer with its own unit cost. Sales consume layers starting from the oldest until units sold are exhausted.
Using the same example: beginning inventory 100 units @ $8, then two purchases (150 units @ $10, then 100 units @ $12), and total sales of 280 units:
FIFO exhausts the beginning layer (100 units) and Purchase 1 layer (150 units) completely — that accounts for 250 of the 280 units sold. The remaining 30 units come from the newest Purchase 2 layer. The 70 leftover units from Purchase 2 become ending inventory at $12 each = $840 ending inventory value.
Ending inventory = 70 × $12 = $840
Check: $2,660 + $840 = $3,500 = total goods available ✓
How to calculate FIFO ending inventory — step by step
FIFO vs LIFO vs weighted average — same data, different results
Using the same base data — 100 units @ $8 beginning inventory, 200 units purchased @ $10, 220 units sold — here is how ending inventory and COGS differ across all three methods:
In this rising-price scenario ($8 → $10), FIFO produces the highest ending inventory value and lowest COGS — meaning the highest gross profit. LIFO produces the lowest ending inventory value and highest COGS. Weighted average falls in between.
Note: LIFO is not permitted under IFRS and is only available under US GAAP. Companies using LIFO must provide a LIFO reserve disclosure so investors can convert to FIFO for comparability.
Four worked examples
Retail store, 2 purchase batches
Beginning: 50 units @ $5. Purchase: 100 units @ $7. Sold: 90 units.
Sold layer 2: 40 units × $7 = $280
COGS = $530
Ending = 60 units × $7 = $420
✓ 60 units remain from newest layer
Wholesale distributor
Begin: 0. Buy 100 @ $20, 150 @ $22, 100 @ $25. Sell 200 units.
Layer 2: 100 × $22 = $2,200 (partially sold)
COGS = $4,200
Ending = 50 @ $22 + 100 @ $25 = $3,600
→ Two layers remain in ending inventory
Impact on gross profit
Same data as comparison table above. Prices rising $8 → $10.
LIFO ending inv. = $560 (70 units × $8)
Difference = $240 higher under FIFO
⚠ FIFO reports higher income in rising markets
Reconciliation check
Beginning $800 + Purchases $3,200 = Available $4,000. COGS $3,100.
Check: $3,100 + $900 = $4,000 ✓
✓ Always reconcile — catches layer errors fast
Common mistakes when calculating FIFO ending inventory
- Applying newest costs to COGS instead of COGS. FIFO means oldest costs go to COGS, newest costs stay in ending inventory — not the reverse. Confusing this direction is the most common error on accounting exams.
- Mixing periods. Beginning inventory, purchases, and sales must all come from the same period. Mixing data from different periods produces meaningless results.
- Forgetting to reconcile. Always verify that COGS + Ending inventory = Goods available for sale. If it doesn't balance, there is a layer allocation error.
- Treating FIFO as physical flow. FIFO is a cost assumption, not a rule about which physical units move first. A company can sell units in any physical order and still apply FIFO costing.
- Ignoring purchase returns or allowances. If goods were returned to suppliers during the period, those units and costs must be removed from the purchase layer before calculating COGS and ending inventory.
FAQ
What is the FIFO ending inventory formula?
Ending Inventory (FIFO) = Beginning Inventory + Purchases − COGS. For COGS under FIFO: assign units sold starting from the oldest cost layer (beginning inventory), exhaust each layer in order, and multiply remaining units by their layer costs. The remaining units valued at newest costs = ending inventory.
Does FIFO mean the oldest physical items are sold first?
No. FIFO is a cost flow assumption, not a physical flow rule. The oldest costs are assigned to COGS regardless of which physical units actually left the warehouse. Many businesses use FIFO costing even when physical goods move in a different order.
Why does FIFO produce higher profits when prices are rising?
Under FIFO, COGS uses older, lower-cost units first. In a rising-price environment, this means COGS is lower than it would be under LIFO or weighted average. Lower COGS = higher gross profit. However, this also means more taxable income. That is why some US companies prefer LIFO for tax deferral purposes.
Is FIFO required under IFRS?
FIFO and weighted average cost are both permitted under IFRS (IAS 2). LIFO is specifically prohibited under IFRS. In the United States, GAAP allows all three methods, but companies using LIFO must disclose the LIFO reserve so financial statement readers can convert to FIFO for comparison.
What is the difference between ending inventory and average inventory?
Ending inventory is the value of stock on hand at the close of a specific period. Average inventory smooths out period-end fluctuations by averaging the beginning and ending inventory values: (Beginning + Ending) ÷ 2. Average inventory is used in metrics like inventory turnover ratio and days inventory outstanding.
How does FIFO ending inventory affect the balance sheet?
Ending inventory is a current asset on the balance sheet. Under FIFO in a rising-price environment, ending inventory is valued at the most recent (higher) costs, so the balance sheet reflects a higher asset value compared to LIFO. This can improve working capital ratios and current ratio calculations.