Skip to content

FIFO Method Formula for Inventory Costing, Worked Through

The FIFO method formula for inventory costing: layers used oldest first, ending inventory at the newest costs, cost of goods sold, and a month layer by layer.

By Koa Sterling. Product specialist at TaroStack and small business owner. Yes, I am a real human, and I actually sit in front of a computer and write these articles. Reviewed October 12, 2026 · 5 min read

FIFO, first in first out, costs inventory as if the oldest units are used first. Each delivery becomes a cost layer; whatever you use or sell takes its cost from the oldest layer until it's gone, then the next. So ending inventory is valued at the most recent costs, and cost of goods sold carries the older ones. The formulas: ending inventory = the units on hand × the costs of the newest layers that cover them; cost of goods sold = beginning inventory + purchases − ending inventory. In the example below, 55 kg of macadamia nuts bought at three prices leave 8 kg worth $192 and a cost of goods of $1,038. Below is the method layer by layer, the formulas, and how FIFO compares with average cost.

The short version

  • Every delivery is a layer: quantity and the cost per unit you paid.
  • Usage takes cost from the oldest layer first, then the next.
  • Ending inventory = units on hand at the costs of the newest layers.
  • Cost of goods sold = beginning inventory + purchases − ending inventory.
  • In rising prices, FIFO gives lower cost of goods and higher ending value than average cost.
  • FIFO is a cost method; using the oldest stock first on the shelf is a separate habit.
  • TaroStack keeps FIFO layers for every item, freight included. More below.

The formulas

Ending inventory     = units on hand, costed from the newest layers backwards
Cost of goods sold   = beginning inventory + purchases − ending inventory

Or, layer by layer as you go: each time stock is used, take its cost from the oldest layer with units left. Both give the same answer, which is one of FIFO's conveniences: periodic and perpetual FIFO agree.

A month, layer by layer

Windward Roots, the made-up taro business I use in these examples, buys macadamia nuts for its granola. November:

Layer Date Kilos Cost per kg Value
1 On hand, Nov 1 10 $20.00 $200.00
2 Delivery, Nov 4 25 $22.00 $550.00
3 Delivery, Nov 18 20 $24.00 $480.00
Available 55 $1,230.00

Usage: 28 kg from November 1 to 17, then 19 kg from November 18 to 30, 47 kg in all.

First 28 kg      10 kg from layer 1 at $20.00  = $200.00
                 18 kg from layer 2 at $22.00  = $396.00
                 cost                            $596.00
Next 19 kg        7 kg from layer 2 at $22.00  = $154.00
                 12 kg from layer 3 at $24.00  = $288.00
                 cost                            $442.00
Cost of goods sold                              $1,038.00
Left              8 kg of layer 3 at $24.00    =  $192.00

Check with the formula: $200 + $1,030 of purchases − $192 = $1,038. The 8 kg left sit at the newest price, which is why FIFO keeps the shelf valued close to what it would cost to replace.

FIFO against average cost

Method Cost of goods sold Ending inventory
FIFO $1,038.00 $192.00
Weighted average ($1,230 ÷ 55 = $22.36 a kg) $1,051.09 $178.91

With prices rising from $20 to $24, FIFO puts the cheaper, older nuts into this month's cost and leaves the dearer ones on the shelf; the average blends them. Both add up to the same $1,230. How the average works, including the moving average software uses, is in how to do weighted average cost, and the wider comparison with LIFO and write-downs in what is inventory valuation.

FIFO for cost, FEFO on the shelf

FIFO costing is about which price goes with which use, not which bag you pick up. On the shelf, a food business should use the stock that expires first, which is usually but not always the oldest delivery. The two run independently: the costing follows layers in delivery order, the shelf follows dates. The shelf side is in FIFO and FEFO in the food industry.

What it does to a product's cost

A batch of granola uses 1.5 kg of macadamias. Costed from layer 1, that's $30.00; from layer 3, $36.00. A batch made in late November really did cost $6 more in nuts than one made at the start, and FIFO says so, while a cost sheet with one price per ingredient doesn't. How that flows into a bag's price is in how to price granola.

Where this stops working

FIFO by hand means keeping every layer for every item: what's left of each delivery and at what price, updated every time something is used. For a few items a spreadsheet can do it; for forty ingredients with deliveries most days, batches using parts of two layers, and freight to add to each layer, it's the job that quietly becomes "last price paid".

How TaroStack does it

TaroStack keeps the layers for every item, delivery by delivery, so FIFO costing happens without anyone tracking it.

Every delivery is a layer, at its real cost. Deliveries come in at the price you paid, with freight and other landed costs spread across what arrived, so each layer carries what it really cost to get to your door. You choose FIFO layers or moving average when you set up, and the method locks once stock has moved, which is the consistency your accountant wants.

Every batch and sale takes from the layers. A batch that uses the last of one delivery and the first of the next is costed from both, and the finished goods go on at what they actually cost. Recipes contain sub-recipes, so a dearer layer flows through to every product that uses it, and margins are reported per product on actual cost. On the shelf, picking follows dates, oldest expiry first, separately from the cost layers.

And the value is always current. Stock value is kept at cost, per site, item and type, with a month-by-month history, so ending inventory at FIFO is a screen. A price-creep report per supplier shows the layers getting dearer.

The job By hand In TaroStack
Keep each layer A row per delivery, updated by hand Every delivery, automatically
Freight in the layer Usually left out Spread across what arrived
A batch across two layers Rounded to one price Costed from both
Ending inventory A calculation Stock value, by month

Stock value, FIFO or moving average, and landed costs are on every plan, from $49 a month; batches that carry layer costs into products are on Standard at $99. The first 30 days are free, with no credit card. If you'd like a hand setting up, ask, and we'll do it with you.

Questions people also ask

What is the FIFO formula?

Ending inventory is the units on hand costed at the newest layers; cost of goods sold = beginning inventory + purchases − ending inventory. In the example, $200 + $1,030 − $192 = $1,038.

How do you calculate FIFO cost of goods sold?

Take the cost of each unit used from the oldest layer with units left, then the next. In the example, the first 28 kg cost $596 and the next 19 kg cost $442, $1,038 in all.

Is FIFO better than average cost?

Neither is better everywhere. FIFO keeps the shelf near today's prices and suits separate lots; average cost suits stock that mixes in one bin. Pick one with your accountant and keep it.

Does FIFO mean using the oldest stock first?

Not necessarily. FIFO costing assigns the oldest costs first. Which stock you physically use should follow dates, the soonest to expire first, especially for food.

We use AI to help with the research for these articles. Every one is read, checked against its sources and edited by Koa before it's published. Spot a mistake? Tell us and we'll fix it and say so. How we write these.

Let’s get your stack in order.

Get TaroStack

Sign up now for your free 30 day trial. No credit card required.