LIFO Inventory Calculator - COGS and Ending Value
Calculate LIFO cost of goods sold, ending inventory, and gross profit from purchase layers, units sold, and sale price. Check layers.
Enter purchase layers as quantity@cost, units sold, and optional sale price to compute LIFO COGS, ending inventory, and gross profit.
LIFO Inventory Calculator - COGS and Ending Value
Calculate LIFO cost of goods sold, ending inventory, and gross profit from purchase layers, units sold, and sale price. Check layers.
About the LIFO Inventory Calculator
Last-in, first-out inventory costing assigns the most recent purchase costs to units sold and leaves older costs in ending inventory. Merchandisers, manufacturers, and accounting students use LIFO to see how rising purchase prices lift cost of goods sold and hold down the balance-sheet value of stock. The LIFO inventory calculator reads purchase layers from oldest to newest, peels units sold from the newest layer backward, and reports COGS, remaining units, remaining inventory value, and gross profit when you provide a sale price.
Enter layers as quantity@unitCost or quantity x unitCost, separated by commas, in chronological order. Units sold cannot exceed the sum of layer quantities. The engine starts at the last layer and works backward until the sale is fully costed. Ending inventory units are unsold quantities left in earlier layers. Ending inventory value multiplies those leftover quantities by their original unit costs. Gross profit is units sold times sale price minus COGS. If sale price is blank, it is treated as zero and gross profit equals negative COGS.
In a period of rising costs, LIFO COGS is higher than FIFO COGS because recent, more expensive units are sold first. Taxable income is therefore lower in many jurisdictions that still allow LIFO, while the inventory asset looks cheaper. The opposite happens when costs fall. Use the LIFO inventory calculator to grade a homework set, to estimate the LIFO effect versus a known FIFO result, or to brief operations on how a late-period purchase at a higher cost will hit margin if those units are deemed sold.
Layer identity matters. Do not merge purchases that occurred at different costs if you need a textbook-accurate COGS. The calculator does not apply LIFO liquidation exceptions, dollar-value LIFO pools, or lower-of-cost-or-net-realizable-value. Shipping-in, purchase discounts, and returns should be baked into the unit costs you type. Units sold are physical units, not dollars of sales.
IFRS does not allow LIFO; U.S. GAAP still does for companies that elect it, with additional disclosure. This page is a unit-layer illustration, not a tax election or an audit workpaper. Reconcile quantities to the perpetual or periodic count you actually keep. If a sale would liquidate old layers, the resulting COGS mix may not be repeatable next period when new purchases rebuild the stack.
LIFO Inventory Examples
Sales are costed from the newest purchase layer backward, matching the LIFO inventory calculator.
| Scenario | Output | Planning note |
|---|---|---|
| Layers 100@10 then 50@12; sell 120 units at $15 | $1,300.00 COGS; $300.00 ending inventory; 30 ending units; $500.00 gross profit | The sale takes all 50 units at $12 and 70 units at $10, leaving 30 older units on the sheet. |
| Layers 200@8, 100@9, 80@11; sell 150 units at $14 | $1,510.00 COGS; $1,870.00 ending inventory; 230 ending units; $590.00 gross profit | Newest 80 units at $11 plus 70 units at $9 are sold; the $8 layer remains intact. |
| Layers 40@5 then 60@6; sell 50 units at $10 | $300.00 COGS; $260.00 ending inventory; 50 ending units; $200.00 gross profit | Half of the newest layer is sold, so COGS is 50 x $6 and 10 units remain at $6. |
How to Calculate LIFO Inventory
- List purchase layers from oldest to newest as quantity@unit cost, separated by commas.
- Enter the number of units sold, not exceeding total units purchased.
- Optionally enter the sale price per unit to compute gross profit.
- Calculate LIFO COGS, ending units, ending inventory value, and gross profit.
- Add a later, higher-cost layer to see how LIFO lifts cost of goods sold.
LIFO Inventory Calculator FAQ
What format do purchase layers use?
Type quantity@cost or quantity x cost, such as 100@10, 50@12. Layers should be in purchase order so the last layer is treated as the newest.
How is LIFO different from FIFO?
LIFO sells the newest costs first; FIFO sells the oldest costs first. In rising markets LIFO raises COGS and lowers ending inventory relative to FIFO.
Can I omit sale price?
Yes. Sale price is optional and treated as zero if blank. COGS and ending inventory still compute; gross profit then equals negative COGS.
What if units sold exceed inventory?
The LIFO inventory calculator rejects the inputs. You cannot cost a sale that exceeds units available in the layers entered.
Does this support dollar-value LIFO?
No. It is a unit-layer method. Dollar-value LIFO, pools, and index conversions need a different model and inventory software.