FIFO Cost of Goods Sold (COGS) Calculator
Calculate COGS using FIFO
Enter your inventory purchases in the order they were made, then enter the total units sold to calculate Cost of Goods Sold (COGS) and ending inventory using the First-In, First-Out (FIFO) method.
Inventory Purchases (Oldest First)
| # | Quantity | Cost/Unit ($) | Total Cost ($) | Action |
|---|
What is FIFO Cost of Goods Sold?
The First-In, First-Out (FIFO) method is an inventory valuation technique used to determine the Cost of Goods Sold (COGS) and the value of ending inventory. When you calculate cost of goods sold using FIFO, you assume that the oldest inventory items (those purchased first) are sold first. This means the cost associated with the earliest acquired inventory is used to calculate COGS, while the cost of the most recently purchased items is assigned to the ending inventory.
Businesses that deal with perishable goods (like food) or items with a limited shelf life often physically manage their stock using FIFO, so the accounting method aligns with the actual flow of goods. However, even if the physical flow is different, a company can still choose to use FIFO for accounting purposes. To properly calculate cost of goods sold using FIFO, you need detailed records of inventory purchases, including quantities and costs per unit for each batch.
Who Should Use FIFO?
- Businesses with perishable goods (e.g., groceries, pharmaceuticals).
- Companies wanting to report higher net income during periods of rising costs, as older, lower costs are matched with revenues.
- Businesses where the actual flow of goods is first-in, first-out.
- Companies in industries where FIFO is the standard practice.
Common Misconceptions
- FIFO always reflects the physical flow: While it often does for perishables, a company can use FIFO for accounting even if the physical flow differs.
- FIFO is always better than LIFO: The “better” method depends on the industry, inflation environment, and management goals (e.g., tax implications vs. income reporting). LIFO is not permitted under IFRS.
- You need complex software: While software helps, you can calculate cost of goods sold using FIFO manually for smaller inventories, as our calculator demonstrates.
FIFO COGS Formula and Mathematical Explanation
To calculate cost of goods sold using FIFO, we identify the oldest inventory layers and assign their costs to the units sold until the total number of units sold is accounted for. There isn’t one single formula, but rather a process:
- List Purchases Chronologically: Arrange all inventory purchases in the order they were acquired, noting the quantity and cost per unit for each batch.
- Identify Units Sold: Determine the total number of units sold during the period.
- Match Oldest Costs to Units Sold: Starting with the oldest purchase batch, assign its cost to the units sold. If the number of units sold exceeds the quantity in the oldest batch, move to the next oldest batch and continue until all units sold are costed.
- Calculate COGS: Sum the costs assigned to the units sold from the various batches.
- Calculate Ending Inventory: The remaining units (those not sold) are valued at the cost of the most recent purchases.
For example, if you sold 150 units, and your oldest purchase was 100 units at $10 and the next was 80 units at $12:
- 100 units are costed at $10 = $1000
- The remaining 50 units (150 – 100) are costed at $12 = $600
- Total COGS = $1000 + $600 = $1600
- Ending Inventory = 30 units (80 – 50) at $12 + costs of any newer purchases.
Variables Table
| Variable | Meaning | Unit | Typical Range |
|---|---|---|---|
| Qi | Quantity of units in purchase batch ‘i’ | Units | 1 – 1,000,000+ |
| Ci | Cost per unit in purchase batch ‘i’ | Currency ($) | 0.01 – 100,000+ |
| Usold | Total units sold | Units | 1 – 1,000,000+ |
| COGS | Cost of Goods Sold | Currency ($) | Calculated |
| Ending Inventory Value | Value of remaining inventory | Currency ($) | Calculated |
Practical Examples (Real-World Use Cases)
Example 1: Rising Costs
A small electronics retailer made the following purchases of a specific smartphone model in order:
- Jan: 50 units @ $200/unit
- Feb: 70 units @ $210/unit
- Mar: 60 units @ $220/unit
In the first quarter, they sold 100 units.
To calculate cost of goods sold using FIFO:
- Sell the 50 units from Jan @ $200 = $10,000
- Need 50 more units (100 – 50), take from Feb @ $210 = $10,500
- Total COGS = $10,000 + $10,500 = $20,500
- Ending Inventory: 20 units from Feb @ $210 ($4,200) + 60 units from Mar @ $220 ($13,200) = $17,400.
Example 2: Stable Costs
A bookstore purchased a popular novel as follows:
- Week 1: 100 units @ $15/unit
- Week 2: 100 units @ $15/unit
- Week 3: 100 units @ $15/unit
They sold 180 units.
To calculate cost of goods sold using FIFO:
- Sell 100 units from Week 1 @ $15 = $1500
- Need 80 more units (180 – 100), take from Week 2 @ $15 = $1200
- Total COGS = $1500 + $1200 = $2700
- Ending Inventory: 20 units from Week 2 @ $15 ($300) + 100 units from Week 3 @ $15 ($1500) = $1800.
In this case, with stable costs, FIFO, LIFO, and Weighted Average methods would yield the same COGS and ending inventory values. The difference becomes apparent when costs are changing. For more on other methods, see our LIFO calculator or weighted average COGS articles.
How to Use This FIFO COGS Calculator
- Enter Purchases: For each batch of inventory you purchased, enter the “Purchase Quantity” and “Cost per Unit ($)” in the respective fields. Click “Add Purchase Lot”. Add them in the order you acquired them (oldest first). Your added purchases will appear in the “Inventory Purchases” table. You can delete a purchase from the table if needed.
- Enter Units Sold: Input the “Total Units Sold” during the period for which you want to calculate COGS.
- Calculate: Click the “Calculate COGS & Ending Inventory” button.
- View Results: The calculator will display:
- Total Cost of Goods Sold (COGS): The primary result, showing the cost allocated to the units sold using FIFO.
- Ending Inventory Value ($): The value of the remaining inventory based on the costs of the most recent purchases.
- Ending Inventory Units: The number of units remaining in inventory.
- Average Cost Per Unit Sold: Total COGS divided by units sold.
- See the Chart: A bar chart will visualize how the costs from each purchase lot were allocated between COGS and Ending Inventory.
- Reset: Click “Reset All” to clear all purchases, units sold, and results to start over.
Understanding these results helps in financial reporting and inventory management. You can see how the FIFO method assigns costs and values your remaining stock. For a deeper dive into inventory management, explore our inventory management guide.
Key Factors That Affect FIFO COGS Results
- Inflation/Deflation: During periods of rising costs (inflation), FIFO results in a lower COGS (using older, cheaper costs) and a higher ending inventory value (using newer, expensive costs), leading to higher taxable income. The opposite is true during deflation.
- Purchase Timing and Quantity: The timing and size of your inventory purchases directly impact which cost layers are used for COGS and which remain in ending inventory.
- Number of Units Sold: The more units sold, the more purchase layers will be included in the COGS calculation.
- Inventory Holding Period: How long you hold inventory before selling it can influence which cost layers are matched to sales, especially in volatile cost environments.
- Spoilage or Obsolescence: If old inventory spoils or becomes obsolete before being sold, it might be written off, affecting the costs available for COGS under FIFO (though physically it wasn’t sold, it’s removed from inventory).
- Accounting Standards (IFRS vs. US GAAP): While FIFO is permitted under both IFRS and US GAAP, LIFO is not under IFRS, which can influence a company’s choice if they operate internationally. Learn more about accounting basics.
Frequently Asked Questions (FAQ)
- What does FIFO stand for?
- FIFO stands for First-In, First-Out. It’s an inventory costing method assuming the first items purchased are the first ones sold.
- Is FIFO better than LIFO or Weighted Average?
- It depends. FIFO often matches the actual flow of goods for perishables and can result in higher reported income during inflation. LIFO (Last-In, First-Out) can offer tax advantages during inflation but is not allowed under IFRS. Weighted average smooths out cost fluctuations. The “best” method depends on your business goals and the economic environment. Compare with our FIFO vs LIFO analysis.
- How does FIFO affect taxes during inflation?
- During inflation, FIFO matches older, lower costs with current revenues, leading to higher gross profit and taxable income compared to LIFO.
- Can I use FIFO for accounting if my goods don’t flow that way?
- Yes, the accounting method doesn’t have to match the physical flow of goods, although it’s often preferred for it to do so for simplicity and realism, especially with perishable items.
- How do I calculate cost of goods sold using FIFO if I have many small purchases?
- You need to track each purchase lot (quantity and cost) separately and apply them in chronological order against the units sold. Our calculator helps automate this.
- What happens if I sell fewer units than my first purchase lot?
- Then all units sold are costed at the price of the first purchase lot, and the remaining units from that lot, plus all subsequent lots, form your ending inventory.
- Does FIFO give a more accurate ending inventory value?
- In times of rising prices, FIFO values ending inventory at the most recent, higher costs, which can be closer to the current replacement cost of the inventory, often considered more “accurate” on the balance sheet.
- What is the opposite of FIFO?
- LIFO (Last-In, First-Out) is generally considered the opposite, where the most recently purchased items are assumed to be sold first.
Related Tools and Internal Resources
- FIFO Method Explained: A deep dive into the FIFO inventory valuation method.
- Inventory Management Guide: Best practices for managing your stock efficiently.
- Cost of Goods Sold (COGS) Explained: Understand what COGS is and why it’s important.
- Accounting Basics for Small Business: Fundamental accounting principles.
- LIFO Calculator: Calculate COGS using the Last-In, First-Out method.
- Weighted Average COGS Calculator: Determine COGS using the weighted average cost method.