Skip to main content
All posts
Education· by Sharvari Joshi

FIFO vs Weighted Average: How to Pick an Inventory Costing Method

FIFO and weighted average are the two inventory costing methods most small businesses choose between. Here's how each works, with real dollar examples, tax implications, and which one to pick.

You bought 100 units of a product at $10 each in January. You bought another 100 at $12 each in March. By April you have sold 150 units. What was your cost of goods sold?

If you say “$1,750” you are using FIFO. If you say “$1,650” you are using weighted average. Both are valid. Both are accepted by the IRS, by GAAP, and by every auditor on earth. They produce different numbers on your P&L, your tax bill, and your inventory valuation. Picking the wrong one for your business does not break your books, but it does cost you real dollars over time.

This post is a plain English walkthrough of FIFO vs weighted average, with real numbers, tax implications, when each one makes sense, and how to actually run the math in software instead of by hand. By the end you should know which method fits your business and how to set it up.

What inventory costing actually solves

Every product you sell has a cost. The cost shows up on your P&L as Cost of Goods Sold (COGS), which is what you subtract from revenue to get gross margin. The cost is also what shows up on your balance sheet as the value of inventory you still hold.

The trouble is that you bought the same product at different prices over time. Maybe your supplier raised prices in March. Maybe you got a volume discount on a big buy. Maybe shipping was higher on the second order. So when you sell a unit in April, the question is: which unit did you sell? The cheap one from January or the expensive one from March?

The answer determines how much COGS lands on your P&L this period and how much inventory value remains on your balance sheet. Different methods give different answers. Inventory costing is the rules for picking which cost to assign.

There are four methods: FIFO (first in, first out), LIFO (last in, first out), weighted average, and specific identification. LIFO is allowed in the US but banned under IFRS, so most international businesses cannot use it. Specific identification is for high-value unique items (cars, jewelry). For most small businesses, the choice is FIFO or weighted average.

FIFO, walked through with real numbers

FIFO assumes you sell the oldest inventory first. The unit you bought in January gets shipped before the unit you bought in March. The COGS reflects the cost of the oldest units you have on hand.

Example. You bought 100 units at $10 in January, 100 units at $12 in March, and you sold 150 in April.

Under FIFO, you sold:

  • All 100 units from the January batch (cost: 100 × $10 = $1,000)
  • 50 units from the March batch (cost: 50 × $12 = $600)
  • Total COGS: $1,600

Wait, I said $1,750 earlier. Let me redo with that number.

Corrected example. 100 units at $10 in January, 100 units at $15 in March, sold 150 in April.

Under FIFO:

  • 100 units from January at $10 = $1,000
  • 50 units from March at $15 = $750
  • Total COGS: $1,750
  • Inventory remaining: 50 units at $15 = $750

The number on your P&L for this period is $1,750 in COGS. The number on your balance sheet for ending inventory is $750.

The mental model: FIFO is the “first-in line is first-out the door.” Whatever you bought first is what you assume you sold first.

Weighted average, walked through with real numbers

Weighted average computes one blended cost per unit across all your purchases, then applies that blended cost to every unit sold. Same example.

Same example. 100 units at $10 in January, 100 units at $15 in March, sold 150 in April.

Total cost of all units: 100 × $10 + 100 × $15 = $1,000 + $1,500 = $2,500 Total units: 200 Weighted average cost per unit: $2,500 / 200 = $12.50

Sold 150 units at the weighted average:

  • COGS: 150 × $12.50 = $1,875
  • Inventory remaining: 50 × $12.50 = $625

The number on your P&L for this period is $1,875 in COGS. The number on your balance sheet for ending inventory is $625.

Notice how the two methods produce different numbers. FIFO COGS was $1,750. Weighted average COGS is $1,875. The difference is $125 in this single example. Across thousands of transactions, the total numbers diverge meaningfully.

The same total cost, different timing

Here is the part that surprises most people. Across the entire life of a product line, FIFO and weighted average produce the same total cost. The difference is timing. FIFO recognizes the cost in a different period than weighted average does.

In our example, the full $2,500 of inventory cost flows through COGS eventually. FIFO put $1,750 of it in this period and $750 in the next. Weighted average put $1,875 in this period and $625 in the next. After the inventory is fully sold, both methods total $2,500 in COGS. Same number.

This matters because COGS in any given period directly affects:

  • Your gross margin in that period
  • Your taxable income in that period
  • Your tax bill for that year

Different timing means different tax in any given year. Across many years it evens out.

Which one shows higher profit when prices are rising?

Inventory costs almost always rise over time (inflation). When prices rise:

  • FIFO assumes you sold the cheap stuff first. Your COGS uses the older lower costs. Your COGS is lower. Your gross margin is higher. Your taxable income is higher. Your tax bill is bigger.
  • Weighted average blends old and new. Your COGS sits in the middle. Your gross margin is in the middle. Your tax bill is in the middle.

So during an inflationary period, FIFO makes your business look more profitable but you pay more tax. Weighted average looks less profitable but pays less tax.

A lot of business owners pick FIFO because their accountant said so, then complain about the tax bill, then realize their accountant picked it specifically because the higher reported profit looked better to a bank for a loan application. Pick on purpose.

Tax implications in detail

The IRS allows either method. Once you pick one, you stick with it for that product line; switching mid-year requires IRS Form 3115 and a multi-year adjustment.

FIFO tax consequence. In a rising-price environment, FIFO produces higher taxable income because COGS is lower. You pay more tax this year. The “extra” tax is essentially a prepayment, since over the full lifecycle the total tax is the same.

Weighted average tax consequence. Smoother taxable income year to year. Lower tax in the period your costs are rising, higher tax later if costs eventually fall. Less volatile tax bills.

For most US small businesses on accrual basis, the weighted average method produces a simpler and slightly more tax-favorable result during inflation. This is one reason many ERPs default to weighted average.

Inventory valuation on the balance sheet

The other side of the COGS coin is ending inventory value, which sits on your balance sheet as a current asset.

  • FIFO values ending inventory at the most recent prices. Inflation pushes the balance sheet inventory value higher. Looks better in a balance sheet ratio analysis.
  • Weighted average values ending inventory at the blended cost. Lower than FIFO during inflation, higher during deflation.

A lender looking at your balance sheet sees a different inventory number depending on which method you use. For most small businesses this does not matter day to day, but if you are applying for an asset-backed loan, the choice meaningfully affects how much you can borrow against inventory.

When FIFO is the right pick

Perishable goods. If you sell food, beverages, dairy, fresh products, FIFO matches reality. The oldest inventory really does need to go out first or it spoils. Your books match what is happening in the warehouse.

High-value low-turn items. If you sell expensive items that move slowly, FIFO gives you a clean lot-by-lot trail of which specific batch a sale came from.

You want a cleaner audit trail. FIFO is more granular per transaction. Each sale is tied to a specific purchase batch. Auditors can trace a single unit through purchase, hold, sale.

You operate internationally and use IFRS. IFRS allows FIFO and weighted average but bans LIFO. FIFO is the more common pick under IFRS.

Your costs are mostly stable or falling. FIFO and weighted average converge when prices are stable. If you have stable supplier pricing, FIFO is slightly more transparent.

When weighted average is the right pick

High volume of identical SKUs at variable prices. If you buy and sell the same SKU dozens of times a month at varying prices, FIFO produces a complicated lot-by-lot ledger that is hard to manage. Weighted average gives you one number.

Commodity-style products. If you sell pallets of screws, bags of flour, or barrels of oil where individual units are not distinguishable, weighted average matches reality.

You want smoother gross margins. Weighted average smooths out the price volatility from individual purchase batches. Your monthly gross margin is more stable, which is easier to forecast.

Tax simplicity. Weighted average produces one cost per period instead of a per-batch cost trail. The tax computation is simpler.

Inflation environment. Weighted average produces a moderate COGS instead of FIFO’s “lower COGS now, higher tax now” pattern.

For most small businesses with high SKU turnover and commodity-style products, weighted average is the simpler and slightly more tax-efficient pick. For boutique retailers with low SKU count and high-value items, FIFO is cleaner.

What about LIFO?

Last in, first out. The opposite of FIFO. You assume you sold the most recently purchased units first, leaving the older cheaper units on the balance sheet.

Why anyone uses LIFO: in an inflationary environment, LIFO maximizes COGS (using the most recent expensive prices) which minimizes taxable income. It is purely a tax minimization strategy.

Why most businesses do not: LIFO is banned under IFRS, so any company that ever wants to operate internationally or be acquired by a public company has to switch off LIFO eventually. The switch is painful and expensive. Most accountants today recommend against starting on LIFO unless you have a very specific tax-driven reason.

ERPClaw does not implement LIFO in v1. We may add it later for US-only customers who specifically want it, but it is not on the v1.x roadmap.

How ERPClaw handles inventory costing

ERPClaw ships with both FIFO and weighted average in the core inventory module. You pick the method per item. Most items default to weighted average; you can override per SKU.

Setting the costing method. When you create an item with add-item, the valuation_method parameter accepts FIFO or WeightedAverage. The default is WeightedAverage because it covers most small business cases.

FIFO implementation. ERPClaw maintains a per-item lot ledger. Every purchase creates a lot with its own cost. Every sale consumes the oldest lot first, posting COGS at that lot’s cost. The lot ledger lives in the stock_ledger_entry table, immutable, append-only, with the same audit guarantees as the GL.

Weighted average implementation. ERPClaw maintains a running per-item average cost. Every purchase recomputes the average: (existing_qty × existing_avg + purchase_qty × purchase_cost) / (existing_qty + purchase_qty). Every sale uses the current average for COGS.

Switching methods. If you start on weighted average and decide to switch to FIFO, the migration requires re-creating lots from purchase history, which ERPClaw can do via a one-time recompute-inventory-costing action. The recompute reads all historical purchases, builds the lot ledger, and posts adjusting GL entries to reconcile. Audit-trail-friendly.

Decimal precision. All costs are stored as Decimal, never float, to avoid the sub-penny accumulation errors that plague spreadsheet-based inventory tracking.

Common mistakes small businesses make

Mistake 1: tracking inventory in a spreadsheet at retail price. Retail price is not cost. Your spreadsheet looks like an inventory ledger but cannot produce COGS because it does not know what you paid. Fix: track cost separately or move to a real inventory system.

Mistake 2: averaging cost in your head. “I think they cost about $12 each” is not a valuation method. Pick FIFO or weighted average and let the system compute it.

Mistake 3: never doing a physical count. Books say 200 units on hand; warehouse has 178. The 22 unit gap is a real loss that must be written off. Annual physical counts (or cycle counting weekly) are a baseline control.

Mistake 4: changing methods without filing Form 3115. The IRS requires consistency in inventory methods. Switching mid-year without the form is a compliance issue. Pick at start, or file the form to switch.

Mistake 5: forgetting freight and duties. “Cost” is not just what the supplier billed for the goods. It includes inbound freight, customs duties, insurance, and any direct cost of acquisition. Most small businesses miss these and underreport COGS by 5% to 15%.

Mistake 6: ignoring shrinkage. Theft, breakage, spoilage, miscounts. Real businesses lose 1% to 3% of inventory to shrinkage. Recognize the loss as a COGS or expense entry; do not pretend the units are still on the shelf.

ERPClaw catches the first four directly via the structure of the stock_ledger_entry table. The last two are workflow choices the operator makes.

Try it on real data

If you want to see FIFO and weighted average run against your own purchase history, ERPClaw is free and open source. Install in five minutes, import a CSV of purchases and sales, run the inventory valuation report, and see the numbers your accountant has been computing by hand.

ERPClaw is open source, AI-native, and ships with both FIFO and weighted average in the core install. No upgrade tier, no per-user fee, no enterprise gate.

FAQ

Can I use different costing methods for different items?

Yes. ERPClaw lets you set the valuation method per item. Most businesses pick one default and override only for specific product lines that need the other method. For example, perishables on FIFO, commodities on weighted average.

Once I pick a method, can I change it later?

Yes, but you have to follow the rules. The IRS requires consistency, and changing methods mid-year requires Form 3115 and a multi-year adjustment. ERPClaw can recompute the historical valuation under the new method, but talk to your accountant about the tax filing first.

Does FIFO require lot or batch tracking?

ERPClaw’s FIFO implementation uses an internal lot ledger keyed by purchase date and cost. You do not have to track external lot numbers (the kind printed on a manufacturer’s label) unless you separately need them for compliance. The internal lot ledger is automatic.

What about the lower of cost or market rule?

Both FIFO and weighted average value inventory at cost. If the market value drops below cost (your supplier slashed prices, or your goods became obsolete), GAAP requires you to write inventory down to market value. ERPClaw supports inventory write-downs via the write-down-inventory action; the GL posts the loss to the appropriate expense account.

Does ERPClaw support LIFO?

Not in v1. LIFO is allowed in the US but banned under IFRS, and most accountants today recommend against new LIFO implementations. We may add LIFO in a later release for US-only customers with a specific tax-driven need.

How accurate is the cost calculation?

All costs are stored as Decimal, not float, so there is no sub-penny accumulation error. Every cost calculation rounds explicitly using ROUND_HALF_UP to two decimal places. The valuation matches what an auditor would compute by hand, exactly.

Does the inventory module run on PostgreSQL?

Yes. ERPClaw is database-agnostic via PyPika. The inventory module runs on SQLite (default) or PostgreSQL with the same code. The stock_ledger_entry table and all valuation queries work on either backend.

Install ERPClaw and run FIFO vs weighted average against your own data to see the dollar difference.

Tagsinventoryfifoweighted-averageaccountingeducation