Free tool · nothing leaves your browser
FIFO vs weighted average calculator
Enter what you bought and how much you sold. The calculator shows cost of goods sold, closing stock value and gross profit under FIFO and under weighted average, side by side, in any currency.
Nothing you type here leaves your browser.
Result
Enter at least one lot of stock and the units sold. Or press Load a sample to see how it works.
Periodic method: one calculation for the whole period. A system that recalculates the average after every purchase (moving average) can give slightly different figures.
Worked example
The same stock, two answers
A trader buys 100 units at 50, then 100 at 60, then 100 at 70: 300 units for a total of 18,000. In the month, 150 units are sold at 100 each, so sales are 15,000.
FIFO: the 150 units sold are the first 100 at 50 and 50 of the next lot at 60. Cost of goods sold = 5,000 + 3,000 = 8,000. Closing stock = 18,000 − 8,000 = 10,000. Gross profit = 7,000.
Weighted average: 18,000 ÷ 300 = 60 per unit. Cost of goods sold = 150 × 60 = 9,000. Closing stock = 9,000. Gross profit = 6,000.
Same goods, same sales, and a 1,000 difference in profit, because prices were rising. Press Load a sample above to see these figures in the calculator. For the reasoning behind each method, read FIFO vs weighted average: which should your business use?
The formulas
How each figure is worked out
FIFO cost of goods sold
Units sold are costed from the oldest lot forward: units × cost for each lot, until the units sold are used up.
Weighted average cost
Total cost of goods available ÷ total units available. Cost of goods sold = units sold × that average.
Closing stock
Total cost of goods available − cost of goods sold. The two methods always add back to the same total cost.
Related: reorder point calculator · what is landed cost? · inventory software · all free tools
FAQ
FIFO and weighted average questions
What is the difference between FIFO and weighted average?
FIFO (first in, first out) assumes the oldest stock is sold first, so cost of goods sold uses the earliest purchase prices and the stock left is valued at the latest prices. Weighted average spreads the total cost evenly: total cost divided by total units gives one average cost, used for both the units sold and the units left.
How do you calculate cost of goods sold under FIFO?
Take the units sold from the oldest lot first, then the next oldest, until all units sold are covered, and add up units × cost for each lot used. Example: you hold 100 units at 50, 100 at 60 and 100 at 70, and sell 150. FIFO cost of goods sold is 100 × 50 + 50 × 60 = 8,000.
How do you calculate weighted average cost?
Weighted average cost per unit = total cost of goods available ÷ total units available. In the same example, total cost is 18,000 for 300 units, so the average is 60 per unit. Selling 150 units gives a cost of goods sold of 150 × 60 = 9,000.
Which method gives a higher profit?
When purchase prices are rising, FIFO gives a lower cost of goods sold and so a higher profit and a higher closing stock value. When prices are falling it is the other way round. When prices do not change, both methods give the same figures. Over the whole life of the stock the total cost is identical; the methods only move it between periods.
Is this the periodic or the perpetual method?
Periodic: one calculation for the whole period. FIFO gives the same answer either way. Weighted average can differ slightly in a perpetual system, where the average is recalculated after every purchase (often called moving average).
Which method should a small business use?
Weighted average is simpler to run and smooths out price swings, which suits traders with frequent purchases at changing prices. FIFO matches how perishable or dated stock physically moves. Whichever you choose, apply it consistently and check with your accountant what your accounting and tax rules allow.
Does this calculator send my figures anywhere?
No. Every calculation runs in your browser. Nothing is uploaded, stored or logged.
Let your software do the costing for every item
7-day free trial, no credit card required. Be live the same day.
No credit card required · 200+ businesses in Pakistan and the Gulf.