Inventory calculator
FIFO/LIFO Calculator
Use this free FIFO/LIFO calculator to estimate cost of goods sold and ending inventory using two common inventory valuation methods. Enter inventory batches and units sold to compare FIFO and LIFO results. It is useful for inventory tracking, cost analysis, and accounting preparation.
FIFO result
- COGS
- 260
- Ending inventory
- 240
Layer breakdown
Batch 1Consumed: 100Remaining: 0
Batch 2Consumed: 20Remaining: 80
LIFO result
- COGS
- 340
- Ending inventory
- 160
Layer breakdown
Batch 1Consumed: 20Remaining: 80
Batch 2Consumed: 100Remaining: 0
Inventory layer overview
FIFO result
Batch 1100 × 2
Consumed: 100Remaining: 0
Batch 2100 × 3
Consumed: 20Remaining: 80
LIFO result
Batch 1100 × 2
Consumed: 20Remaining: 80
Batch 2100 × 3
Consumed: 100Remaining: 0
How FIFO and LIFO calculations work
FIFO and LIFO are inventory valuation methods. FIFO assumes the oldest inventory is sold first. LIFO assumes the newest inventory is sold first. The method used can change COGS and ending inventory when purchase costs change over time.
FIFO method
FIFO means first in, first out. The oldest inventory layers are used first to calculate COGS.
FIFO COGS = Cost of oldest units sold first
LIFO method
LIFO means last in, first out. The newest inventory layers are used first to calculate COGS.
LIFO COGS = Cost of newest units sold first
Ending inventory
Ending inventory = Total inventory cost − COGS
How to use this calculator
- Enter the quantity and unit cost for each inventory batch
- Enter the number of units sold
- Review FIFO COGS and ending inventory
- Review LIFO COGS and ending inventory
- Compare how the method changes inventory valuation
Examples
Inputs
- Batch 1
- 100 units at 2
- Batch 2
- 100 units at 3
- Units sold
- 120
FIFO
- COGS
- 100 × 2 + 20 × 3 = 260
- Ending inventory
- 80 × 3 = 240
LIFO
- COGS
- 100 × 3 + 20 × 2 = 340
- Ending inventory
- 80 × 2 = 160
Tips
FIFO and LIFO can produce different results when costs change.
FIFO usually leaves newer costs in ending inventory.
LIFO usually leaves older costs in ending inventory.
Confirm which inventory valuation methods are accepted in your accounting context.
Use consistent methods for reporting.
Want to manage inventory layers more clearly?
Gombo helps you manage stock, purchases, invoices, reporting, and business operations from one connected platform.
Start with Gombo