LIFO Calculator for Inventory

Calculate cost of goods sold and ending inventory value under the LIFO (Last-In, First-Out) method. Enter your beginning inventory, one purchase layer, and units sold to see which costs are expensed and which remain on the books.

Quick Facts

LIFO method
Newest costs are expensed first
Last-In, First-Out assumes the most recently purchased units are sold first, leaving older costs in ending inventory.
Rising-cost effect
Higher COGS, lower reported profit
When purchase costs rise over time, LIFO produces higher cost of goods sold than FIFO for the same units sold.
Accounting scope
Permitted under US GAAP, not IFRS
LIFO is allowed under US GAAP but is prohibited under IFRS, which most other countries follow.

Your Results

Calculated
Cost of goods sold (LIFO)
-
Cost of units sold, newest layer first
Ending inventory value
-
Cost of units remaining on hand
Ending inventory units
-
Units left after the sale
Average cost per unit sold
-
COGS divided by units sold

Ready

Enter beginning inventory, your purchase layer, and units sold, then press Calculate.

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:

  1. 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.
  2. 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.
  3. Cost of goods sold = the sum of the cost of every unit drawn from each layer, newest layer first.
  4. 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).

Frequently Asked Questions

How does LIFO calculate cost of goods sold?
LIFO (Last-In, First-Out) assumes the most recently acquired units are sold first. The calculator treats your purchase layer as the newest inventory and your beginning inventory as the oldest. Units sold are drawn from the purchase layer first at the purchase cost per unit; if units sold exceed the purchase quantity, the remainder is drawn from beginning inventory at its cost per unit. Cost of goods sold is the sum of those layer costs.
What is the difference between LIFO and FIFO?
FIFO (First-In, First-Out) sells the oldest units first, so ending inventory reflects the most recent costs. LIFO sells the newest units first, so ending inventory reflects the oldest costs. When purchase costs are rising, LIFO produces higher cost of goods sold and lower reported profit than FIFO, because the more expensive recent units are expensed first.
Why can't units sold exceed total units available?
You cannot sell more units than you have on hand. Total units available equals beginning inventory units plus units purchased during the period. If units sold exceeds that total, the calculator flags the input as invalid rather than reporting a negative ending inventory.