Calculate COGS and ending inventory using first-in, first-out across your purchase batches
💡 Why This Matters FIFO assumes you sell your oldest inventory first — the most common real-world flow. Getting this right affects your reported profit, taxes, and the accuracy of your financial statements.
During inflation, FIFO leaves the priciest, most recent units sitting in ending inventory — since the cheap old stock gets sold first. That pushes reported inventory value (and profit) higher than methods like LIFO would show.
As an Amazon Associate we earn from qualifying purchases.
We do our best to link products that we genuinely believe are organic, no disposable junk, sustainable, and built to last.
FIFO — first-in, first-out — assumes the oldest inventory you bought is the first inventory you sell. To find COGS, work through your units sold against your purchase batches in order: use up the entire first batch at its price before touching the second batch. Whatever units remain unsold, multiplied by their batch price, make up your ending inventory value.
COGS is the cost basis for everything you sold, calculated using each batch's actual purchase price rather than an average. Ending inventory value is what's left on the books — and because FIFO keeps the newest (often priciest, in an inflationary environment) units in stock, it tends to report a higher ending inventory value than methods like LIFO.
This calculator only handles two purchase batches — real inventories often have many more. It also assumes items are truly interchangeable, which doesn't always hold for perishables or items with expiration dates, where actual first-in-first-out physical flow matters for reasons beyond accounting. Price swings between batches can also make period-over-period comparisons harder to interpret at a glance.
Use your COGS figure to calculate gross profit and margin, and compare your ending inventory value against physical stock counts to catch discrepancies early. If prices are rising, remember FIFO will generally show a lower COGS and higher reported profit than LIFO would for the same sales — useful context when comparing your numbers to competitors using a different method.
Example: You buy 100 units at $10 (batch 1) and 110 units at $15 (batch 2) — total inventory value $2,650. You sell 150 units. FIFO uses all 100 units from batch 1 first, then 50 units from batch 2: COGS = (100 × $10) + (50 × $15) = $1,750. The remaining 60 units from batch 2 make up ending inventory: 60 × $15 = $900.
Sell through your oldest purchase batch first, at that batch's price, before moving to the next batch. If you bought 10 units at $100 and 5 at $110, and sold 12, COGS = (10 × $100) + (2 × $110) = $1,220 — using all of the first batch, then 2 units from the second.
Since FIFO sells the oldest, cheapest units first during inflation, the units left in ending inventory are the more recent, pricier ones — pushing ending inventory value higher than it would be under other methods.
Any ratio that uses inventory or current assets — including the current ratio, quick ratio, inventory turnover, days inventory outstanding, and return on assets — since FIFO directly changes the reported ending inventory value.