- Cost of Goods Purchased $
- COGS $
- Ending Inventory Value $
FIFO and LIFO Calculator
Our FIFO and LIFO calculator helps businesses quickly determine the value of ending inventory and cost of goods sold (COGS) using two of the most common accounting methods: First-In, First-Out (FIFO) and Last-In, First-Out (LIFO).
How to Use the FIFO Method?
FIFO (First-In, First-Out) assumes that the oldest inventory items are sold first. This means that the cost of goods sold is based on the oldest purchase prices, while the ending inventory reflects the most recent purchases.
Formula (FIFO COGS):
COGS = Cost of Oldest Purchases Used
Ending Inventory = Cost of Most Recent Purchases Remaining
To make FIFO calculations even easier, try our Enerpize FIFO template, a ready-to-use tool that shows your COGS and ending inventory step-by-step.
How to Use the LIFO Method?
LIFO (Last-In, First-Out) assumes that the newest inventory items are sold first. This means that the cost of goods sold is based on the most recent purchase prices, while the ending inventory reflects the oldest purchase prices still unsold.
Formula (LIFO COGS):
COGS = Cost of Newest Purchases Used
Ending Inventory = Cost of Oldest Purchases Remaining
To simplify your LIFO calculations, explore our Enerpize LIFO template, which helps you instantly track COGS and ending inventory with clear step-by-step results.
How to Use the FIFO and LIFO Calculator?
Using the FIFO Calculator
- Enter the quantities and costs of each batch of inventory purchased.
- Enter the number of units sold.
- Click Calculate.
- Instantly get the FIFO COGS, FIFO Ending Inventory, and FIFO Layer-Consumption Breakdown Table.
Using the LIFO Calculator
- Enter the same inventory purchases.
- Enter the number of units sold.
- Click Calculate.
- Instantly get the LIFO COGS, LIFO Ending Inventory, and LIFO Layer-Consumption Breakdown Table.
Our tool functions as both a FIFO and LIFO calculator.
Examples of Calculating LIFO and FIFO
FIFO Example
Sarah runs a small bakery. She buys flour in two batches:
- 100 kg at $2 per kg = $200
- 100 kg at $3 per kg = $300
She sells 120 kg of flour.
- Under FIFO: The first 100 kg sold are from the $2 batch, and the next 20 kg are from the $3 batch.
- COGS = (100 × $2) + (20 × $3) = $200 + $60 = $260
- Ending Inventory = 80 kg × $3 = $240
The FIFO calculator shows her ending inventory is valued higher because the newer (more expensive) stock remains.
LIFO Example
Now consider the same bakery example.
- Under LIFO: The first 100 kg sold are from the $3 batch, and the next 20 kg are from the $2 batch.
- COGS = (100 × $3) + (20 × $2) = $300 + $40 = $340
- Ending Inventory = 80 kg × $2 = $160
The LIFO calculator shows a lower ending inventory value, but higher COGS, which reduces taxable income.
FIFO vs LIFO
Understanding the difference between FIFO and LIFO is essential for accurate financial reporting and tax planning:
FIFO (First-In, First-Out)
- Matches older, cheaper inventory costs with sales.
- Leads to lower COGS and higher reported profits when prices are rising.
- Results in a higher ending inventory value.
LIFO (Last-In, First-Out)
- Matches newer, more expensive inventory costs with sales.
- Leads to higher COGS and lower reported profits when prices are rising.
- Results in a lower ending inventory value.
Looking for Beyond Just Calculating Ending Inventory Value?
While our LIFO and FIFO calculator makes inventory valuation fast and simple, businesses often need more than manual calculations. That’s why we built Enerpize, a complete ERP and inventory management system.
With Enerpize Inventory Management Software, you can:
- Monitor COGS and profit margins in real time
- Generate tax-ready reports with accurate inventory valuation.
- Manage purchasing, sales, and warehouse operations in one place.
If you’re ready to go beyond a simple FIFO calculator or LIFO calculator, Enerpize provides everything you need to streamline operations.
Disclaimer
This FIFO and LIFO calculator is provided for general informational purposes only. Inventory valuation methods may vary depending on accounting standards, industry requirements, and tax regulations in your country. Always consult with a qualified accountant before finalizing financial statements.
FAQs
How to do FIFO method with an example?
FIFO (First-In, First-Out):
- The oldest inventory is sold first.
- COGS is based on the oldest purchase prices.
- Ending inventory is based on the most recent purchases.
Example (Bakery case):
- Bought 100 kg flour @ $2 = $200
- Bought 100 kg flour @ $3 = $300
- Sold 120 kg
FIFO calculation:
- First 100 kg sold for $2 per attach
- Next 20 kg sold from $3 batch
COGS = (100×2) + (20×3) = 200 + 60 = 260
Ending Inventory = 80×3 = 240
What is an example of LIFO and FIFO?
A company buys flour in two batches:
- 100 kg @ $2 = $200
- 100 kg @ $3 = $300
Total purchased = 200 kg
The company sells 120 kg.
FIFO (First-In, First-Out)
- Oldest stock (100 kg @ $2) is sold first = $200
- Next 20 kg sold from the $3 batch = $60
COGS FIFO = 200+60=260
Remaining inventory = 80 kg from the $3 batch
Ending Inventory FIFO = 80×3 = 240
LIFO (Last-In, First-Out)
- Newest stock (100 kg @ $3) is sold first = $300
- Next 20 kg sold from the $2 batch = $40
COGSLIFO = 300+40 = 340
Remaining inventory = 80 kg from the $2 batch
Ending Inventory LIFO= 80×2 = 160
How to calculate ending inventory using FIFO?
FIFO (First-In, First-Out): Ending inventory is calculated by valuing the unsold items at the most recent purchase costs, as the oldest costs are assumed to have been sold first.
Example:
Purchases:
100 units @ $10 = $1,000
100 units @ $12 = $1,200
- Total = 200 units
- Sold = 150 units
FIFO:
- First 100 units sold = from $10 batch = $1,000
- Next 50 units sold = from $12 batch = $600
- Remaining = 50 units (all from $12 batch)
Ending Inventory = 50×12 = 600
Related Tools
Sales Tax Calculator
Margin Calculator
Break-Even Point Calculator
Reorder Point Calculator
Calculating FIFO & LIFO is easy with Enerpize.

Try Enerpize inventory software to manage inventory easily.
Start Your Free Trial