FIFO vs weighted average calculator: compare COGS and ending inventory
FIFO assigns the oldest purchase costs to the units sold, while weighted average uses the average cost of all units available. When prices rise, FIFO gives lower cost of goods sold and higher ending inventory. In the example, selling 400 of 600 units costs 4,400 under FIFO and 4,533 under weighted average.
Compare FIFO and weighted average cost
Adds gross profit to the comparison
Units available: 600 units · Weighted average unit cost: 11.33
Comparison
| Item | FIFO | Weighted average | FIFO minus average |
|---|---|---|---|
| Cost of goods sold | 4,400.00 | 4,533.33 | -133.33 |
| Ending inventory | 2,400.00 | 2,266.67 | 133.33 |
| Cost per unit sold | 11.00 | 11.33 | -0.33 |
FIFO ending inventory layers: 200 × 12.00
Runs in your browser. Nothing you type is sent to a server.
FIFO and weighted average formulas
Both methods start from the same cost of goods available for sale. They differ only in how that cost is split between units sold and units left.
- Cost of goods available
- Opening inventory + Purchases
- FIFO cost of goods sold
- Cost of the oldest layers, used up in order
- Weighted average unit cost
- Avg = Cost of goods available / Units available
- Average cost of goods sold
- COGS = Units sold × Avg
- Ending inventory (both)
- Cost of goods available - COGS
This calculator uses the periodic weighted average (one average for the period). A perpetual moving average recalculates the average after every purchase, so the result also depends on when each sale happened.
Worked example: three purchase layers
A shop starts the month with 100 units at 10. It buys 200 units at 11 and then 300 units at 12, so 600 units costing 6,800 are available. It sells 400 units at 20 each.
Under FIFO the 400 units sold come from the oldest layers: 100 × 10 + 200 × 11 + 100 × 12 = 4,400. The 200 units left are valued at the latest cost, 200 × 12 = 2,400. Under weighted average the unit cost is 6,800 / 600 = 11.33, so cost of goods sold is 400 × 11.33 = 4,533 and ending inventory is 2,267. FIFO shows 133 more gross profit because costs were rising.
| Item | FIFO | Weighted average | Difference |
|---|---|---|---|
| Cost of goods sold | 4,400 | 4,533 | -133 |
| Ending inventory | 2,400 | 2,267 | 133 |
| Gross profit (sales 8,000) | 3,600 | 3,467 | 133 |
Assumptions behind the result
- Purchases are listed in the order they arrived; opening stock is the oldest layer.
- Unit costs include everything needed to bring the goods to their location and condition: purchase price, import duties, freight in, less discounts and rebates.
- Weighted average is computed once for the period (periodic method).
- Units sold all left stock within the period, and there were no returns or write-downs.
Which method is allowed: FIFO, weighted average or LIFO?
Under IFRS, IAS 2 allows FIFO and the weighted average cost formula for interchangeable items, and requires specific identification for items that are not interchangeable. LIFO is not permitted under IFRS.
US GAAP still allows LIFO, which is why some US companies report it. Whatever you choose, use the same cost formula for all inventories of a similar nature and use, and apply it consistently from year to year.
How the choice affects profit and tax
When purchase prices rise, FIFO reports lower cost of goods sold, higher profit and a higher inventory value on the balance sheet, because the cheapest old units are expensed first. Weighted average smooths the effect. When prices fall, the order reverses.
Over the life of the business the total cost expensed is the same; the methods only change the timing. The difference matters most for businesses with large stock holdings, long holding periods and fast-moving prices.
| Effect | FIFO | Weighted average |
|---|---|---|
| Cost of goods sold | Lower | In between |
| Gross profit | Higher | In between |
| Ending inventory | Closer to current prices | Blend of old and new prices |
| Volatility of unit cost | Steps with each layer | Smoothed |
Moving average in a perpetual inventory system
A perpetual system updates stock and cost of goods sold with every movement. The moving weighted average recalculates the unit cost after each receipt: (value on hand + value received) / (units on hand + units received). Each issue is then costed at the current average.
Ledgeriano keeps a perpetual stock ledger per warehouse and supports FIFO, moving weighted average and standard cost, posting a balanced journal entry for every stock document.
How to compare FIFO and weighted average
- 1
List the layers
Write down opening stock and each purchase in date order, with quantity and unit cost.
- 2
Total what was available
Add the units and the cost of all layers to get cost of goods available for sale.
- 3
Cost the sales under FIFO
Use up the oldest layers first until you reach the number of units sold.
- 4
Cost the sales at average
Divide total cost by total units and multiply by the units sold.
- 5
Compare
Subtract cost of goods sold from cost available to get ending inventory under each method and compare gross profit.
Frequently asked questions
Is FIFO or weighted average better?
Neither is better in general. FIFO values ending stock closer to current prices and matches the physical flow of most goods. Weighted average is simpler for bulk or mixed items and smooths cost swings. Choose the one that best reflects how your stock moves and apply it consistently.
Why does FIFO give a higher profit when prices rise?
Because the older, cheaper units are charged to cost of goods sold first, while the newer, more expensive units stay in ending inventory.
Can I switch from weighted average to FIFO?
A change of cost formula is a change in accounting policy. Under IFRS (IAS 8) it is allowed only if it gives more reliable and relevant information, and it is applied retrospectively with comparatives restated.
What is the difference between weighted average and moving average?
Periodic weighted average computes one average cost for the whole period after all purchases. Moving average recalculates the average after each purchase, so sales early in the period are costed at an earlier average.
Does the method change the number of units in stock?
No. The physical quantity on hand is the same; only the cost assigned to units sold and units remaining changes.
More free calculators
All free tools- Inventory turnover calculatorHow many times you sell through your stock, and how many days it sits on the shelf.
- EOQ calculatorThe order size that minimises ordering plus holding costs, with orders per year and a reorder point.
- Break-even calculatorUnits and sales you need to cover fixed costs, plus target profit volume and margin of safety.
- VAT calculatorAdd VAT to a net price or extract it from a gross amount, at any rate.
Get these numbers from your real books
Ledgeriano computes break-even, 19 financial ratios and budget variances from your posted entries, for every business you run.