Inventory
FIFO vs LIFO vs average cost.
List your purchase layers oldest first, enter the units you sold, and compare cost of goods sold, ending inventory and gross profit under each method.
The same sales give different profits depending on which costs you assume were sold first. Selling 250 of 400 units bought at $10.00, $12.00 and $15.00 gives cost of goods sold of $2,800.00 under FIFO, $3,300.00 under LIFO and $3,062.50 at weighted average.
Worked example
Opening stock is 100 units at $10.00, then 200 units arrive at $12.00 and 100 at $15.00: 400 units costing $4,900.00 in total. The business sells 250 units at $25.00 for $6,250.00.
- FIFO sells the oldest first: 100 x $10.00 + 150 x $12.00 = $2,800.00 cost of goods sold, leaving $2,100.00 of stock and $3,450.00 of gross profit.
- LIFO sells the newest first: 100 x $15.00 + 150 x $12.00 = $3,300.00, leaving $1,600.00 and $2,950.00 of gross profit.
- Weighted average costs every unit at $12.25 ($4,900.00 / 400): 250 x $12.25 = $3,062.50, leaving $1,837.50 and $3,187.50 of gross profit.
Because costs rose over the period, FIFO shows the highest profit and LIFO the lowest. If costs had fallen, the order would flip.
How it works
Each method assigns costs from your purchase layers to the units sold. Cost of goods sold plus ending inventory always equals the total cost of all layers, so a method that puts more cost in cost of goods sold leaves less in inventory.
The IRS describes FIFO (first-in, first-out) as assuming the items you purchased or produced first are the first sold, with ending inventory matched to the most recent costs, and LIFO (last-in, first-out) as assuming the items purchased or produced last are the first sold. Weighted average here is the periodic version: total cost of all layers divided by total units, applied to every unit. A perpetual (moving) average, recalculated after each purchase and sale, can give a different figure.
Which method you may use for tax or financial reporting depends on your country and accounting standards. The IRS publication notes that the LIFO rules are very complex, so confirm with an accountant before choosing or changing a method. This page is an arithmetic illustration, not tax or accounting advice.
The text you paste is processed in your browser only. The isolated tool frame has no ads or third-party scripts.
Everything runs in your browser. Nothing you type is sent or stored.
Sources
- Publication 538 (01/2022), Accounting Periods and Methods | Internal Revenue Service (opened 2026-10-08): the definitions of the FIFO and LIFO inventory methods, and the statement that the rules for using LIFO are very complex.
The weighted average calculation is plain arithmetic (total cost divided by total units) and is not attributed to a source.
FAQ
What is the difference between FIFO and LIFO?
FIFO assumes the oldest purchases are sold first, so ending inventory carries the most recent costs. LIFO assumes the newest purchases are sold first, so cost of goods sold carries the most recent costs. The IRS describes the FIFO and LIFO assumptions in Publication 538; the effect on cost of goods sold follows from them.
Which method gives a higher profit?
When purchase costs are rising, FIFO reports a lower cost of goods sold and a higher profit than LIFO, as in the example above. When costs are falling, the reverse is true. Weighted average falls in between.
Can I use LIFO?
It depends on where you report and under which accounting rules. The IRS notes that LIFO rules are very complex, so check with an accountant for your jurisdiction. This tool does not tell you which method is allowed.
How is weighted average cost calculated?
Add up the cost of every layer and divide by the total units to get one average cost per unit, then multiply by the units sold for cost of goods sold. The rest of the total cost is ending inventory.
Why does my total of cost of goods sold plus ending inventory match my purchases?
Every layer's cost ends up either in what you sold or what is still on the shelf. All three methods split the same total; they just split it differently.