LIFO For Inventories Calculator
Work out LIFO cost of goods sold, ending inventory value and units left from an opening stock layer, one purchase layer and the units sold in the period.
LIFO For Inventories Calculator
Background.
When the price of what you stock keeps rising, the order in which you assume units leave the shelf changes your profit. Last-in, first-out (LIFO) assumes the most recently bought units are sold first, so cost of goods sold is charged at the newest, usually highest, prices while the older and cheaper costs stay on the balance sheet. The goods themselves need not move in that order; a shop can sell its oldest stock first and still account on LIFO. It is a rule about which cost goes with which sale, not about boxes.
In the United States the attraction has long been tax. During inflation, a higher cost of goods sold means lower reported profit and lower taxable income. The catch is the LIFO conformity rule: a company that uses LIFO on its tax return must also use it in the financial statements it gives shareholders, so the smaller profit appears in the annual report as well. Outside the US the method is largely unavailable, because International Financial Reporting Standards do not allow it.
The arithmetic here covers the simplest real case: an opening layer of stock carried at its old cost, one purchase layer bought during the period, and all sales counted at the end of the period, which is periodic LIFO. Sales are matched to the purchase layer first, and only once it runs out does the calculation dig into the opening layer. It returns cost of goods sold, the dollar value of what is left and the number of units left.
More than two layers, sale-by-sale sequencing under a perpetual system, dollar-value LIFO pools, write-downs and returns are outside its scope. With more purchase lots, the same rule simply carries on down the layers in reverse date order.
What is lifo for inventories calculator?
LIFO cost of goods sold is the cost assigned to the units sold when the newest purchases are treated as sold first. Each batch bought at one price forms a layer. Sales strip layers from the top, newest first, and whatever remains at the bottom, carried at the oldest costs, becomes ending inventory. The total cost of goods available is fixed by what you paid; the method only decides how that total is split between the income statement, as cost of goods sold, and the balance sheet, as ending inventory.
How to use this calculator.
- Enter the opening layer: units on hand at the start of the period and the unit cost they are carried at, taken from last period's closing inventory. If you have been on LIFO for years, that is the old layer cost on your books, not today's price.
- Enter the purchase layer: units bought during the period and their cost per unit, including freight-in if you add it to inventory. Several purchases at different prices cannot be separated here, and averaging them into one cost is only an approximation of true LIFO.
- Enter the total units sold in the period. It cannot exceed opening plus purchased units, and the page refuses that case because you cannot sell stock you never held.
- Read cost of goods sold, ending inventory and ending units together. Ending inventory divided by ending units gives the cost per unit left on the books, which shows which layer the remaining stock came from.
The formula.
Call the opening layer O units at unit cost c₀, the purchase layer P units at c₁, and units sold S. The sale takes min(S, P) units from the purchase layer and the remainder, S − min(S, P), from the opening layer. Cost of goods sold is min(S, P) × c₁ + (S − min(S, P)) × c₀. Ending inventory is the cost of goods available, O × c₀ + P × c₁, minus cost of goods sold, and ending units are O + P − S. As long as sales stay within the period's purchases, only the newest cost reaches the income statement. The opening cost enters only when sales exceed purchases, a LIFO liquidation, where old and often cheap costs flow into cost of goods sold and lift profit. The gap between c₁ and c₀ decides how far the answer departs from FIFO.
A worked example.
The example starts the period with 100 units carried at $8 and buys 80 more at $10, so goods available cost 100 × 8 + 80 × 10 = $1,600 for 180 units. The 120 units sold are matched to the newest layer first: all 80 purchased units at $10 make $800, and the other 40 come out of the opening layer at $8, adding $320. Cost of goods sold is 800 + 320 = $1,120. What remains is 60 units, all from the opening layer at $8, valued at 1,600 − 1,120 = $480. Under FIFO the same sales would take 100 units at $8 and 20 at $10, a cost of goods sold of $1,000 and ending inventory of $600. At a selling price of $15 a unit, LIFO reports gross profit of $680 against FIFO's $800; that $120 gap is exactly the difference between the two ending inventory values.
Frequently asked questions.
Why would a business choose a method that reports lower profit?
Can I use LIFO if my accounts follow IFRS?
What happens if I sell more units than I bought this period?
Do I have to physically sell my newest stock first?
How does LIFO compare with weighted average cost?
Would perpetual LIFO give a different answer?
References& sources.
- [1]Financial Accounting Standards Board. Accounting Standards Codification current 2026. ASC 330 Inventory (PAYWALL). Retrieved 2026-08-06. access: gated.
- [2]OpenStax, Rice University. Principles of Finance, 2022. Chapters 6–10. Retrieved 2026-08-06.
- [3]U.S. Securities and Exchange Commission. Investor.gov current 2026. Investment products and risk. Retrieved 2026-08-06.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 3 cited below
- Method
- LIFO COGS = cost of units sold from newest layer first
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled