FIFO vs LIFO Inventory Valuation Calculator

Enter your beginning and purchase layers and the units sold.

How it is calculated

The tool models exactly two cost layers: the beginning stock and one purchase, each with a quantity and a unit cost. Total value is beg_qty × beg_cost + pur_qty × pur_cost. Under FIFO the units sold come from the beginning layer first, then from the purchase layer. Under LIFO they come from the purchase layer first, then the beginning layer. For each method, ending inventory = total value − COGS, where COGS is the sum of units taken from each layer times that layer's cost. The results show both ending values and the absolute COGS difference between the methods, in dollars. Units sold cannot exceed units available, and no input may be negative. Which method is allowed for accounting or tax depends on the country.

Worked example

Beginning stock is 100 units at $10 and a purchase adds 100 units at $12, so the total value is $1,000 + $1,200 = $2,200. You sell 120 units. FIFO takes 100 × $10 plus 20 × $12 = $1,240 of COGS, leaving $2,200 − $1,240 = $960.00 in stock. LIFO takes 100 × $12 plus 20 × $10 = $1,400 of COGS, leaving $800.00. The COGS differs by $1,400 − $1,240 = $160.00.

Try this example →

Common mistakes

  • Entering several purchases as one by averaging their prices yourself. The tool has only two layers, so a middle purchase must be folded into one of them, which changes the answer.
  • Mixing up the layer order. The beginning layer is treated as the oldest, so putting the newer, dearer stock in the beginning fields reverses the FIFO and LIFO results.
  • Entering the sales value instead of the number of units sold. The field takes quantity, not dollars.
  • Entering more units sold than beginning plus purchased. The tool returns no result in that case rather than going negative.
  • Expecting the two methods to differ when costs are equal. If both layers have the same unit cost, FIFO and LIFO give identical figures and the difference is $0.00.

Sources

About this calculator

FIFO (first-in, first-out) assumes the oldest inventory units are sold first, so the units left in stock are valued at the most recent purchase costs. LIFO (last-in, first-out) assumes the opposite — the newest units are sold first, leaving older, often cheaper costs in ending inventory. In periods of rising prices, FIFO tends to report lower cost of goods sold (COGS) and higher ending inventory value than LIFO.

This calculator takes a beginning inventory layer and a purchase layer, each with its own quantity and unit cost, plus the number of units sold, and values ending inventory under both methods side by side. It then shows the difference in COGS between the two methods, as a positive amount, rather than a separate COGS figure for each. Accountants, bookkeepers, and small business owners use it to see how the choice of costing method changes reported profit and tax liability for the same physical inventory.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The two methods only disagree about what is left, not about how many units you sold. With 100 units at 10 and 100 at 12, selling 120 leaves 960.00 under FIFO and 800.00 under LIFO. Sell all 200 and both show 0.00, with no difference at all. So the gap appears when stock remains at period end. Does your business usually close a period with a thin or a deep layer of stock?

Popular calculators

All Calculators