How to Calculate LIFO: Cost Layers, COGS, and Ending Inventory

To calculate LIFO, assign the cost of your newest inventory purchases to the units you sold, working backward through your dated purchase layers until every sold unit is accounted for; whatever cost layers remain become your ending inventory. The math is layer arithmetic. The difficulty is discipline: you need clean purchase records, a verified year-end count, and the paperwork to prove your layers years down the road.

What You Need Before You Start

Every LIFO calculation rests on four data points: your opening inventory balance from the prior year’s close, a dated log of every purchase during the current period (quantity and unit price), the total number of units sold, and a physical or system-verified count of units still on hand at year-end. Most businesses pull these figures from warehouse management software, vendor invoices, or purchase orders.

If you’re adopting LIFO for the first time, file IRS Form 970 with the tax return for that first year.1Internal Revenue Service. About Form 970, Application to Use LIFO Inventory Method The form asks for the inventory method you used in prior years, a description of the goods LIFO will cover, and how you determined the cost of those items. Your opening inventory in the LIFO adoption year is valued at average cost for each item type, regardless of how you tracked costs before.2Office of the Law Revision Counsel. 26 USC 472 – Last-in, First-out Inventories

A perpetual inventory system that records every receipt and sale in real time makes the calculation far easier than reconstructing data at year-end. Organizing unit costs into time-stamped purchase batches gives you the layers you’ll work with below.

Step 1: Build Your Cost Layers

List your beginning inventory and each purchase during the year in chronological order, showing quantity and unit cost for each. Every purchase is a separate cost layer. Suppose a company begins the year with 200 units at $10 each and buys more three times:

  • March: 300 units at $12
  • July: 250 units at $14
  • October: 150 units at $15

Total units available for sale: 900. Total cost of goods available: $2,000 + $3,600 + $3,500 + $2,250 = $11,350. Keep that total. You’ll use it to verify your work at the end.

Step 2: Calculate Cost of Goods Sold

Start with the most recent purchase layer and drain it. If sales exceed that layer, move to the next-most-recent, and keep going until you’ve assigned costs to every unit sold. Say the company sold 500 units during the year:

  • October layer: 150 units × $15 = $2,250
  • July layer: 250 units × $14 = $3,500
  • March layer (partial): 100 units × $12 = $1,200

That covers all 500 units sold. Add the three figures: $2,250 + $3,500 + $1,200 = $6,950 cost of goods sold. The oldest costs (the $10 units from beginning inventory) never touched the income statement. That is the whole point of LIFO. When prices are rising, the newest and highest costs flow to COGS, which reduces taxable profit.

Your unit counts in the COGS layers must match your sales records exactly. Even a small discrepancy throws off both the income statement and the ending inventory, because the two calculations are mirror images.

Step 3: Value Ending Inventory

Whatever cost layers you didn’t drain make up your ending inventory. Under LIFO, the goods still on the shelves are treated as the ones acquired earliest.2Office of the Law Revision Counsel. 26 USC 472 – Last-in, First-out Inventories After selling 500 units, the company has 400 units left:

  • Beginning inventory: 200 units × $10 = $2,000
  • Remaining March layer: 200 units × $12 = $2,400

Total ending inventory: $4,400.

Verify the math by adding COGS and ending inventory together: $6,950 + $4,400 = $11,350, which equals the total cost of goods available for sale you calculated in Step 1. If those two numbers don’t match, something is wrong with your layers.

Old cost layers carry forward year after year, building a permanent stack of historical prices on your balance sheet. A layer established in the adoption year can sit untouched for decades if the company keeps buying at least as many units as it sells. Layers only shrink when sales volume exceeds purchases, which triggers a LIFO liquidation (covered below).

How LIFO Layers Must Be Valued

You cannot write LIFO inventory down to market value. Federal regulations require LIFO inventory to be valued at cost, full stop.3eCFR. 26 CFR 1.472-2 – Requirements Incident to Adoption and Use of LIFO Inventory Method The “lower of cost or market” approach that FIFO permits is off-limits. The same rule applies to your financial statements: you may not substitute market value for cost when reporting LIFO inventory to creditors or shareholders. In a deflationary environment, this can leave your inventory carried above what you could actually sell it for.

Dollar-Value LIFO for Multi-Item Inventories

The unit-based calculation above works when you’re tracking a single product. Most businesses carry hundreds or thousands of items at varying prices, and dollar-value LIFO simplifies the work by grouping similar items into pools and measuring inflation across each pool as a whole.

The most common technique is the double-extension method. At year-end, you price out every item in a pool at both base-year costs and current-year costs. Divide the current-year total by the base-year total to get an inflation index. Deflate your current ending inventory back to base-year dollars, compare it to the prior year’s base-year inventory, and determine whether a new layer was added. Any new layer gets multiplied by the current-year index to convert it to LIFO cost.4Internal Revenue Service. Introduction to Dollar Value LIFO

Businesses that don’t want to maintain base-year pricing for every item can use the Inventory Price Index Computation (IPIC) method instead. IPIC uses published government price indexes to measure inflation: manufacturers and processors use commodity codes from the Bureau of Labor Statistics’ Producer Price Index, while retailers can use either the PPI or the Consumer Price Index.5Federal Register. Dollar-Value LIFO Regulations: Inventory Price Index Computation (IPIC) Method Pools IPIC reduces the internal pricing burden but ties your inflation measurement to index categories that may not match your product mix perfectly.

What Happens When You Sell More Than You Buy

A LIFO liquidation happens when you sell more units than you purchase in a given year, forcing you to dip into old, low-cost layers. Because those layers may reflect prices from years or even decades ago, liquidating them can create a spike in taxable income that has nothing to do with a real economic gain. You end up paying tax on the difference between ancient costs and current selling prices.

This catches many LIFO users off guard. A supply-chain disruption, a shift in product mix, or a deliberate inventory drawdown can all trigger a liquidation, and the resulting tax bill arrives whether or not the company generated extra cash.

Congress created a narrow relief valve for involuntary liquidations. Under 26 U.S.C. § 473, if inventory drops because of a “qualified inventory interruption” declared by the Secretary of the Treasury, you can elect to defer the extra income. The interruption must stem from a government energy regulation or a major foreign trade disruption such as an embargo or international boycott.6Office of the Law Revision Counsel. 26 USC 473 – Qualified Liquidations of LIFO Inventories If you replace the inventory within three years (or a shorter period specified by the Secretary), the income adjustment moves to the replacement year. The election is irrevocable.

The Conformity Rule

Using LIFO for taxes comes with a string attached: the conformity rule under 26 U.S.C. § 472 requires you to use the same method in any financial statements you provide to creditors, shareholders, or partners.2Office of the Law Revision Counsel. 26 USC 472 – Last-in, First-out Inventories You cannot report LIFO on your tax return and FIFO in your annual report. If the IRS finds you’ve broken conformity, it can revoke your LIFO election and force you to recalculate income retroactively, which typically produces a large back-tax bill plus interest.3eCFR. 26 CFR 1.472-2 – Requirements Incident to Adoption and Use of LIFO Inventory Method

Record Retention for LIFO

Standard IRS guidance says to keep tax records for at least three years after filing.7Internal Revenue Service. How Long Should I Keep Records LIFO is the exception. Because your inventory layers carry forward indefinitely, the IRS requires you to maintain detailed cost listings for the entire duration of the LIFO election.8Internal Revenue Service. LIFO Records The base-year cost data from your first LIFO year, together with the annual current-cost listings that support every layer built since, need to stay in your files for as long as you use the method. Lose the records and you may not be able to defend your layer values during an examination.