LIFO For Inventories Calculator - Newest-Layer COGS

Use this lifo for inventories calculator to apply newest-cost layers to units sold, ending inventory, COGS, gross profit, and margin.

Updated: June 9, 2026 • Free Tool

LIFO For Inventories Calculator

Units in the oldest available cost layer.

$

Cost per unit for the oldest layer.

Units in the next newer cost layer.

$

Cost per unit for the second layer.

Units in the third cost layer.

$

Cost per unit for the third layer.

Optional newest layer units.

$

Cost per unit for the newest layer.

Units assigned to COGS for the period.

$

Sales revenue for the same units and period.

Results

LIFO COGS
$0
Ending inventory $0
Ending units 0units
Avg. ending cost $0
Gross profit $0
Gross margin 0%
Units available 0units

What Is This Calculator?

A lifo for inventories calculator applies last-in, first-out costing to purchase layers so you can estimate cost of goods sold, ending inventory, remaining units, gross profit, and gross margin for one reporting period. Use it when purchase costs changed during the month, a class problem asks for LIFO COGS, a retailer wants to compare margin under rising replacement costs, or a bookkeeper needs a quick check before reviewing inventory entries.

  • Month-end close: Convert beginning stock and purchase batches into LIFO COGS before reviewing gross profit.
  • Method comparison: Compare newest-cost allocation with FIFO to see how the same units and costs change reported COGS.
  • Accounting homework: Trace which units leave each layer so the LIFO method is easier to audit step by step.
  • Margin review: Check whether higher recent costs are being matched with current sales before making pricing decisions.

The calculator is designed for interchangeable goods, such as units of the same SKU, not one-of-a-kind items that require specific identification. Enter the oldest layer first and the newest layer last. The result is a cost allocation model: it says which costs are assigned to units sold, not necessarily which physical boxes left the shelf.

Use LIFO only when it fits the accounting context you are modeling. It can be useful for U.S. accounting or tax examples, but it is not a universal inventory method. For the opposite layer assumption, the existing FIFO page gives the side-by-side workflow.

When you need the opposite oldest-cost assumption for the same purchase layers, compare the result with the FIFO For Inventories Calculator.

How It Works

This lifo for inventories calculator walks through layers from newest to oldest, assigns sold units to each layer, and leaves older remaining costs in ending inventory.

LIFO COGS = sum of sold units from newest layers x each layer's unit cost; Ending inventory = total inventory cost available - LIFO COGS
  • Cost layer: A batch of inventory with its own unit count and unit cost, entered from oldest to newest.
  • Units sold: The quantity sold, consumed, or otherwise assigned to COGS during the period.
  • LIFO COGS: The cost assigned to units sold after consuming the newest layer costs first.
  • Ending inventory: The remaining cost attached to unsold units after the LIFO allocation.

The outputs should be read together. LIFO COGS affects the income statement, while ending inventory affects the balance sheet. Gross profit and margin add a revenue view, but they do not replace operating profit because selling, administrative, financing, and tax costs are outside this model.

According to IRS Publication 538, LIFO assumes the last items purchased or produced are the first items sold, consumed, or otherwise disposed of. The same source explains that, when prices rise, LIFO generally produces larger COGS and lower closing inventory than FIFO.

LIFO layer example

Suppose you have 100 units at $10, then 80 units at $12, then 50 units at $13. You sell 140 units for $2,100.

LIFO COGS uses all 50 units from the $13 layer, all 80 units from the $12 layer, and 10 units from the $10 layer: 50 x $13 + 80 x $12 + 10 x $10 = $1,710.

Ending inventory is $900, made up of 90 units at $10. Gross profit is $390 and gross margin is 18.57%.

The result shows that newer costs flowed to COGS while older costs stayed on the balance sheet as ending inventory.

According to IRS Publication 538, LIFO assumes the last items purchased or produced are the first items sold, consumed, or otherwise disposed of, and rising prices generally make LIFO COGS higher than FIFO COGS.

If your COGS is already known and you only need the broader inventory rollforward, the COGS Calculator can connect direct costs to gross profit without layer allocation.

Key Concepts

LIFO results become clearer when you separate inventory flow, cost flow, period matching, and margin interpretation.

Cost-flow assumption

LIFO is an accounting assumption about which costs move to COGS first. It does not require the warehouse to ship the exact newest unit first.

Goods available for sale

This is the total quantity and cost available before the sale allocation. Units sold cannot exceed this amount without an inventory record problem.

Layer liquidation

A layer is liquidated when sales consume all units in a newer layer and begin reaching older layers. That can make current profit sensitive to old costs.

Margin timing

When costs rise, LIFO may show lower current gross margin because newer, higher costs are assigned to sales first.

Keep the period consistent. Units sold, net sales, and purchase layers should all belong to the same reporting window. Mixing a monthly sales total with quarterly purchase layers can make COGS, ending inventory, and margin look more precise than the records support.

The calculator does not choose an accounting policy for you. It helps apply LIFO once you have decided that LIFO is the right cost-flow assumption for the records you are reviewing.

After you settle on a LIFO COGS amount, the Ending Inventory Calculator is useful for checking the period rollforward from beginning stock, purchases, and COGS.

How to Use It

Use the lifo for inventories calculator with layers in chronological order and keep all amounts on the same cost basis.

  1. 1 Enter the oldest layer: Add the oldest available units and their unit cost. This may be beginning inventory or the first purchase batch in the period.
  2. 2 Add newer layers: Enter each later purchase or production batch in order. The newest nonzero layer will be allocated to COGS first.
  3. 3 Enter units sold: Use the number of units assigned to sales or usage for the same period covered by the layers.
  4. 4 Enter net sales: Add sales revenue after returns or discounts if you want gross profit and gross margin outputs.
  5. 5 Review the allocation: Check LIFO COGS, ending units, ending inventory, and average ending cost before using the result in a worksheet or review memo.

A retailer with 230 units available sells 140 units after supplier costs rose twice. Entering the three purchase layers shows how much recent cost flows into COGS and how much older cost remains in ending inventory. If margin looks lower than a FIFO worksheet, the difference is coming from the cost-flow assumption, not from a different sales quantity.

Benefits

The value of a lifo for inventories calculator is not only the final COGS number; it is the audit trail behind that number.

  • Shows layer-by-layer logic: You can explain exactly which recent costs were assigned to units sold instead of relying on one blended average.
  • Supports gross profit review: Pairing LIFO COGS with sales makes it easier to see whether reported margin reflects recent replacement costs.
  • Checks inventory records: The units-available output can reveal when sales quantities exceed the layers entered, which usually means a missing batch or timing mismatch.
  • Improves planning conversations: Ending inventory cost and average ending cost help purchasing, accounting, and operations discuss the same stock value.
  • Keeps assumptions visible: The calculator separates units, cost, sales, and margin so policy choices and data limitations are easier to spot.

For small teams, the practical benefit is speed with traceability. You can test a purchase-cost scenario, review the result with a manager, and still show the layer math behind the answer.

For larger teams, the same logic can help spot questions before they enter an accounting system: missing purchase batches, wrong unit costs, sales entered in the wrong period, or a margin result that needs more review.

Once ending stock and COGS are reasonable, the Days Inventory Outstanding Calculator helps translate those accounting values into stock timing.

Factors That Affect Results

LIFO outputs change whenever layer order, unit counts, costs, sales timing, or reporting rules change.

Purchase price trend

Rising prices usually push newer, higher costs into COGS under LIFO, while falling prices can produce the opposite pattern.

Layer order

Entering layers out of chronological order changes COGS because LIFO depends on newest costs being consumed first.

Partial units

If your records allow fractional units, small decimals can affect COGS and average ending cost, especially for high-value inventory.

Sales revenue basis

Gross margin is meaningful only when net sales and units sold cover the same products and period as the cost layers.

Reporting framework

A LIFO worksheet may be useful for a U.S. scenario, but IFRS reporting uses different cost formula limits for interchangeable inventory.

  • This calculator is an educational and planning model. It does not replace an inventory subledger, auditor judgment, tax advice, or a documented accounting-method election.
  • The model does not handle returns, spoilage, lower-of-cost or market adjustments, dollar-value LIFO pools, inflation indexes, freight allocation, currency translation, or SKU-level pooling.
  • If units sold exceed units available, the calculation stops because the source records need correction before LIFO can be applied.

According to IRS Publication 538, adopting LIFO for U.S. tax purposes generally requires filing Form 970 or an equivalent statement with the timely filed tax return for the first year the method is used. Treat this calculator as a layer-costing aid, not as an accounting-method election.

According to IFRS IAS 2 Inventories, inventories are measured at the lower of cost and net realisable value, and ordinarily interchangeable items use first-in, first-out or weighted average cost formulas. That means LIFO output is not an IFRS inventory measurement answer.

The IRS page for Form 970 is the more specific source when you need the U.S. tax election form used to apply LIFO to inventory.

According to IFRS IAS 2 Inventories, inventories are measured at the lower of cost and net realisable value, and ordinarily interchangeable items use first-in, first-out or weighted average cost formulas.

For pricing work that starts with cost and sale price rather than inventory layers, the Gross Margin Calculator gives a cleaner margin-only view.

lifo for inventories calculator showing LIFO COGS, ending inventory, and purchase cost layers
lifo for inventories calculator showing LIFO COGS, ending inventory, and purchase cost layers

Frequently Asked Questions

Q: How do you calculate LIFO for inventory?

A: List inventory layers from oldest to newest, then assign units sold to the newest layer first. Move backward only after each newer layer is exhausted. The assigned cost becomes LIFO COGS, and the unassigned cost remains in ending inventory.

Q: What is the LIFO formula for COGS?

A: LIFO COGS is the sum of sold units from each newest available layer multiplied by that layer's unit cost. When a sale uses only part of a layer, only the sold portion of that layer is included in COGS.

Q: How do you calculate ending inventory using LIFO?

A: After assigning sold units to new layers, calculate the cost left in unsold layers. You can also subtract LIFO COGS from total inventory cost available for sale. The remaining cost is ending inventory under LIFO.

Q: Does LIFO mean the exact newest physical items sold first?

A: Not necessarily. LIFO is a cost-flow assumption for accounting. A warehouse may ship older units for spoilage or storage reasons, while LIFO accounting still assigns the newest costs to COGS for interchangeable goods.

Q: How does LIFO affect gross profit when prices rise?

A: When purchase prices rise, LIFO usually assigns newer higher costs to COGS first. That can make gross profit and ending inventory lower than FIFO for the same units and sales revenue, before considering other expenses or taxes.

Q: Can this be used for tax or audited statements?

A: Use it as a calculation aid, not as tax, audit, or accounting-method advice. Formal reporting may require inventory subledger detail, consistency rules, LIFO election procedures, valuation review, and professional judgment.