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

FIFO For Inventories Calculator

FIFO cost of goods sold and ending inventory from an opening stock layer and one purchase layer: units and unit cost for each, plus the units you sold.

FIFO For Inventories Calculator

$
$
FIFO cost of goods sold
1,000.00
The cost charged against the period's sales in dollars, taking units from the opening layer first and from the purchase only after it runs out.
Ending inventory
600.00
Ending units
60

Background.

A shop that buys the same product at different prices through the year ends up with identical boxes on the shelf that cost different amounts. Nothing on the box says which price it carries, so the accounts have to assume an order. First-in, first-out assumes the oldest stock leaves first: units sold are costed at the earliest prices paid, and whatever is still on hand carries the most recent ones.

The assumption moves real numbers. When purchase prices are rising, FIFO matches older, cheaper costs against this period's sales, so cost of goods sold comes out lower and gross profit higher than under last-in, first-out. In the default example, selling 120 of 180 units costs $1,000 under FIFO and $1,120 under LIFO: $120 more expense and $120 less profit from exactly the same goods. The flip side is the balance sheet, where FIFO leaves inventory valued at recent prices, close to what it would cost to restock.

FIFO is accepted under both US GAAP and IFRS, while IFRS does not permit LIFO at all, so FIFO is the usual choice for businesses that report internationally. It also tends to mirror how perishable and dated stock physically moves, although it does not have to.

The working here uses two cost layers: the opening inventory and a single purchase. Sales draw down the opening layer first and reach the purchase only once it is exhausted. Returns, write-downs to net realizable value and periods with more than one purchase lot are outside its scope.

What is fifo for inventories calculator?

FIFO cost of goods sold is the cost assigned to units sold on the assumption that the earliest-acquired units go out first. With an opening layer and one purchase layer, sales consume the opening units at their cost until none remain, then purchase units at theirs. Ending inventory is the cost of all goods available for sale minus that cost of goods sold, which leaves the unsold units valued at the most recent prices.

How to use this calculator.

  1. Enter the opening layer: units on hand at the start of the period and the cost per unit they were carried at in the last closing valuation.
  2. Enter the purchase layer: units bought during the period and the cost per unit, including freight-in and other costs of getting the goods to you, less any trade discount.
  3. Enter the units sold in the period. The total cannot exceed opening units plus purchased units.
  4. Compare the ending units with your physical stock count. Any gap is shrinkage, damage or a counting error, and needs adjusting separately.
  5. With more than one purchase in the period, check whether sales reach beyond the first purchase. If they do not, enter the first two layers here and add the cost of later purchases to the ending inventory yourself.

The formula.

FIFO COGS = cost of units sold from oldest layer first

Write the opening layer as n₁ units at cost c₁, the purchase as n₂ units at c₂, and units sold as S. FIFO takes S₁ = min(S, n₁) from the opening layer and S₂ = S − S₁ from the purchase. Cost of goods sold = S₁ × c₁ + S₂ × c₂. The cost of goods available is n₁ × c₁ + n₂ × c₂, and ending inventory is goods available minus cost of goods sold, which works out to (n₁ − S₁) × c₁ + (n₂ − S₂) × c₂. Ending units are n₁ + n₂ − S. The threshold that matters is n₁: while sales stay within the opening layer, COGS is simply S × c₁ and the purchase price has no effect on it at all; it only changes the value of what is left.

A worked example.

Example

Opening stock is 100 units carried at $8 each. During the period 80 more are bought at $10, and 120 units are sold. FIFO empties the opening layer first: 100 × $8 = $800. The remaining 20 units sold come from the purchase: 20 × $10 = $200. Cost of goods sold is $800 + $200 = $1,000. Goods available cost 100 × $8 + 80 × $10 = $1,600, so ending inventory is $1,600 − $1,000 = $600, which is the 60 unsold units, all from the newer lot at $10. For contrast, LIFO would sell the 80 newer units first (80 × $10 = $800) and then 40 older ones (40 × $8 = $320), for $1,120 of cost and $480 left in inventory. Weighted average costing, at $1,600 ÷ 180 = $8.89 a unit, lands between them at $1,066.67.

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

Frequently asked questions.

Why does FIFO show higher profit when prices are rising?
Because it charges sales with the oldest, cheapest costs. In the example, FIFO cost of goods sold is $1,000 against $1,120 under LIFO, so gross profit is $120 higher. When prices fall the effect reverses: FIFO expenses the older, dearer units and reports lower profit than LIFO would.
Do I have to sell the oldest stock first to use FIFO?
No. FIFO is a cost-flow assumption, not a rule about which physical units leave the building. A hardware store selling interchangeable screws can cost them on a FIFO basis even if customers pick from the newest box. Specific identification is the method that tracks individual items instead.
Does FIFO give a different answer under perpetual and periodic inventory systems?
No, and that is a useful property of FIFO. Whether you cost each sale as it happens or once at period end, the units treated as sold are always the earliest ones received, so cost of goods sold and ending inventory come out the same. Under LIFO and under average costing, the two systems can give different answers.
Why is FIFO common for companies reporting under IFRS?
IAS 2, the IFRS inventory standard, allows FIFO or weighted average cost for interchangeable goods and does not permit LIFO. A company preparing IFRS statements therefore cannot use LIFO, and FIFO is the natural choice when stock broadly turns over in the order it arrives.
What if I made three or four purchases during the period?
Only two layers fit here. If units sold do not exceed the opening layer plus the first purchase, the later lots were never touched: run the first two layers, then add the later purchases at their own cost to ending inventory. If sales reach further, the later layers need costing by hand.
What should I do if stock has lost value since I bought it?
Inventory measured on FIFO is carried at the lower of cost and net realizable value, so damaged, obsolete or price-collapsed goods must be written down to what they will actually sell for, less selling costs. That write-down is a separate adjustment not included in the figures here.

How this page was produced

Published by
Quanta Calculator
Primary sources
3 cited below
Method
FIFO COGS = cost of units sold from oldest 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