📈
📈 Business tools

FIFO Inventory Calculator (cost of goods sold & ending inventory)

Results update as you type. Any currency.

Your numbers

Understanding the FIFO inventory calculator — concept and principle

This calculator applies the first-in, first-out (FIFO) method to a list of inventory lots. It works out the cost of goods sold, the ending inventory, units left, the average cost per unit sold, the oldest unit cost still in stock and, with a selling price, gross profit and margin. Small retailers, bookkeepers and accounting students use it to value stock and check textbook exercises.

First in, first outFirst in, first out: 120 × $18.50 + 200 × $19.75 (oldest lots go first); + 80 × $21.00 (part of the third lot) → $7,850.00 (COGS for 400 units · $19.63 each)First in, first out120 × $18.50 + 200 × $19.75oldest lots go first+ 80 × $21.00part of the third lot$7,850.00COGS for 400 units · $19.63 each
First in, first out — with the default inputs: $7,850.00.

How it is calculated

The principle

FIFO assumes goods leave in the order they arrived, like most perishable stock. The oldest costs go to COGS and the newest stay in inventory. When prices are rising, FIFO therefore gives a lower COGS and higher profit than LIFO, and an ending inventory close to current replacement cost. With FIFO, the periodic method (one calculation at the end) and the perpetual method (after every sale) give the same result. IFRS (IAS 2) allows FIFO and weighted average cost but not LIFO.

Worked example

Defaults: lots 120 at 18.50, 200 at 19.75, 150 at 21.00, 180 at 22.40; 400 units sold at 32.

  1. Goods available = 2,220 + 3,950 + 3,150 + 4,032 = $13,352.00 for 650 units.
  2. COGS = 120 × 18.50 + 200 × 19.75 + 80 × 21.00 = 2,220 + 3,950 + 1,680 = $7,850.00.
  3. Ending inventory = 13,352 − 7,850 = $5,502.00, 250 units (70 at 21.00 and 180 at 22.40).
  4. Average cost per unit sold = 7,850 ÷ 400 = $19.63; oldest cost still in stock = $21.00.
  5. Gross profit = 400 × 32 − 7,850 = $4,950.00; margin = 4,950 ÷ 12,800 = 38.7%.

How to read the result

Compare the average cost per unit sold with the latest purchase price: here 19.63 against 22.40. That gap is the extra profit FIFO reports in a period of rising costs. If prices keep rising, the next period's COGS will be higher even if the selling price does not change, so price decisions should look at replacement cost, not FIFO cost.

Common mistakes

Keep in mind: The method you use must follow your accounting framework and tax rules. This is a calculation aid, not accounting or tax advice.

Frequently asked questions

Does FIFO increase profit?

When costs are rising, yes: the older, cheaper costs go to COGS, so reported profit is higher than under LIFO or average cost.

Is FIFO allowed under IFRS?

Yes. IAS 2 allows FIFO and weighted average cost; LIFO is not permitted.

Do periodic and perpetual FIFO give different results?

No. With FIFO both give the same COGS and ending inventory.

Sources: OpenStax, Principles of Accounting, Volume 1: Financial Accounting, section 10.2 "Calculate the Cost of Goods Sold and Ending Inventory Using the Periodic Method" · IFRS Foundation, IAS 2 "Inventories"

Checked 9 Nov 2026. FIFO periodic method (earliest units sold first; ending inventory = latest purchases; COGS = goods available − ending inventory): OpenStax, “Principles of Accounting, Volume 1: Financial Accounting”, section 10.2 “Calculate the Cost of Goods Sold and Ending Inventory Using the Periodic Method”.

📈 All business tools →🌍 Calculators by country →