Skip to content
Business

LIFO Inventory Calculator

Calculate Cost of Goods Sold (COGS) and ending inventory value using the Last-In, First-Out (LIFO) inventory accounting method.

Units sold

Batch 1 (oldest inventory)

$

Batch 2

$

Batch 3 (newest inventory)

$

Cost of Goods Sold (COGS)

$440.00

130 units at avg $3.38/unit

Ending inventory value

$200.00

100 units remaining

Total goods available

$640.00

230 total units

Cost allocation

  • COGS$440.0068.8%
  • Ending inventory$200.0031.3%

How LIFO COGS is calculated

Three steps from your inventory batches and units sold to COGS and ending inventory value.

  1. Total goods available for sale

    Total Cost=i=1n(Qtyi×Costi)\mathrm{Total\ Cost} = \sum_{i=1}^{n}(\mathrm{Qty}_i \times \mathrm{Cost}_i)

    Add cost across all batches: $640.00 across 230 units.

  2. Consume newest batches first (LIFO)

    COGS=j=kn(Consumedj×Costj)\mathrm{COGS} = \sum_{j=k}^{n}(\mathrm{Consumed}_j \times \mathrm{Cost}_j)

    Sell 130 units starting from Batch 3 (newest) down to Batch 1 (oldest). COGS draws on the latest acquired inventory first.

  3. Ending inventory = total cost − COGS

    Ending Inventory=Total CostCOGS\mathrm{Ending\ Inventory} = \mathrm{Total\ Cost} - \mathrm{COGS}

    $640.00 − $440.00 = $200.00 remaining in stock.

Report tool

What is LIFO inventory accounting?

Last-In, First-Out (LIFO) is an inventory valuation and cost-flow assumption that assigns the cost of the most recently acquired goods to Cost of Goods Sold (COGS) first. Under this method, the oldest purchase costs remain on the balance sheet as ending inventory.

In periods of rising prices or inflation, LIFO matches current, higher purchase costs against current revenue. This results in higher reported COGS, lower reported net income, and lower income tax payments compared to First-In, First-Out. To see how the alternative assumption affects your books, compare these numbers directly with the FIFO inventory calculator. For general stock valuation without batch tracking, use the ending inventory calculator.

LIFO formulas and cost flow

LIFO does not rely on a single algebraic formula; it works by consuming inventory layers in reverse chronological order. COGS is calculated by depleting the latest purchased batches first:

COGS=j=kn(Units Soldj×Unit Costj)\mathrm{COGS} = \sum_{j=k}^{n}(\mathrm{Units\ Sold}_j \times \mathrm{Unit\ Cost}_j)

Where batch n represents the newest batch acquired, working backward to batch k. Ending inventory represents the remaining unconsumed units from the earliest layers:

Ending Inventory=Total Cost of Goods AvailableCOGS\mathrm{Ending\ Inventory} = \mathrm{Total\ Cost\ of\ Goods\ Available} - \mathrm{COGS}

The total cost of goods available for sale equals the sum of all batch quantities multiplied by their unit purchase prices:

Total Cost=i=1n(Quantityi×Unit Costi)\mathrm{Total\ Cost} = \sum_{i=1}^{n}(\mathrm{Quantity}_i \times \mathrm{Unit\ Cost}_i)

Worked example: LIFO in action

Suppose an electronics distributor has two inventory purchases and sells 120 units during the quarter:

BatchUnitsUnit costUnits sold (LIFO)COGS contribution
Batch 1 (oldest)100$2.0070$140.00
Batch 2 (newest)50$3.0050$150.00
Total150120$290.00 COGS

The 120 units sold consume all 50 units of Batch 2 at $3.00 each ($150.00) plus 70 units of Batch 1 at $2.00 each ($140.00), yielding a total COGS of $290.00. The remaining 30 units stay in ending inventory at Batch 1 cost ($2.00 each = $60.00).

Notice the contrast with FIFO for this exact dataset: FIFO would consume Batch 1 first, producing a lower COGS of $260.00 and a higher ending inventory of $90.00. LIFO increases COGS by $30.00, reducing pre-tax profit by that exact amount.

LIFO vs. FIFO vs. weighted average

Choosing an inventory cost flow assumption directly impacts gross margin, balance sheet asset values, and corporate tax liability when purchase costs change over time:

Accounting methodCOGS during inflationEnding inventory valueRegulatory status
LIFOHighest (reflects newest prices)Lowest (based on older costs)Allowed under U.S. GAAP; banned by IFRS
FIFOLowest (reflects oldest prices)Highest (reflects current replacement)Accepted globally under both GAAP and IFRS
Weighted AverageIntermediate (blended average)Intermediate (blended average)Accepted globally under both GAAP and IFRS

Key regulatory and practical considerations

  • IFRS prohibition: International Financial Reporting Standards (IAS 2) specifically prohibit LIFO because ending inventory on the balance sheet reflects outdated historical costs that may severely understate company assets.
  • The LIFO conformity rule: Under U.S. Internal Revenue Code Section 472(c), if a company uses LIFO for federal income tax purposes to lower taxes, it must also use LIFO in its financial statements and reports to shareholders.
  • LIFO reserve disclosures: Public companies using LIFO must report a LIFO Reserve footnote, documenting the dollar difference between inventory valued under FIFO versus LIFO so investors can compare companies on an equal footing.
  • Inventory management metrics: If you evaluate working capital and supply chain speed, check the inventory turnover calculator and the days inventory outstanding calculator to track how quickly stock converts to sales.

Frequently asked questions

Why do companies adopt the LIFO method?
The primary motivation for adopting LIFO in the United States is income tax deferral during periods of inflation. Because recent inventory purchases cost more, assigning those higher costs to COGS reduces taxable income and saves cash on current tax obligations.
Why does IFRS ban LIFO?
International Financial Reporting Standards (IAS 2) disallow LIFO because it leaves older, potentially obsolete prices on the balance sheet as ending inventory. IFRS regulators concluded that this creates an unrealistic representation of a company current asset base.
What is a LIFO liquidation?
A LIFO liquidation occurs when current sales exceed purchases, forcing the company to draw down older, lower-cost inventory layers established in earlier years. This pulls low historical costs into COGS, creating an artificial spike in reported gross profit and a corresponding tax surge.
What is the LIFO conformity rule?
Internal Revenue Code Section 472 requires that any business electing LIFO for tax reporting must also use LIFO for financial reporting to shareholders, lenders, and credit agencies. You cannot use LIFO on tax returns while presenting FIFO results to investors.
How does LIFO affect inventory turnover and working capital ratios?
Because LIFO values ending inventory at older, lower historical costs during inflation, balance sheet inventory is smaller. This artificially inflates the inventory turnover ratio and depresses the current ratio and working capital relative to FIFO reporting.
Does LIFO match physical inventory movement?
Rarely. Most physical businesses sell their oldest goods first to avoid expiration or spoilage. LIFO is strictly an accounting cost-flow assumption, not a rule dictating which physical cartons move out of the warehouse first.
Which currency does this calculator use?
Amounts are formatted in US dollars (USD). The mathematical logic is universal and currency-agnostic; you can enter unit costs in any currency as long as you use that same unit consistently.

Resources and references

The formulas and methods in this calculator were checked against these independent sources.