How the LIFO Calculator for Inventory works
LIFO stands for Last-In, First-Out — an inventory costing method that assumes the most recently purchased (or produced) units are the first ones sold. That assumption matters because when unit costs change over time, which units you treat as "sold" changes both your cost of goods sold (COGS) and the value left in ending inventory. This calculator applies the LIFO layer method to a simplified two-layer inventory: a beginning balance and one purchase made during the period.
The method
Inventory is tracked in cost layers, ordered by when the units were acquired. Under LIFO, units sold are drawn from the newest layer first:
- Start with the purchase layer (the most recent units). If units sold is less than or equal to units purchased, all of COGS comes from the purchase layer at the purchase cost per unit.
- If units sold exceeds the purchase layer, the purchase layer is exhausted first, and the remaining units sold are drawn from the beginning inventory layer at its (typically older) cost per unit.
- Cost of goods sold = the sum of the cost of every unit drawn from each layer, newest layer first.
- Ending inventory value = the cost of whatever units remain in each layer after the sale — under LIFO, this is usually dominated by the oldest, lowest-cost layer when costs have been rising.
Worked example
With the calculator's defaults — 100 units of beginning inventory at $8.00 each, a purchase of 150 units at $10.00 each, and 180 units sold — LIFO draws all 150 purchased units first (150 × $10.00 = $1,500), then 30 more units from beginning inventory (30 × $8.00 = $240). Cost of goods sold is $1,740, and the 70 units left in beginning inventory are valued at 70 × $8.00 = $560 of ending inventory.
LIFO versus FIFO
FIFO (First-In, First-Out) assumes the opposite: the oldest units are sold first, so ending inventory reflects the most recent, often higher, costs. When purchase costs are rising, LIFO tends to report higher COGS and lower gross profit than FIFO, because the newer, pricier units are expensed first while cheaper, older costs sit in ending inventory. The reverse holds when costs are falling. Note that LIFO is permitted under US GAAP but is not allowed under IFRS.
Limitations of this simplified model
- Real inventories often have many purchase layers accumulated over a period, not just one — a full LIFO ledger tracks each purchase as its own layer.
- This calculator does not model LIFO liquidation (selling through a low-cost old layer during a period of rising costs), which can create a one-time profit distortion.
- It assumes no returns, spoilage, or write-downs, and that units sold cannot exceed total units available (beginning inventory plus purchases).