What FIFO actually assumes
FIFO — first in, first out — assumes the first units you bought are the first ones charged to expense. It is an assumption about costs, not about boxes. You can pick stock from the back of the warehouse and still use FIFO, because the method governs which dollars leave inventory, not which cartons leave the dock.
That distinction matters because the physical units are usually indistinguishable while their costs are not. Buy 200 widgets at $12 in March and 150 at $14 in September, and you now hold 350 identical widgets carrying two different costs. When you sell 100, accounting has to decide which $12 or $14 follows them out. FIFO answers: the oldest first.
The consequence is systematic. Where costs drift upward, FIFO charges the cheapest, oldest layers to cost of goods sold and leaves the dearest, newest layers on the balance sheet. So FIFO reports the highest gross profit, the highest ending inventory and the highest tax bill of the three common cost-flow assumptions. LIFO does the opposite, and weighted average cost lands between them. FIFO is also the world's default: for interchangeable goods IAS 2 permits only FIFO and weighted average cost, so every IFRS filer uses one of the two.
How the layer walk works, step by step
Every FIFO calculation is the same four moves, and you can do them on a napkin.
One: build the pool. List beginning inventory and every purchase in date order, each with its units and its landed cost per unit. Landed cost means invoice price plus freight-in, duty and any non-recoverable tax — the costs ASC 330 and IAS 2 both require you to capitalise. Multiply units by unit cost in each row and add them up. That total is cost of goods available for sale, and it is the only pool the period has.
Two: split the pool by units. Units available minus units sold is units remaining. Nothing about cost enters yet; this is pure counting.
Three: walk the layers from the top. Take units out of layer 1 until it is exhausted, then move to layer 2, and so on until you have covered every unit sold. Multiply the units taken from each layer by that layer's own cost and add. That sum is cost of goods sold. Exactly one layer is usually partly consumed — the boundary layer — and it contributes to both COGS and ending inventory.
Four: take the residual. Ending inventory is the pool minus COGS. Compute it directly too, by valuing the leftover units at the newest layer costs — the two routes must agree to the penny, because the identity goods available = COGS + ending inventory is not optional. Notice what never appears anywhere above: selling price. Cost flow is independent of what you charged, and price only enters when you convert COGS into gross profit.
Worked example: 450 units, three layers, 300 sold
A hardware distributor starts the quarter with 100 units carried at $10. It buys 200 units at $12 in month one and 150 units at $14 in month three. It sells 300 units at $20 each.
- Build the pool. 100 × $10 = $1,000. 200 × $12 = $2,400. 150 × $14 = $2,100. Units available = 100 + 200 + 150 = 450. Cost of goods available = $1,000 + $2,400 + $2,100 = $5,500.
- Split by units. 450 available − 300 sold = 150 units remaining.
- Walk the layers. Layer 1 has 100 units; take all 100 at $10 = $1,000, leaving 200 units still to cost. Layer 2 has 200 units; take all 200 at $12 = $2,400, and the 300 units are covered. Layer 3 is untouched. Cost of goods sold = $1,000 + $2,400 = $3,400.
- Take the residual. Ending inventory = $5,500 − $3,400 = $2,100. Check it directly: the 150 leftover units are all from layer 3 at $14, and 150 × $14 = $2,100. The two agree.
- Convert to profit. Revenue = 300 × $20 = $6,000. Gross profit = $6,000 − $3,400 = $2,600. Gross margin = $2,600 ÷ $6,000 = 43.33%.
- Read the cost per unit. Average cost charged to expense = $3,400 ÷ 300 = $11.33. Average cost still on the balance sheet = $2,100 ÷ 150 = $14.00.
That last line is the whole story of FIFO in two numbers. You expensed inventory at $11.33 a unit while holding replacement-priced stock at $14.00. If sales continue at $20 and costs stay at $14, next quarter's margin falls from 43.3% to 30% with no change in pricing at all. FIFO does not create that squeeze; it delays your seeing it.
How to read the result
Read the two average costs against each other first. If average cost per unit sold sits well below ending inventory cost per unit, old cheap layers are flattering your gross margin and it will compress as they run out. That gap is the most useful diagnostic here, and it is invisible on the face of an income statement.
Next, sanity-check ending inventory against replacement cost. Under FIFO it should sit close to what you would pay today for the same goods; that is the method's main virtue. If your carrying value is materially above replacement cost, or above what you could sell the goods for net of selling cost, you owe a write-down — ASC 330 and IAS 2 both cap FIFO inventory at the lower of cost and net realisable value. The calculator flags the usual early warning: a selling price that has fallen below your newest layer cost.
Finally, judge gross margin against your own trailing periods, not an industry table. Cost-flow choice alone moves reported margin by several points on identical facts, so a cross-company comparison is meaningless until you read each inventory policy note. Within one company on one method the trend is highly informative — pair it with inventory turnover and days inventory outstanding to separate a pricing move from a cost move from simply holding stock longer.
FIFO results as units sold rises
| Units sold | Cost of goods sold | Ending inventory | Units left | Avg cost per unit sold | Gross margin |
|---|---|---|---|---|---|
| 0 | $0 | $5,500 | 450 | — | — |
| 50 | $500 | $5,000 | 400 | $10.00 | 50.0% |
| 100 | $1,000 | $4,500 | 350 | $10.00 | 50.0% |
| 150 | $1,600 | $3,900 | 300 | $10.67 | 46.7% |
| 200 | $2,200 | $3,300 | 250 | $11.00 | 45.0% |
| 300 | $3,400 | $2,100 | 150 | $11.33 | 43.3% |
| 400 | $4,800 | $700 | 50 | $12.00 | 40.0% |
| 450 | $5,500 | $0 | 0 | $12.22 | 38.9% |
Average cost per unit sold never falls as you sell deeper into newer layers, so gross margin never rises even though the selling price never moves — it is flat while you are still inside the $10 layer and drops with every step past it. At 450 units the FIFO answer equals the LIFO and weighted-average answers, because nothing is left to allocate.
The standards that govern this
US GAAP — FASB ASC 330, Inventory. Cost includes the expenditures and charges incurred to bring an article to its present condition and location. FIFO, LIFO and average cost are all acceptable, and your choice must be disclosed and applied consistently. FIFO and average-cost inventory is then carried at the lower of cost or net realisable value.
IFRS — IAS 2, Inventories. Cost is assigned using FIFO or weighted average cost, consistently across inventories of a similar nature and use. LIFO is not permitted, and inventory is measured at the lower of cost and net realisable value.
US tax. FIFO applies by default if you make no election. Adopting LIFO requires Form 970, and any later change of method generally needs IRS consent on Form 3115.
Mistakes that produce a wrong FIFO number
- Entering purchases out of date order. FIFO is defined by sequence, so a later purchase listed above an earlier one gets consumed first and your COGS is wrong. Sort by receipt date, not invoice or payment date.
- Using invoice price instead of landed cost. Freight-in, duty and non-recoverable taxes are inventory cost under both ASC 330 and IAS 2. Leaving them out understates every layer.
- Netting a return against the wrong layer. Goods sent back to a vendor should reduce the layer they came from, at that layer's cost. Netting them against your newest purchase quietly shifts cost between COGS and inventory.
- Ignoring goods in transit. Stock bought FOB shipping point is yours on the truck and must be entered as a layer; stock you sold FOB destination is still yours until it lands and stays in ending inventory.
- Forgetting the lower-of-cost-or-net-realisable-value test. FIFO gives you cost, not value. Obsolete stock still needs writing down, and the write-down comes after the FIFO calculation, not instead of it.
- Comparing a FIFO company with a LIFO company on gross margin. The spread can be several points on identical economics. If the LIFO filer discloses a LIFO reserve, add it back before comparing.
Why periodic and perpetual FIFO give the same answer
Under FIFO a periodic system and a perpetual system produce identical cost of goods sold and identical ending inventory. That is not true of the other methods, so it is worth knowing why.
In a perpetual system you cost each sale as it happens, taking from the oldest layer available at that moment. In a periodic system you cost every sale at once at period end, taking from the oldest layer available overall. Under FIFO both give the same assignment: a layer bought after a sale can never be older than one bought before it, so it can never jump the queue. Consumption order is fixed by purchase order alone, and when you look does not change it.
LIFO and weighted average break this. Under LIFO, "most recent" depends on when you evaluate, so a June sale draws from a June layer under perpetual but from a December layer under periodic. That is why this calculator can stay silent about sale dates.
Choosing between FIFO, LIFO and weighted average
Pick FIFO when you want a balance sheet that reflects current costs, when you report under IFRS, or when inventory genuinely rotates and a stale layer would mislead. It is the easiest method to audit and to explain.
Pick LIFO only as a US filer facing sustained cost inflation, where the deferred tax is worth the complexity. LIFO strands decades-old costs in inventory, binds you to the conformity rule in your financial statements, and can reverse violently if you let stock run down.
Pick weighted average cost when units are physically commingled and layers are artificial — bulk liquids, grain, fasteners, fuel. It smooths cost volatility and is allowed under both GAAP and IFRS.
Whichever you choose, the identity behind all three is the one the COGS calculator uses: beginning inventory plus additions minus ending inventory. The methods differ only in how they value that final term — and because ending inventory rolls forward as next period's beginning inventory, a cost-flow choice affects two years of reported profit, not one. Feed the COGS figure into cash conversion cycle work to see how long your money stays tied up in stock.
Key terms
- Cost layer
- A batch of units acquired at one unit cost. Layers are the unit of account for FIFO and LIFO; weighted average dissolves them.
- Cost of goods available for sale
- Beginning inventory cost plus all purchase layer costs — the pool divided between COGS and ending inventory.
- Landed cost
- Invoice price plus freight-in, duty and other costs of getting goods to their present location and condition.
- Net realisable value
- Estimated selling price less the costs of completion and sale. FIFO inventory cannot be carried above it.
