FIFO and LIFO calculator for retail inventory
Compare batch-layer merchandise expense and closing stock value side by side across oldest-in, newest-in and weighted unit cost accounting.
Value up to three purchase batches in chronological order and compare direct merchandise cost and closing stock side by side across oldest-first, newest-first and blended unit costing. Retailers facing supplier price changes can run this free browser tool as a fifo calculator, a lifo calculator, and a weighted-average checker in one step.
Inputs remain local to your open browser tab with nothing stored or sent to a server.
How to compare three purchase batches
- Enter units received and unit cost in dollars for the oldest stock layer (Batch 1 must have at least 1 unit above $0).
- Enter units received and unit cost for Batch 2 and Batch 3 in the order deliveries arrived (enter 0 units for unused batches).
- Enter whole units sold across the period, up to total units available across all batches.
- Select Calculate to inspect unit availability, merchandise expense and closing stock across all three valuation methods, or select Use example to load the three-batch sample below.
How oldest-first, newest-first and blended costing work
- Oldest-cost layers. Under the first in first out method, units sold draw from the earliest purchase layer before touching newer receipts. A fifo inventory calculation leaves recent supplier prices on the balance sheet, so ending inventory fifo closely tracks current replacement cost.
- Newest-cost layers. Last-in, first-out expenses the most recent purchase batch first and leaves older cost layers in closing stock. Comparing fifo and lifo shows how supplier inflation shifts dollars between current-period profit and balance-sheet inventory.
- Blended pool. The average cost method divides total pool cost across all available units (`total batch cost ÷ total units available`) and applies that single unit rate to both units sold and unsold units remaining.
Federal tax rules governing cost identification and last-in, first-out elections appear in IRS Publication 538 and Treasury regulation 26 CFR 1.472-1. Keep valuation consistent across periods and consult an accountant before changing methods; these figures are educational estimates, not tax advice.
Worked example: 80 units sold across three rising cost layers
Harbor Pantry buys 50 olive-oil tins at $10, restocks 60 tins at $12, adds 40 tins at $15, and sells 80 tins during the quarter (150 total units costing $1,820, leaving 70 unsold units):
| Batch / Input | Quantity | Unit cost | Layer total |
|---|---|---|---|
| Oldest batch (Batch 1) | 50 units | $10.00 | $500.00 |
| Second batch (Batch 2) | 60 units | $12.00 | $720.00 |
| Newest batch (Batch 3) | 40 units | $15.00 | $600.00 |
| Total units sold | 80 units | - | - |
- Oldest-first result: Expensing 50 units at $10 ($500) plus 30 units at $12 ($360) produces $860.00 in cost of goods sold and $960.00 in closing stock (30 units at $12 plus 40 units at $15).
- Newest-first result: Expensing 40 units at $15 ($600) plus 40 units at $12 ($480) produces $1,080.00 in cost of goods sold and $740.00 in closing stock (50 units at $10 plus 20 units at $12).
- Weighted average result: Dividing $1,820 by 150 units gives $12.13 per unit ($12.1333 unrounded), yielding $970.67 in cost of goods sold and $849.33 in closing stock.
Connect batch costing to store stock control
Physical shelf rotation and accounting cost flow do not have to match, though grocers and boutiques usually pair oldest-first physical rotation with matching cost layers. Read our inventory costing methods guide for deeper examples, reconcile full-period purchases in the COGS calculator, and measure stock velocity in the inventory turnover calculator.
Frequently asked questions
Which inventory valuation method gives higher gross profit?
When wholesale supplier prices rise over time, expensing older, lower-cost batches first produces lower cost of goods sold and higher reported gross profit than expensing newest batches first. When supplier prices fall, that relationship reverses.
Can small retailers use LIFO for tax reporting?
In the United States, businesses electing last-in, first-out for federal tax filings must file IRS Form 970 and follow conformity rules requiring the same method on financial statements, whereas International Financial Reporting Standards (IFRS) prohibit newest-first costing outside US GAAP.
Related free tools
Explore Headoffis features for managing your stores, stock and team.