How a company assigns costs to the units it sells can change its profit and its taxes. This FIFO and LIFO calculator takes the beginning inventory, two purchases and the units sold to give the cost of goods sold, the gross profit and the ending inventory under FIFO, LIFO and the weighted average method.
How the calculation works
- FIFO (first in, first out) assumes that the oldest units are sold first, so the cost of goods sold uses the oldest costs and the ending inventory holds the newest.
- LIFO (last in, first out) assumes that the newest units are sold first. When prices rise, it gives a higher cost of goods sold and a lower profit than FIFO.
- Weighted average = total cost of goods available ÷ total units available, times the units sold.
- Gross profit = sales − cost of goods sold, and ending inventory = cost of goods available − cost of goods sold.
Example
A shop starts with 100 units at $10, buys 150 at $12 and then 200 at $14, and sells 300 units at $20. Under FIFO the cost is 100 × 10 + 150 × 12 + 50 × 14 = $3,500, and under LIFO 200 × 14 + 100 × 12 = $4,000. The weighted average cost is $5,600 ÷ 450 × 300 = $3,733.33. Sales are $6,000, so the gross profit is $2,500 with FIFO and $2,000 with LIFO.
Why it matters
Accounting students, small business owners and bookkeepers use the comparison to see the effect of the costing method on profit when prices change. It shows in a few numbers why the choice matters for taxes and for the value of the inventory on the balance sheet.
Good to know
The calculator uses a periodic view with three layers of cost: a beginning stock and two purchases. Real systems may use perpetual inventory with more layers, returns, discounts and freight, which change the result. The rules on which methods are allowed differ between countries and for tax and financial reporting, and a change of method may need approval. This is a learning aid and not accounting or tax advice, so speak to an accountant for your own books.
Related tools
The COGS calculator totals the cost of goods sold, the inventory turnover calculator measures how fast stock sells and the cash conversion cycle calculator links stock to cash.