Understanding the LIFO inventory calculator — concept and principle
This calculator applies periodic last-in, first-out (LIFO) costing to a list of inventory lots, giving COGS, ending inventory, gross profit and a comparison with FIFO. Accounting students and US companies that use LIFO use it.
How it is calculated
- Enter beginning stock and purchases oldest first: units, then cost per unit.
- Goods available = Σ units × cost
- LIFO COGS: take the units sold from the newest lot first, then the next newest, each at its own cost
- Ending inventory = goods available − COGS (the oldest costs)
- FIFO COGS for comparison: take units from the oldest lot first
- Gross profit = units sold × price − COGS; margin = gross profit ÷ sales × 100
The principle
LIFO assumes the most recent purchases are sold first. In a period of rising costs, the newest and most expensive costs go to COGS, which lowers reported profit and, where LIFO is allowed for tax, taxable income. The units left in stock carry old costs, so the balance-sheet inventory can be far below current value. This calculator uses the periodic method, one calculation at the end of the period; perpetual LIFO, applied sale by sale, can give a different answer. LIFO is allowed under US GAAP but not under IFRS (IAS 2).
Worked example
Defaults: 150 at 21.00, 225 at 27.00, 210 at 33.00; 300 units sold at 37.80.
- Goods available = 3,150 + 6,075 + 6,930 = $16,155.00.
- LIFO COGS = 210 × 33 + 90 × 27 = 6,930 + 2,430 = $9,360.00; average $31.20 per unit.
- Ending inventory = 16,155 − 9,360 = $6,795.00, 285 units.
- FIFO COGS = 150 × 21 + 150 × 27 = $7,200.00; LIFO adds $2,160.00.
- Gross profit = 300 × 37.80 − 9,360 = $1,980.00; margin = 17.5%.
These figures match the OpenStax textbook example.
How to read the result
The 2,160 difference shows how much lower LIFO profit is than FIFO profit when costs rise. That lower profit can mean lower tax but also weaker reported margins. The LIFO ending inventory reflects old prices, so ratios using inventory, such as current ratio and turnover, need care when compared with FIFO companies.
Common mistakes
- Entering lots newest first; the calculator expects oldest first.
- Expecting periodic and perpetual LIFO to give the same answer.
- Applying LIFO under IFRS, where it is not permitted.
Frequently asked questions
Why does LIFO lower profit?
When costs rise, LIFO charges the newest, highest costs to COGS, so gross profit is lower than under FIFO.
Is LIFO allowed under IFRS?
No. IAS 2 allows FIFO and weighted average cost; LIFO was eliminated.
Why do periodic and perpetual LIFO differ?
Perpetual LIFO takes units from the latest purchase available at the moment of each sale, which may be an older lot than the period's last purchase.
Sources: OpenStax, Principles of Accounting, Volume 1: Financial Accounting, section 10.2 "Calculate the Cost of Goods Sold and Ending Inventory Using the Periodic Method" · IFRS Foundation, Basis for Conclusions on IAS 2 "Inventories", BC9 and BC19–BC21