Audited 05 Aug 2026·Last updated 28 Oct 2026·3 citations·Tier 2·0 uses

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

$
$
LIFO cost of goods sold
1,120.00
The cost charged against the period's sales in US dollars, taking the purchase layer first and then the opening layer.
Ending inventory
480.00
Ending units
60

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.

LIFO COGS = cost of units sold from newest layer first

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.

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.

opening Units100
purchase Units80
units Sold120
purchase Unit Cost10
opening Unit Cost8

Frequently asked questions.

Why would a business choose a method that reports lower profit?
Mainly to pay less tax while prices rise, since a higher cost of goods sold lowers taxable income. LIFO also matches current costs with current sales, which some managers find more realistic. US companies on LIFO usually disclose how much higher their inventory would be under FIFO, a figure known as the LIFO reserve, so readers can compare.
Can I use LIFO if my accounts follow IFRS?
No. International Financial Reporting Standards prohibit LIFO, so companies reporting under them choose FIFO or weighted average cost instead. LIFO survives mainly in the United States under US GAAP, where tax rules make it worthwhile, and a company that switches to IFRS must restate its inventory away from it.
What happens if I sell more units than I bought this period?
The sale eats into the opening layer, which is called a LIFO liquidation. With the example's layers and 150 units sold, cost of goods sold is 80 × $10 + 70 × $8 = $1,360, leaving 30 units worth $240. When the old layer was bought years earlier at much lower prices, liquidation pushes those cheap costs into this year and inflates profit and tax.
Do I have to physically sell my newest stock first?
No. LIFO is a cost-flow assumption, not a stock-rotation rule. A grocer can sell the oldest milk first and still assign the newest purchase costs to the sales for accounting. The only thing that moves in LIFO order is the cost attached to each sale.
How does LIFO compare with weighted average cost?
Weighted average spreads the $1,600 of goods available across all 180 units, about $8.89 each, giving a cost of goods sold of $1,066.67 for the example's 120 units. That sits between FIFO's $1,000 and LIFO's $1,120, which is the usual order whenever purchase prices have been rising.
Would perpetual LIFO give a different answer?
It can. Perpetual LIFO applies the rule at the moment of each sale, so units sold before the new purchase arrived must come from the opening layer. This page uses periodic LIFO, treating every sale as happening after all purchases, which charges as many units as possible at the newer cost.

How this page was produced

Published by
Quanta Calculator
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.

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon