Skip to content
MoneyDeck

FIFO LIFO Inventory Calculator

Compare COGS and ending inventory under FIFO, LIFO and weighted average

Updated · Free, no signup

$
$
$
$
$
$

COGS (headline method)

$3,400.00

COGS — FIFO

$3,400.00

COGS — LIFO

$3,750.00

COGS — weighted average

$3,566.67

Ending inventory — FIFO

$1,950.00

Ending inventory — LIFO

$1,600.00

Ending inventory — weighted average

$1,783.33

Weighted average cost per unit

$11.8889

Units available for sale

450

Units in ending inventory

150

Gross profit — FIFO

$2,600.00

Gross profit — LIFO

$2,250.00

Gross profit — weighted average

$2,433.33

  • Costs rose during the period: LIFO COGS is $350.00 higher than FIFO, which lowers gross profit (and taxable income) by the same amount.
  • The $350.00 gap between FIFO and LIFO ending inventory is the “LIFO reserve”.

COGS and ending inventory by method

Inventory layers

LayerUnitsCost / unitTotal cost
Beginning inventory100$10.00$1,000.00
Purchase 1200$12.00$2,400.00
Purchase 2150$13.00$1,950.00
Goods available for sale450$11.8889$5,350.00

About the FIFO LIFO Inventory Calculator

This FIFO and LIFO calculator values inventory three ways from the same purchase history: first-in, first-out (FIFO), last-in, first-out (LIFO) and weighted average cost. Enter your beginning inventory and up to four purchase layers with their unit costs, then the number of units sold, and it shows cost of goods sold (COGS), ending inventory and — if you add a selling price — gross profit under each method side by side.

Students use it to check textbook problems, and business owners use it to see how the choice of cost-flow assumption changes reported profit and taxes. When prices are rising, FIFO reports lower COGS and higher profit, while LIFO matches recent, higher costs against sales and lowers taxable income. LIFO is allowed under US GAAP but not under IFRS.

The calculation uses the periodic inventory system: all purchases in the period are treated as available before the units sold are costed. A perpetual system, which costs each sale as it happens, can give different LIFO and average-cost figures when sales occur between purchases.

With the default inputs, the cogs (headline method) is $3,400.00. Change any value above to recalculate instantly.

How to use the fifo lifo inventory calculator

  1. 1Enter the units and unit cost of your beginning inventory.
  2. 2Enter each purchase during the period in date order, with its unit cost.
  3. 3Enter the number of units sold and, optionally, the selling price.
  4. 4Pick the method you report under to set the headline figure.
  5. 5Compare COGS, ending inventory and gross profit across FIFO, LIFO and average cost.

Formula and method

COGS + Ending inventory = Beginning inventory + Purchases • Avg cost = Cost of goods available ÷ Units available

All three methods start from the same cost of goods available for sale: beginning inventory plus every purchase layer. FIFO assigns the oldest costs to the units sold first, so ending inventory is valued at the most recent prices. LIFO assigns the newest costs to units sold first, leaving the oldest costs in ending inventory.

Weighted average divides the total cost of goods available by the total units available, then multiplies by units sold (COGS) and units left (ending inventory). This is the periodic method: costs are assigned at the end of the period. Ending inventory under each method is the cost of goods available minus that method’s COGS.

COGS
Cost of goods sold for the period
Layer
A batch of units bought at one unit cost
Avg cost
Weighted average unit cost of everything available for sale

Worked examples

Rising costs: 450 units available, 300 sold

Goods available cost 100×$10 + 200×$12 + 150×$13 = $5,350 for 450 units. FIFO costs the 300 sold as 100×$10 + 200×$12 = $3,400; LIFO as 150×$13 + 150×$12 = $3,750. Average cost is $5,350 ÷ 450 = $11.889, so COGS is $3,566.67. At $20 a unit, FIFO gross profit is $6,000 − $3,400 = $2,600.

Falling costs with four purchases

FIFO takes 50×$30 + 100×$28 + 70×$26 = $6,120. LIFO takes 50×$25 + 100×$26 + 70×$28 = $5,810, which is lower because the newest units were cheapest. Average cost is $8,150 ÷ 300 = $27.167, giving COGS of $5,976.67 and 80 units left.

Headline method set to LIFO

Selling 400 of 450 units under LIFO costs 150×$13 + 200×$12 + 50×$10 = $4,850, leaving 50 units at $10 = $500. FIFO would leave the 50 newest units at $13 = $650.

Frequently asked questions

Which gives higher profit, FIFO or LIFO?+

When costs are rising, FIFO gives higher reported profit because older, cheaper costs go to COGS. LIFO gives lower profit and lower taxable income. When costs are falling the effect reverses.

Is LIFO allowed under IFRS?+

No. IFRS (IAS 2) prohibits LIFO; only FIFO, weighted average and specific identification are allowed. LIFO is permitted under US GAAP, and US companies that use it for tax must also use it in their financial statements (the LIFO conformity rule).

What is the weighted average cost method?+

It assigns every unit the same cost: total cost of goods available for sale divided by total units available. COGS and ending inventory are then units × that average, smoothing out price swings.

What is the difference between periodic and perpetual inventory?+

A periodic system costs sales once at the end of the period, as this calculator does. A perpetual system costs each sale when it happens using only the layers on hand at that moment, which can change LIFO and moving-average results.

What is a LIFO reserve?+

The LIFO reserve is the difference between inventory valued under FIFO and under LIFO. Companies using LIFO disclose it so analysts can restate inventory and profit on a FIFO basis for comparison.

Results are estimates for educational purposes and are not financial advice. Rates, fees and terms vary — confirm with your lender or a licensed advisor before making decisions.

Related tools