One self-hosted console to run your entire business — commerce, ERP, HRM, CRM & manufacturing

Inventory Costing Explained: FIFO, Weighted Average and Why Your Margins Depend on It

The costing method decides how the same purchases split between COGS and stock, so it moves gross margin, inventory value and tax. A worked example, landed cost, write-downs, returns and a checklist for choosing a method.

Author

Anichur Rahaman

1 month ago11 min read2 views
Inventory Costing Explained: FIFO, Weighted Average and Why Your Margins Depend on It

On the last evening of the month, the stock software of a small import shop shows a 57.3% gross margin and $2,000 of stock left. The owner bought one product in three lots of 100 units, at $10, $12 and $14, and sold 150 of them at $25 each.

A friend runs a shop with the same lots and the same sales. His report says 52.0% and $1,800. Neither of them made a mistake, and no unit went missing.

The gap comes from the inventory costing method: the rule that decides which purchase price is attached to a unit when it is sold. It changes cost of goods sold (COGS), gross margin, the value of the stock on the balance sheet and, in many countries, the tax you pay. This article explains the main methods, checks that example by hand, covers landed cost, write-downs and returns, and ends with a checklist for choosing and changing a method safely.

Why the costing method moves your margin

Every purchase you make is a cost layer: a quantity of units bought at a specific unit cost. Stock on hand is the set of layers that have not been sold yet. When you sell, the system must decide which layer the sold units came from, because each layer carries a different price.

The total cost of what you bought does not change. What changes is the split: how much of it is expensed as COGS now, and how much stays on the balance sheet as inventory for later. When prices are rising, the method that expenses older, cheaper layers first shows a higher profit today. The method that expenses newer, dearer layers first shows a lower one.

That is why the choice is not cosmetic. It feeds three numbers an owner watches closely: gross margin, inventory value (which lenders and investors read) and taxable profit.

The four common costing methods

FIFO: first in, first out

FIFO assumes the oldest units are sold first. It matches how most shops physically work, especially with food, cosmetics or anything with an expiry date. COGS uses older prices, and the stock left on the shelf is valued at the most recent prices. In a period of rising costs, FIFO gives the highest profit and the highest stock value of the common methods.

Weighted average cost

Weighted average blends all the layers into one price: total cost of stock divided by total units. A periodic average recalculates once at the end of a period. A moving average recalculates after every purchase, so each sale uses the average as it stood at that moment. It is simple, stable and good for goods that are mixed together, such as bulk items, screws, fabric by the metre or liquids.

Specific identification

Here each unit keeps its own cost, tracked by serial number or batch. It is the right method for items that are unique or high value: cars, jewellery, custom furniture, or goods produced for a particular customer or project. It is accurate, but impractical for thousands of identical units.

Standard cost

Manufacturers and large distributors often set a standard cost per unit, a planned figure reviewed every quarter or year, and record the gap between standard and actual as a variance. It makes budgeting and pricing easier. It is acceptable for reporting only when the standard stays close to real costs, so the variances must be reviewed and the standard updated regularly.

What the accounting rules say: IFRS and US GAAP

The rules differ in one important place. Under IFRS, the standard on inventories (IAS 2) allows FIFO and weighted average for interchangeable goods, specific identification for goods that are not interchangeable, and standard cost as a practical shortcut when it approximates actual cost. It does not allow LIFO (last in, first out). The IASB's reasoning is that LIFO rarely matches the physical flow of goods and can leave stock on the balance sheet at very old prices.

Under US GAAP, LIFO is permitted. In the United States there is also a tax rule, the LIFO conformity requirement in Internal Revenue Code section 472: a company that uses LIFO for its tax return must use it in its financial statements too. That is why LIFO is common among some large US companies in inflationary periods, since it lowers taxable profit, and absent in most of the rest of the world.

The practical advice for a growing business outside the United States is short: choose between FIFO and weighted average. In some countries the tax authority prescribes or restricts methods, so the rules of your own country and your accountant matter more than any general guide, this one included.

A worked example you can check by hand

This is an illustrative example, with simple numbers. A shop buys the same product in three lots, each 100 units, with prices rising. Then it sells 150 units at $25 each, so revenue is $3,750.

  • Lot 1: 100 units at $10.00 = $1,000
  • Lot 2: 100 units at $12.00 = $1,200
  • Lot 3: 100 units at $14.00 = $1,400
  • Total: 300 units, $3,600 (average $12.00 per unit)
Diagram comparing FIFO and weighted average on the same three purchase lots: FIFO sells 100 units at $10 and 50 at $12, weighted average sells 150 units at $12
The same 300 units and $3,600 of purchases, split differently between COGS and stock left.

After the sale, each method reports this:

MethodCOGSEnding stockGross profitGross margin
FIFO$1,600$2,000$2,15057.3%
Weighted average (periodic)$1,800$1,800$1,95052.0%
Moving average (sale before lot 3 arrives)$1,650$1,950$2,10056.0%
LIFO (US GAAP only)$2,000$1,600$1,75046.7%

Check the arithmetic. FIFO sells 100 units at $10 and 50 at $12, so COGS is $1,000 + $600 = $1,600. The 150 units left are 50 at $12 and 100 at $14: $600 + $1,400 = $2,000. Together, $3,600.

Periodic weighted average uses $3,600 ÷ 300 = $12.00 for everything: COGS 150 × $12 = $1,800 and stock 150 × $12 = $1,800. Moving average depends on timing. If the sale happens after lot 2 arrives but before lot 3, the average is $2,200 ÷ 200 = $11.00. COGS is 150 × $11 = $1,650. Then 50 units at $11 remain ($550), lot 3 arrives ($1,400), and stock is $1,950. LIFO sells 100 units at $14 and 50 at $12, so COGS is $1,400 + $600 = $2,000 and stock is $1,600.

The same sale shows margins from 46.7% to 57.3%, a gap of more than ten points, with no change in what was bought or sold. At an illustrative 25% tax rate, the $400 difference between FIFO and LIFO profit is $100 of tax, paid earlier under one method than the other. Over time, in a steady business, the totals even out. In a growing business with rising prices, the gap keeps reappearing.

Landed cost: the number most shops get wrong

The unit cost in your layers should be the landed cost: everything it took to get the goods to your shelf in sellable condition. That includes the supplier's price, inbound freight, import duties that are not recoverable, insurance and handling at receiving. IAS 2 says the cost of inventory comprises purchase costs and other costs of bringing it to its present location and condition,. Trade discounts reduce it.

Leaving these out is the most common costing error in small businesses. It makes goods look cheaper than they are and margins look healthier than they are. The mistake shows up later as a gap between the profit on paper and the cash in the bank.

Waterfall chart of one imported unit: $10.00 price plus $0.80 freight, $0.50 import duty, $0.20 insurance and $0.50 receiving makes a $12.00 landed cost
An illustrative imported unit: a $10.00 invoice price becomes a $12.00 landed cost, and the margin at a $25 price falls from 60.0% to 52.0%.

In the example, the $12.00 of lot 2 is such a landed figure: $10.00 + $0.80 freight + $0.50 duty + $0.20 insurance + $0.50 receiving. At a $25 selling price, counting only the $10.00 invoice price suggests a 60.0% margin. The true margin is 52.0%. Pricing decisions made on the first number lose money on every sale.

Shipments usually arrive with a freight bill that covers many products. Allocate it across the items on the shipment by quantity, weight, volume or value, whichever fits the goods, and apply the same rule every time. Costs that arrive after the goods are received, such as a late customs invoice, should still be added to the lot, or at least reflect in the remaining stock of that lot.

Write-downs and returns

Write-downs to net realisable value

Inventory must not sit on the balance sheet above what you can recover. Under IFRS, stock is measured at the lower of cost and net realisable value (NRV), which is the expected selling price minus the costs needed to sell it. US GAAP uses the same idea for FIFO and average cost. If the price of lot 3 in our example falls so that its NRV is $11.00, the 100 units are written down by 100 × ($14 − $11) = $300, and ending stock under FIFO drops from $2,000 to $1,700.

Damaged, expired and obsolete goods follow the same logic, and they should be reviewed on a schedule, not once a year in a panic. One difference is worth knowing: IFRS requires a write-down to be reversed if the NRV later recovers, up to the original cost, while US GAAP generally does not allow reversals.

Returns

A customer return should put the unit back into stock at the cost it left with, not at today's average or latest purchase cost. Otherwise a return silently changes your margin history. Returns that cannot be resold go straight to a write-off at that cost. Returns to suppliers work the other way around: they reduce the lot they came from.

Posting COGS on every sale, not at month end

Many small businesses still count stock at month end and work out COGS by a formula: opening stock plus purchases minus closing stock. It works, but it is a guess about everything in between. Losses, theft, mistakes and returns all end up inside the "COGS" number, and nobody can tell which sales made money.

The alternative is the perpetual method. Each sale posts its own COGS entry at the moment it happens: debit cost of goods sold, credit inventory, using the unit cost from the costing method. Every receipt posts the opposite, with landed cost included. Then margin per order, per product and per channel is available every day, and the stock value in the ledger can be reconciled against a physical count.

Flowchart: a unit is sold or returned, the costing method picks the oldest layer or the running average, COGS is posted, and a return is restocked at the cost it left with or written down to net realisable value
One unit, start to finish: the method picks the cost, COGS is posted, and a return goes back at the cost it left with.

An integrated system helps here, because the sale, the stock movement and the journal entry come from the same event. A platform such as StoreConsole, for instance, carries cost on each stock movement and posts the COGS entry in the accounting ledger at the time of sale. The short tour below shows the accounting side.

Accounting tour (0:58): how sales and stock movements flow into the ledger.

How to choose, and how to switch

For most retailers and distributors, the decision is FIFO or weighted average. FIFO suits perishable goods and tells a clear story. Weighted average suits mixed or bulk goods and smooths out price swings. Use this checklist:

  1. Check what your tax authority and accounting framework allow. Under IFRS, LIFO is out. Some countries restrict other methods too.
  2. Match the method to how goods move. Expiry dates and batches point to FIFO. Mixed bulk stock points to weighted average. Serialised, unique items point to specific identification.
  3. Use one method for similar items, and apply it consistently. Different product families may use different methods, but not on a whim.
  4. Fix landed cost first. Decide which costs go into unit cost and how freight is allocated. A better method on a wrong cost gives wrong answers faster.
  5. Make sure your software can support the method end to end: costing on every receipt, sale and return, with a trail from the ledger back to the layers.
  6. Talk to your accountant before any change. A change in costing method is usually treated as a change in accounting policy: it is applied to prior periods, disclosed, and may need tax authority approval.
  7. Run both methods side by side for a period before switching, and keep the reconciliation.

Consistency matters more than the method itself. Switching to flatter a bad quarter is the one use of costing that auditors, lenders and tax inspectors all notice.

Back to the two shops. Once both owners write down their method, use the same landed-cost rule and post COGS on every sale, their reports can be reconciled line by line. $1,600 against $1,800 of COGS is a $200 difference with a name, not a mystery. Each can say why her margin is what it is, and neither is surprised when the bank, the accountant or the tax office asks.

Key takeaways

  • The costing method decides how the same purchases are split between COGS and inventory, so it moves gross margin, stock value and tax.
  • In our illustrative example the same sale shows margins between 46.7% and 57.3%, depending on the method.
  • IFRS (IAS 2) allows FIFO and weighted average but not LIFO. US GAAP allows LIFO, tied to a tax conformity rule.
  • Put landed cost, not the invoice price, into unit cost, or your margins look better than they are.
  • Write stock down to net realisable value, and return goods to stock at the cost they left with.
  • Post COGS on every sale, stay consistent, and involve your accountant before any switch.

Anichur Rahaman is a software architect and the creator of StoreConsole. He designs commerce and ERP systems for growing businesses, with a focus on event-driven architecture, data integrity and self-hosted operations.

About the Author

Anichur Rahaman

Continue Reading