Skip to content
UseCalcNow
Finance

FIFO Inventory Calculator — COGS & Layers

Compute COGS and ending inventory under FIFO, LIFO, or weighted average by consuming purchase layers in order, with the method gap in dollars.

About This Calculator

FIFO charges the oldest purchase costs to cost of goods sold first, leaving the newest layer costs on the balance sheet as ending inventory. Enter up to four purchase layers and the units you sold, and this calculator consumes those layers in order to produce COGS and ending inventory under FIFO, LIFO, and weighted average side by side. The defaults show the classic pattern: selling 150 units from layers of 100 at $10, 100 at $12, and 100 at $14 produces FIFO COGS of $1,600 versus $2,000 under LIFO.

The Formula Behind This Calculator

The formula builds an array of purchase layers (quantity and unit cost each), sums total units available and total cost, then consumes units in order. Under FIFO it eats the oldest layer first: 100 units at $10, then 50 of the 100 units at $12, giving $1,000 + $600 = $1,600 of COGS. Under LIFO the same 150 units come from the newest layers backward ($1,400 + $600 = $2,000). Weighted average divides total cost by total units ($3,600 / 300 = $12.00) and multiplies by units sold ($1,800). Ending inventory is whatever cost remains after COGS is removed. Units sold above available stock are capped at availability, because negative inventory cannot exist in a real warehouse.

Understanding the math helps you verify results and make better decisions for your project.

How to Use

  1. 1Enter the units sold during the period you are closing.
  2. 2Enter each purchase layer as quantity and unit cost, oldest first. Leave layer 4 at zero if you only had three purchases.
  3. 3Pick the costing method: FIFO, LIFO, or weighted average.
  4. 4Read the COGS result, then check the explanation line for all three methods, ending inventory, and the FIFO-LIFO gap.
  5. 5Copy the explanation into your workpapers as the audit trail for the COGS figure.

When to Use

  • Month-end close when you need a FIFO COGS figure from a handful of purchase layers.
  • Comparing FIFO, LIFO, and weighted average before committing to a method for tax or reporting.
  • Solving accounting coursework that asks for layer tables under different cost flow assumptions.
  • Checking how much of your reported gross profit is a holding gain from older, cheaper stock.

Tips

  • Enter landed cost per unit, including freight-in: 100 units at $10 plus a $100 delivery charge is really a $1,100 layer at $11.00 per unit.
  • Keep layers in true purchase-date order. A layer entered out of sequence silently misstates both COGS and ending inventory.
  • Reconcile the layer table to physical counts at least quarterly. Shrinkage should be consumed at FIFO cost, not netted against the newest layer.
  • Watch the FIFO minus LIFO gap as an inflation gauge. A growing gap means your old layers are getting stale and LIFO's tax deferral is growing.
  • Run all three methods on the same layers before adopting one. The $400 spread on the default example is 25% of FIFO COGS, and that swings tax and loan covenants.
  • Restock customer returns into their original layer cost, not the price you would pay today. Returns are not a new purchase.

What FIFO Means for Inventory Costing

FIFO, first-in first-out, is a cost flow assumption: the dollar costs of your oldest purchases move to cost of goods sold first, and the newest purchase costs stay on the balance sheet as ending inventory. The goods themselves may or may not rotate that way on the shelf. What FIFO controls is which costs the income statement absorbs, which is why two identical stores can report different profits while selling the same products at the same prices.

The distinction matters because inventory is usually the largest current asset on a product company's balance sheet. When you buy the same item at $10, then at $12, then at $14, those purchases form separate cost layers. FIFO peels cost off the bottom of the stack (the $10 layer first), LIFO peels off the top, and weighted average blends the whole stack into one unit cost. None of them changes what you paid in total, only the split between what was sold and what remains.

This calculator works directly on those layers. Enter each purchase with its quantity and unit cost, enter the units sold, and the tool consumes the layers in the order your chosen method dictates. It complements the ending inventory calculator, which closes the balance sheet from beginning inventory and net purchases, and the COGS calculator, which works from the total cost side when you do not track layers.

How Layer Consumption Works Step by Step

Run the default numbers to see the mechanics. You own three layers: 100 units at $10.00, 100 at $12.00, and 100 at $14.00, so 300 units costing $3,600 in total. You sell 150 units. FIFO takes all 100 units from the $10 layer, which contributes $1,000 of COGS, then takes the remaining 50 units from the $12 layer, contributing $600. Total FIFO COGS is $1,600 for the period.

Ending inventory is simply the cost left unconsumed: 50 units from the $12 layer ($600) plus the untouched 100 units at $14 ($1,400), which is $2,000. The built-in check is that COGS plus ending inventory must equal the cost of goods available for sale: $1,600 + $2,000 = $3,600 exactly. If that identity ever fails in your own workpapers, a layer was dropped or double-counted.

Layer 4 exists for restock cycles that cross four purchases, and leaving it at zero simply removes it from the calculation. Order matters: layers are consumed oldest first, so a layer keyed in out of purchase-date sequence misstates both outputs. Units sold above total availability are capped, since a warehouse cannot hold negative stock, and any cap you hit in real books points to an unrecorded purchase or a bad count.

FIFO vs LIFO vs Weighted Average on the Same Layers

The three methods give three answers from identical inputs. On the default layers, FIFO charges $1,600, weighted average charges $1,800 (an average unit cost of $12.00 applied to 150 units), and LIFO charges $2,000. The $400 FIFO-LIFO gap equals the 100 units whose cost differs by $4 between the oldest and newest layers, which is how the spread always decomposes: units crossed times the cost steps they cross.

Expressed as a ratio, LIFO COGS runs 25% higher than FIFO here, and that ratio widens as price growth steepens. The balance sheet moves the opposite way: FIFO ending inventory of $2,000 contains the newest $12 and $14 costs, close to what restocking actually costs today, while LIFO's $1,600 ending inventory carries the stale $10 layer. Analysts reading a LIFO balance sheet adjust for this gap, called the LIFO reserve, before comparing companies.

Direction flips with prices. Enter the layers in falling order (100 at $14, 100 at $12, 100 at $10) and FIFO now charges $2,000 while LIFO charges $1,600, because the expensive old stock hits the income statement first. Weighted average still lands at $1,800 either way. For tracking how price levels move the gap over time, the inflation calculator gives the broader rate context that drives layer cost spreads.

Tax and Reporting Effects of FIFO

Method choice moves taxable income whenever prices are not flat. Selling 150 units at $20.00 generates $3,000 of revenue, so gross profit is $1,400 under FIFO and $1,000 under LIFO on identical transactions. At a 25% tax rate that is $350 of tax versus $250, a $100 difference per period. LIFO defers tax in inflationary times by reporting less profit now; FIFO pays the higher tax but reports the stronger earnings figure.

In the US, LIFO comes with the conformity rule of IRC Section 472: use it on the tax return and your financial books must use it too, no presenting FIFO statements with a LIFO return. IFRS removes the option entirely, banning LIFO since old-cost balance sheets stop representing economic reality. Multinationals that report under IFRS therefore run FIFO even where US subsidiaries keep LIFO for tax, reconciling the difference through disclosure.

Consistency is the third constraint. Switching methods is treated as an accounting change requiring justification and, for tax, IRS consent, because restated COGS breaks year-over-year comparability. When projecting how the choice flows through to bottom-line figures, the accounting profit calculator shows how a $400 COGS shift lands after operating costs.

Profit Margins, Replacement Cost, and Pricing

On the default example, gross margin is 46.7% under FIFO, 40.0% under weighted average, and 33.3% under LIFO, all from the same sales. Nothing about the business changed between those three numbers, only the assumption about which costs the sales absorbed. Anyone benchmarking margins across companies should check the inventory note first, since a FIFO retailer and a LIFO competitor can look 10 percentage points apart while operating identically.

FIFO's profit carries a hidden holding gain. Replacing the 150 units you sold costs $2,100 at the current $14.00 price, but FIFO charged only $1,600 of COGS, so $500 of the reported gross profit exists only because old stock was cheaper. That profit is real cash today and gone tomorrow: keep pricing off FIFO COGS and the spread collapses the next time you restock at higher cost.

LIFO approximates current-cost matching, charging revenue with near-replacement costs, which is why it prices conservatively in growth markets. For setting prices on what stock will cost next month rather than what it cost last quarter, pair the layer results with the markup calculator so margin targets sit on replacement cost, not on the cheapest old layer.

Downstream Inventory Metrics That Rely on COGS

COGS feeds the efficiency ratios lenders and analysts watch. The default FIFO close leaves $2,000 of ending inventory against $1,600 of monthly COGS, or $53.33 of cost per day, which is 37.5 days of stock on hand. Divide average inventory by daily COGS across the year and you have the days inventory outstanding calculator metric in its standard form.

Inventory days is also the first leg of the cash conversion cycle calculator: days inventory plus days sales outstanding minus days payable. A method choice that inflates ending inventory stretches measured DIO even though nothing operational changed, one more reason to state the assumption alongside the ratio. Ordering decisions then belong to the EOQ calculator, which sizes purchase batches from demand and holding cost rather than from accounting layers.

Timing the next purchase while stock runs down is a reorder-point question driven by sales velocity and supplier delay, handled with the lead time calculator. Keep the operational numbers separate from the costing assumption: order quantities respond to real consumption, while layers only revalue what the consumption is deemed to cost.

Perpetual vs Periodic Systems and Common Mistakes

Under FIFO, perpetual and periodic systems usually agree. A perpetual book consumes the oldest remaining layers at each sale date, and a periodic close applies the oldest costs to total units sold at period end; with clean records both land on $1,600 for the default example. Divergence needs a timing quirk, such as shrinkage counted mid-period or a sale booked before its receiving, and even then FIFO converges faster than LIFO would.

The classic mistakes are data mistakes. Freight-in left out of unit cost understates layers: the $100 delivery on a $1,000 purchase makes it a $1,100 layer at $11.00 per unit, and omitting it quietly shifts cost out of COGS. Customer returns restocked at today's price instead of their original layer cost corrupt the stack, and a layer keyed out of date order poisons both outputs at once.

Shrinkage, theft, and damage need deliberate treatment: consume them at FIFO cost like extra sales, or write them off explicitly, but never net them against the newest purchase. Reconcile the layer table to physical counts quarterly. If counted stock is less than the layers show, the missing units come off at the cost FIFO assigns them, which keeps the identity, COGS plus ending inventory equals goods available, intact.

Worked Audit-Trail Example and Sensitivity Checks

Take a steeper cost curve: 200 units at $25, another 200 at $27, and 200 at $30, with 400 units sold. FIFO charges $10,400 (all of the $25 layer plus all of the $27 layer), LIFO charges $11,400, and weighted average charges $10,933.33 at a blended $27.33 unit cost. LIFO runs 9.6% above FIFO here, and the $1,000 gap equals the 200 units spanning the full $5 spread between oldest and newest costs.

Ending inventory tells the same story in reverse: FIFO leaves $6,000 of $30 stock, LIFO leaves $5,000 of $25 stock, weighted average $5,466.67. Sell out the entire 600 units and every method reports the same $16,400 of total COGS with the gap at zero. The method never changes what inventory cost in total; it only moves cost between periods, which is exactly what the timing-of-tax argument is about.

Because COGS sits inside operating results, the $400 method spread reaches the operating line directly, a flow-through you can trace with the EBITDA calculator. Use the explanation line as the audit trail: it states available units and cost, all three COGS figures, ending inventory, and the FIFO-LIFO gap in one copyable sentence, ready to paste into workpapers or a month-end memo.

FAQ

Is FIFO the same as the physical flow of goods?

Often close, but the two are separate concepts. FIFO is a cost flow assumption used to value COGS and ending inventory, while physical rotation is a warehouse practice. Grocery stores and pharmacies physically rotate stock first-in-first-out to protect expiry dates, but even a gas station selling perfectly mixed fuel can account for it under FIFO. The assumption determines which dollar costs move to the income statement, not which molecules leave the tank.

Why is LIFO banned under IFRS?

IAS 2 prohibits LIFO because it leaves very old costs on the balance sheet while charging current selling prices against them, which can make inventory valuations drift far from replacement cost. A company sitting on layers priced decades ago reports an ending inventory figure that no supplier would honor today. US GAAP still permits LIFO, so the method choice effectively splits between domestic US reporting and IFRS reporters.

Which method reports the highest profit when prices rise?

FIFO. On the default layers, revenue of $3,000 at $20 per unit leaves gross profit of $1,400 under FIFO (46.7% margin) versus $1,000 under LIFO (33.3%). Weighted average lands between them at $1,200. When prices fall, the ranking flips: FIFO then charges the most expensive old costs first and reports the lowest profit, which you can verify by entering 14, 12, and 10 as the layer costs.

What happens if units sold exceed the units I entered?

The calculator caps sales at total available units. A capped result is a warning sign in real books: it means a receiving was never recorded, a purchase invoice is missing, or the physical count was wrong. Accounting cannot show negative inventory, so any period where the math tries to sell more than you own needs the purchase records fixed before the close, not a journal entry that forces the number.

Can I switch between FIFO and LIFO whenever I want?

No. The consistency principle requires the same cost flow assumption period to period so financial statements stay comparable. In the US, switching methods for tax purposes requires IRS consent, and LIFO carries a conformity rule: once you use it on the tax return, your books must follow LIFO too. IFRS reporters have no choice, since LIFO is prohibited outright.

Does FIFO give the same answer under periodic and perpetual systems?

Usually yes, and that is FIFO's quiet advantage. A perpetual system consumes the oldest remaining layers at each sale date, while a periodic system applies the oldest costs to total units sold at period end. Outside edge cases like shrinkage discovered mid-period or sales recorded before their matching receipt, both paths land on the same COGS. LIFO by contrast can produce different periodic and perpetual figures for the same activity.

Related Calculators