FIFO Calculator for Inventory
FIFO Inventory Calculator
First-In, First-Out cost allocation for accurate COGS and ending inventory valuation
| Batch | Qty | Unit Cost | Allocated | Status |
|---|
FIFO Principle: The first units purchased are the first units sold. Cost of goods sold reflects the oldest inventory costs.
COGS: Sum of (units sold from each batch × that batch's unit cost), starting from the earliest batch
Ending Inventory: Sum of (remaining units in each batch × that batch's unit cost)
A FIFO Calculator for Inventory helps businesses apply the First In, First Out (FIFO) method to calculate:
- Cost of Goods Sold (COGS)
- Ending Inventory Value
- Gross Profit
Managing inventory accurately is essential for tracking profitability and preparing reliable financial statements.
Whether you run a retail store, e-commerce site, or manufacturing company, FIFO records the costs of older inventory first. Thus, it improves financial clarity and reporting accuracy.
In this article, we’ll cover:
- What is the First In, First Out (FIFO) method?
- How does the FIFO inventory valuation formula work?
- How to calculate COGS step by step.
However, we’ll also explain FIFO in both perpetual and periodic inventory systems, compare FIFO vs LIFO and weighted average cost method, and explore how inventory costing affects your income statement and balance sheet.

What Is the FIFO (First In, First Out) Method?
The First In, First Out (FIFO) method is an inventory costing system that follows a simple rule:
FIFO Principle:
The first units purchased are the first units sold.
Cost of goods sold reflects the oldest inventory costs.
In simple terms, when a business sells products, it assumes that the oldest purchase batches are sold before newer ones. This rule is used to calculate Cost of Goods Sold (COGS) and Ending Inventory value.
Definition of FIFO in Inventory Accounting
In inventory accounting, FIFO is an inventory valuation method used to assign costs to:
- Units sold (COGS)
- Units remaining in stock (Ending Inventory)
Moreover, even if products are physically mixed in storage, the accounting system records costs starting from the earliest purchase batch and moves forward.
FIFO helps businesses calculate profit correctly because inventory costs directly affect financial results.
Check out our Customer Retention Rate Calculator
How FIFO Works in Perpetual vs Periodic Inventory Systems
FIFO works the same way in both systems, the only difference is when the calculation happens.
Perpetual Inventory System
In a perpetual inventory system:
- Inventory is updated after every purchase and sale.
- When units are sold, the system immediately removes them from the oldest batch first.
- COGS is calculated in real time.
For example:
If you purchase 100 units at $10 and later 200 units at $12, and you sell 120 units, the system will:
- Remove 100 units from the $10 batch
- Remove 20 units from the $12 batch
COGS reflects those oldest costs instantly.
Periodic Inventory System
In a periodic inventory system:
- Company updates inventory at the end of the accounting period
- The company adds together all purchases
- FIFO is applied after calculating total units sold during the period
Although, you start from the earliest purchase batch. Nonetheless, the calculation is done at the end rather than after each sale.
Learn more about EVM Calculator – Earned Value Management
Formula for FIFO Calculator
FIFO calculations are based on purchase batches and units sold.
COGS Formula Under FIFO
COGS = Sum of (units sold from each batch × that batch’s unit cost), starting from the earliest batch
Step-by-step:
- Identify total units sold.
- Start with the oldest purchase batch.
- Multiply the number of units sold from that batch by its unit cost.
- If more units are required, move to the next batch.
- Add all batch costs together.
This total becomes your Cost of Goods Sold.
Ending Inventory Formula Under FIFO
Ending Inventory = Sum of (remaining units in each batch × that batch’s unit cost)
Step-by-step:
- Determine total units remaining after sales.
- These remaining units come from the newest purchase batches.
- Multiply remaining units in each batch by their unit cost.
- Add them together.
This gives the final value of inventory shown on the balance sheet.
FIFO Calculator Example (Using the Provided Formula)
Let’s go through a clear and simple example using the official FIFO formulas.
We will apply the First In, First Out (FIFO) principle:
Step 1: Inventory Data
Beginning Inventory
- 100 units @ $8
Purchase 1
- 150 units @ $10
Purchase 2
- 200 units @ $12
Total Units Available for Sale:
100 + 150 + 200 = 450 units
Units Sold:
220 units
Step 2: Calculate COGS Using FIFO Formula
FIFO COGS Formula:
COGS = Sum of (units sold from each batch × that batch’s unit cost), starting from the earliest batch
Now apply it step by step:
- Sell 100 units from Beginning Inventory @ $8
→ 100 × 8 = 800 - Sell 120 units from Purchase 1 @ $10
(Because 220 total sold − 100 already sold = 120 remaining)
→ 120 × 10 = 1,200
Now total them:
COGS = 800 + 1,200
COGS = $2,000
Step 3: Calculate Ending Inventory Using FIFO Formula
FIFO Ending Inventory Formula:
Ending Inventory = Sum of (remaining units in each batch × that batch’s unit cost)
After selling 220 units:
From Purchase 1:
150 − 120 = 30 units remain @ $10
From Purchase 2:
200 units remain @ $12
Now calculate:
30 × 10 = 300
200 × 12 = 2,400
Ending Inventory = 300 + 2,400
Ending Inventory = $2,700
Step 4: Calculate Gross Profit (If Revenue Is Provided)
Assume total sales revenue is $3,500.
Gross Profit Formula:
Gross Profit = Revenue − COGS
Gross Profit = 3,500 − 2,000
Gross Profit = $1,500
Final Results from the FIFO Calculator
- Cost of Goods Sold (COGS) = $2,000
- Ending Inventory Value = $2,700
- Gross Profit = $1,500
FIFO vs Other Inventory Costing Methods
Businesses can choose from several inventory valuation methods, and each one affects Cost of Goods Sold (COGS), profit, and taxes differently. The most common methods include FIFO, Last In, First Out (LIFO), the Weighted Average Cost Method, and the Specific Identification Method.
Here’s a simple comparison:
| Method | Inventory Cost Flow | COGS Impact (During Inflation) | Tax Impact | Best For |
|---|---|---|---|---|
| FIFO | Oldest items first | Lower COGS | Higher taxes | Retail |
| LIFO | Latest items first | Higher COGS | Lower taxes | US businesses |
| Weighted Average Cost | Average cost of all units | Moderate | Stable | Manufacturing |
| Specific Identification | Exact cost per item | Highly accurate | Variable | High-value goods |
Discover Direct Material Price Variance Calculator
Conclusion
The FIFO Calculator is a helpful tool for businesses and accountants to accurately track inventory costs using the First-In, First-Out (FIFO) method. Additionally, it ensures that the oldest inventory items are recorded as sold first. As a result , it helps to maintain accurate financial records and inventory valuation.
In the end, by using a FIFO Calculator, businesses can simplify cost of goods sold (COGS) calculations, inventory management, and financial reporting. Overall, this tool makes it easier to manage inventory efficiently, improve accounting accuracy, and support better business decision-making.
FAQs
Q1. What is FIFO in inventory accounting?
Answer: In the First In, First Out (FIFO) method, businesses sell the oldest purchased items first and record their costs in COGS.
Q2. How do you calculate FIFO?
Answer: Start with the earliest purchase batch, assign units sold from that batch first, and continue until all sold units are covered.
Q3. What is the FIFO formula for COGS?
Answer: COGS = Sum of (units sold from each batch × that batch’s unit cost), starting from the earliest batch.
Q4. Is FIFO better than LIFO?
Answer: Compared to Last In, First Out (LIFO), FIFO shows higher profits during inflation, but the best method depends on business goals.
Q5. How does FIFO affect taxes?
Answer: During rising prices, FIFO usually increases reported profit, which may result in higher taxes.
Q6. Is FIFO can be use in perpetual inventory systems?
Answer: Yes, FIFO works in both perpetual and periodic systems. However, the difference is only when calculations are performed.
