How this calculator works
LIFO, last in first out, assumes the newest units are sold first. Sales consume the most recent purchase layer, then the one before it, until the units sold are covered. The cost of those consumed units is the cost of goods sold, and whatever remains in each layer is the ending inventory. In a period of rising prices LIFO reports a higher cost of goods sold and a lower ending inventory than FIFO, which usually lowers taxable profit. The layer table shows exactly how many units each layer contributed and what is left.
Formula
Starting with the newest layer, take enough units to cover the quantity sold and multiply them by the layer cost. Cost of goods sold is the sum over the layers consumed. Ending inventory is the sum of the units left in each layer multiplied by its cost. Revenue = units sold × selling price. Gross profit = revenue - cost of goods sold.
Worked example
Layers of 100 units at $10, 150 at $12 and 200 at $15 total 450 units. Selling 300 units takes all 200 at $15 and 100 at $12. Cost of goods sold is $3,000 + $1,200 = $4,200. The 50 units left in the second layer are worth $600 and the 100 units in the first layer are worth $1,000, so ending inventory is $1,600. Revenue at $25 is $7,500 and gross profit is $3,300.
Advertisement
Frequently asked questions
Why does LIFO matter?
The cost flow method changes reported profit and inventory value when purchase prices change. LIFO matches the newest, often more expensive, costs against current revenue, so in a period of inflation it usually reports lower profit and a lower inventory balance than FIFO.
Is LIFO allowed in Canada?
Canadian tax rules do not permit LIFO for tax purposes, and IFRS does not allow it either. US GAAP and the US tax code do allow it. The calculator is still useful for analysis, comparison and jurisdictions where LIFO is permitted.
What if units sold exceed the units purchased?
There is no layer to draw from, so the shortfall would be negative inventory. The calculator rejects that case as a data error. Check whether opening inventory from an earlier period should be added as a layer.