A FIFO LIFO inventory calculator exists because the physical goods and the accounting costs move independently. When you buy the same item four times at four different prices and then sell some of them, there is no fact of the matter about which units left. The cost flow assumption decides that, and the choice changes reported profit, reported inventory and tax without changing a single thing about the business.
This page runs all three standard assumptions on the same purchase history at once, because the divergence is the point. Arb Digital publishes it in the free tool library at arbsbuy.com alongside the live COGS calculator, which uses the single-period formula of opening stock plus purchases less closing stock. That formula needs a closing stock figure as an input. This page is what produces that figure, lot by lot, and shows how much it depends on the method chosen.
What This FIFO LIFO Inventory Calculator Does
Enter up to four purchase lots in the order they were bought, each with a quantity and a unit cost, then the number of units sold in the period. The calculator builds the cost pool, applies each cost flow assumption to the units sold, and reports cost of goods sold and ending inventory under all three.
The headline is the gap between FIFO and LIFO cost of goods sold, because that single figure measures how much the accounting choice is worth on your numbers. The grid gives the three COGS figures and the gross margin spread between FIFO and LIFO at your selling price. The bars show ending inventory under each method against the total cost pool, which is the balance sheet side of the same trade-off.
A structural check runs behind all of it: under every method, cost of goods sold plus ending inventory must equal the total cost of goods available for sale. The methods redistribute a fixed pool between the income statement and the balance sheet. Nothing is created or destroyed, which is why a method that lowers COGS necessarily raises inventory by the same amount.
How to Use It
- Enter lots oldest first. Order matters to FIFO and LIFO and is ignored by weighted average, so getting the sequence right is the first requirement.
- Treat opening inventory as lot 1 at its carrying cost, then add the period's purchases as later lots.
- Use landed cost, not invoice price. Inbound freight, duty and handling normally form part of inventory cost, and leaving them out understates every figure on the page.
- Enter units sold, not units remaining. The calculator derives what is left.
- Read the gap, then decide whether it matters. If FIFO and LIFO land within a rounding error of each other, prices were stable and the choice is not worth arguing about.
The Formula / How It's Calculated
All three methods start from the same pool: cost of goods available for sale = opening inventory + purchases, in both units and money. FIFO assigns the oldest costs to the units sold, working down the lots in purchase order. LIFO assigns the newest costs, working up from the most recent lot. Weighted average computes a single unit cost as total cost ÷ total units and applies it to both sold and remaining units.
Work the defaults. The lots are 400 units at 10.00, 300 at 11.50, 500 at 12.25 and 200 at 13.00. That is 1,400 units and a cost pool of 4,000 + 3,450 + 6,125 + 2,600 = 16,175. Sales are 900 units.
Under FIFO the 900 units sold take the 400 oldest at 10.00, then 300 at 11.50, then 200 at 12.25: 4,000 + 3,450 + 2,450 = 9,900. Ending inventory is the remaining 500 units — 300 at 12.25 and 200 at 13.00 — which is 3,675 + 2,600 = 6,275. The two add to 16,175, as they must.
Under LIFO the same 900 units take the newest costs: 200 at 13.00, then 500 at 12.25, then 200 at 11.50, giving 2,600 + 6,125 + 2,300 = 11,025. Ending inventory is 100 units at 11.50 and 400 at 10.00, which is 1,150 + 4,000 = 5,150. Again the two total 16,175.
Weighted average takes 16,175 ÷ 1,400 = 11.5536 per unit. Cost of goods sold is 900 × 11.5536 = 10,398, and ending inventory is 500 × 11.5536 = 5,777. The FIFO to LIFO gap is 11,025 − 9,900 = 1,125 on cost of goods sold, and exactly the same 1,125 in the opposite direction on ending inventory. At a selling price of 18, revenue is 16,200 and gross profit is 6,300 under FIFO, 5,175 under LIFO and 5,802 under weighted average — a spread of 1,125 in reported profit from identical trading.
Why the Divergence Happens and Which Way It Runs
The gap is driven entirely by price movement between lots. When purchase prices rise across the period, as in the defaults, FIFO charges the oldest and cheapest costs to sales, producing the lowest cost of goods sold and the highest reported profit. LIFO charges the newest and dearest costs, producing the highest cost of goods sold and the lowest profit. Weighted average lands between them by construction.
The balance sheet mirrors this exactly. FIFO leaves the most recent, highest costs sitting in ending inventory, so the stock figure on the balance sheet is close to current replacement cost. LIFO leaves the oldest costs there, so in a long inflationary run the inventory line can carry costs from years ago and materially understate what the stock is actually worth.
Reverse the price trend and every conclusion reverses with it. Set the lots to fall from 13.00 to 10.00 in this calculator and FIFO becomes the high-COGS method and LIFO the low one. This is why "LIFO reduces tax" is only true while prices are rising, and why the direction of movement has to be checked rather than assumed. Where prices are flat, the three methods converge and the whole question stops mattering — which is genuinely the situation for many businesses.
LIFO Is Not Permitted Under IFRS
This is the single most important constraint on the choice and it is jurisdictional. The international standard on inventories, IAS 2 Inventories, permits only the first-in first-out formula and the weighted average cost formula for items that are ordinarily interchangeable. LIFO is not among the permitted formulas, so entities reporting under IFRS cannot use it. If your accounts are prepared under IFRS or a national standard aligned with it, the LIFO column on this page is educational only.
United States generally accepted accounting principles do permit LIFO, and the Internal Revenue Service sets out both methods in Publication 538 on accounting periods and methods, which describes FIFO as assuming the items purchased or produced first are the first disposed of and LIFO as the inverse, and notes that each method produces different income depending on the trend of price levels. Adopting LIFO for US tax purposes is a formal election made on Form 970 rather than a presentational choice, and it carries a conformity requirement: a taxpayer using LIFO for tax must generally use it in financial reports to shareholders as well.
The practical consequence for a group operating in both worlds is that a single set of underlying transactions can require two inventory numbers, with the difference disclosed as a LIFO reserve. That reserve is what an analyst adds back to compare a LIFO-reporting company with a FIFO-reporting competitor, and running this calculator on the same lots is a quick way to see how large such a reserve becomes.
What the Choice Does to Your Other Ratios
Because inventory sits in current assets and cost of goods sold sits in the income statement, the method quietly moves several ratios that people compare across companies without adjustment.
Gross margin moves first and most visibly. On the defaults, FIFO shows a gross margin of 38.9 percent and LIFO shows 31.9 percent on identical sales and identical purchases — a seven-point difference that has nothing to do with pricing or efficiency. Anyone benchmarking those two companies on margin alone is comparing accounting policies. The gross margin calculator and the profit margin calculator will faithfully report whichever figure you feed them, so the adjustment has to happen before that point.
Inventory turnover moves in the same way and in both its numerator and denominator, which makes it particularly unreliable across methods — the inventory turnover calculator divides cost of goods sold by average inventory, and LIFO raises the first while lowering the second, so turnover looks materially faster for reasons that are purely presentational. Current ratio and working capital move with the inventory balance too, so a LIFO reporter looks more leveraged on a working capital measure than an identical FIFO reporter. The working capital calculator is worth running on both inventory figures from this page to see the size of that swing.
Specific Identification and When None of This Applies
Cost flow assumptions exist because units are interchangeable. When they are not, the assumption is unnecessary and generally not allowed: goods that are not ordinarily interchangeable, or that are produced and segregated for specific projects, are costed by specific identification, tracking the actual cost of the actual item sold.
That covers vehicles with individual chassis numbers, bespoke machinery, property units and high-value serialised goods. It is the most accurate approach available and it is also the only one that gives an honest answer when items genuinely differ in cost for reasons other than the date they were bought. Where it applies, this calculator does not — enter the actual cost of the actual units sold instead.
Two further points are worth naming. First, perpetual and periodic systems can give different LIFO answers on the same data, because a perpetual system applies the assumption at each sale while a periodic system applies it once at period end; this page uses the periodic approach, which is the standard teaching form. Second, none of the three methods survives a valuation write-down: inventory is measured at the lower of cost and net realisable value, so if the market price of your stock falls below its carried cost, the write-down overrides whatever the cost flow assumption produced.
Arb Digital builds long-term online growth programmes for product businesses, so more of the cost pool moves to the income statement as sales rather than sitting on the balance sheet.
Web Growth Services Talk to Arb DigitalCommon Mistakes to Avoid
- Confusing cost flow with physical flow — a business can ship its oldest stock first and still use LIFO for costing, because the two are unrelated.
- Using LIFO under IFRS — the international standard permits only FIFO and weighted average, so the figure is not reportable in those jurisdictions.
- Comparing margins across methods — a seven-point gross margin difference can come entirely from the cost flow assumption on identical trading.
- Excluding landed costs — freight, duty and handling normally belong in inventory cost, and omitting them understates both COGS and stock.
- Switching methods to improve a result — consistency between periods is a basic requirement, and a change is an accounting policy change with disclosure and, for LIFO, formal election consequences.
Related Free Tools From Arb Digital
Pair this with the COGS calculator for the single-period formula, the inventory turnover calculator for how fast stock moves, the EOQ calculator for how much to buy each time, the gross margin calculator for the margin the method produces, the working capital calculator for the balance sheet effect, and the import duty calculator for the landed cost that belongs in each lot. The full free online tools hub lists everything else.
Frequently Asked Questions
FIFO assigns the oldest purchase costs to the units sold and leaves the newest costs in inventory. LIFO does the opposite. Both split the same total cost pool between cost of goods sold and closing stock, just in opposite directions.
No. IAS 2 permits only the first-in first-out formula and the weighted average cost formula for interchangeable items, so LIFO cannot be used by entities reporting under IFRS. United States GAAP does permit it, subject to a formal tax election.
It depends on the direction of prices. When purchase costs are rising, FIFO produces lower cost of goods sold and higher reported profit than LIFO. When costs are falling the relationship reverses entirely.
No. Cost flow assumptions are an accounting construct and are independent of physical handling. A warehouse can rotate stock strictly oldest-first and still cost it on a LIFO basis where that method is permitted.
The total cost of goods available for sale divided by the total units available, applied to both the units sold and the units remaining. It ignores purchase order entirely and always lands between the FIFO and LIFO results.
The difference between inventory measured under LIFO and what it would be under FIFO. Analysts add it back to make a LIFO-reporting company comparable with a FIFO-reporting one, and running the same lots through both methods shows how it arises.
Generally yes. Costs of purchase normally include import duties, transport and handling directly attributable to acquiring the goods, so entering the landed cost per unit rather than the invoice price gives a more accurate result.
This calculator performs arithmetic on figures you supply and is provided for general information only. It is not accounting or tax advice, and inventory measurement, method elections and write-downs are governed by the standards and tax rules of your jurisdiction — confirm any figure used in accounts or a tax return with a qualified professional.