Skip to content
Omnikalc

FIFO and LIFO calculator: compare inventory costing methods

Enter the beginning inventory, two purchases and the units sold to compare the cost of goods sold, gross profit and ending inventory under FIFO, LIFO and weighted average.

Updated on
Your inputs

Value out of range

$

Value out of range

Value out of range

$

Value out of range

Value out of range

$

Value out of range

Value out of range

$

Value out of range

Results

Cost of goods sold, FIFO

$3,500.00

Consistent
Cost of goods sold, LIFO
$4,000.00
Cost of goods sold, weighted average
$3,733.33
Gross profit, FIFO
$2,500.00
Gross profit, LIFO
$2,000.00
Ending inventory, FIFO
$2,100.00
Ending inventory, LIFO
$1,600.00

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.

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.

Frequently asked questions

What is the difference between FIFO and LIFO?

FIFO assumes the first units bought are the first sold, and LIFO assumes the last units bought are the first sold. When costs rise, LIFO gives a higher cost of goods sold, a lower profit and a lower tax bill, and FIFO gives a higher profit and an ending inventory closer to current costs.

Which method is allowed?

In the United States, both FIFO and LIFO are allowed under GAAP, though a company using LIFO for taxes must use it in its financial reports. LIFO is not allowed under IFRS, which many other countries use. Always check the rules that apply to your business and ask an accountant.

What is the weighted average method?

It spreads the total cost over all the units available and uses one average cost for the goods sold and for the ending inventory. It smooths the changes in cost and is simple to apply, which is why many businesses and countries use it.

Does the physical flow need to match?

No. The method is an accounting assumption and does not have to match how the goods really move on the shelves. A shop that sells the oldest milk first may still use LIFO for its books, though the method must be applied consistently.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.