FIFO COGS Calculator: Calculate Cost of Goods Sold


FIFO COGS Calculator

An expert tool for calculating Cost of Goods Sold using the First-In, First-Out method.

Inventory & Sales Calculator

Inventory Purchases


Units Cost per Unit ($) Total Cost ($) Action
Add your inventory purchases chronologically (oldest first).



Enter the quantity and cost for a new batch of inventory.



Enter the total number of units sold during the period.

What is Calculating COGS Using FIFO?

Calculating COGS using FIFO is an inventory valuation method that stands for “First-In, First-Out.” It operates on the assumption that the first units purchased or produced are the first ones to be sold. This accounting technique is crucial for determining the Cost of Goods Sold (COGS), a key metric on a company’s income statement. When you use FIFO, the cost of the oldest inventory is assigned to COGS, while the cost of the most recently acquired inventory remains in the ending inventory balance.

This method is particularly logical for businesses dealing with perishable goods (like groceries) or products with a limited shelf life (like electronics) because it mirrors the actual physical flow of inventory. By selling the oldest items first, a company can reduce the risk of spoilage or obsolescence. During periods of rising prices (inflation), calculating COGS using FIFO typically results in a lower COGS, a higher reported gross profit, and a higher value for ending inventory.

The Formula for Calculating COGS using FIFO

There isn’t a single, simple formula for FIFO like there is for other metrics. Instead, it’s a step-by-step process of assigning costs. The core principle is:

COGS = Cost of the first X units purchased, where X is the number of units sold.

To perform the calculation, you must track your inventory in layers or batches, with each batch having a specific quantity and cost. When a sale occurs, you exhaust the units from the oldest batch first, then move to the next oldest, and so on, until you have accounted for all the units sold.

Key Variables in FIFO Calculation
Variable Meaning Unit Typical Range
Inventory Layers Distinct batches of inventory purchased at different times and costs. Batch (Units, Cost) 1 to hundreds of layers
Units per Layer The number of items in a specific purchase batch. Count (e.g., pieces, kg) 1 – 1,000,000+
Cost per Unit The purchase price of a single item within a batch. Currency (e.g., $) $0.01 – $10,000+
Units Sold The total quantity of items sold during the accounting period. Count 1 – 1,000,000+

Practical Examples

Example 1: Basic FIFO Calculation

A coffee shop starts the month with no inventory. Their purchases are:

  • Jan 5: Purchased 100 bags of coffee at $10/bag.
  • Jan 15: Purchased 80 bags of coffee at $12/bag.

During January, the shop sold 120 bags of coffee. Let’s find the COGS.

Inputs:

  • Batch 1: 100 units @ $10
  • Batch 2: 80 units @ $12
  • Units Sold: 120

Results:

  • Under FIFO, we assume the first 100 bags sold were from the first batch (100 bags @ $10 = $1,000).
  • The remaining 20 bags sold are from the second batch (20 bags @ $12 = $240).
  • Total COGS: $1,000 + $240 = $1,240.
  • Ending Inventory: 60 bags from the second batch remain (60 bags @ $12 = $720).

Example 2: Multiple Layers

An electronics store has the following inventory of headphones:

  • Batch 1: 50 units @ $100
  • Batch 2: 100 units @ $110
  • Batch 3: 75 units @ $115

The store sells 160 headphones. Let’s calculate the COGS.

Inputs & Calculation:

  • First, sell all 50 units from Batch 1: 50 * $100 = $5,000. (Units left to account for: 160 – 50 = 110)
  • Next, sell 100 units from Batch 2: 100 * $110 = $11,000. (Units left to account for: 110 – 100 = 10)
  • Finally, sell 10 units from Batch 3: 10 * $115 = $1,150.

Results:

  • Total COGS: $5,000 + $11,000 + $1,150 = $17,150.
  • Ending Inventory: 65 units remain from Batch 3 (65 * $115 = $7,475).
  • For more guidance, see this guide to accounting basics.

How to Use This FIFO COGS Calculator

  1. Add Inventory Purchases: In the “Add New Purchase Batch” section, enter the number of units and the cost per unit for your oldest inventory first. Click “Add Purchase”.
  2. Repeat for All Batches: Continue adding all your inventory purchases in chronological order. The table will display all your inventory layers.
  3. Enter Units Sold: In the “Total Units Sold” field, enter the total number of items sold during the period.
  4. Calculate: Click the “Calculate COGS” button.
  5. Interpret Results: The calculator will display the total COGS, the value and quantity of your ending inventory, and the average cost of each unit sold. A chart will also visualize which cost layers were used.

Key Factors That Affect Calculating COGS using FIFO

  • Inflation/Deflation: During periods of rising prices, FIFO results in a lower COGS and higher profit. The opposite is true in deflationary periods.
  • Purchase Timing: The timing and cost of inventory purchases directly create the cost layers that are fundamental to the calculation.
  • Inventory Damage or Obsolescence: Writing off spoiled or outdated goods removes them from inventory, affecting both the units available for sale and the ending inventory value.
  • Supplier Price Changes: Fluctuations in raw material or wholesale costs change the cost of new inventory layers, which will eventually flow through to COGS.
  • Inventory Holding Costs: While not part of COGS directly, high storage costs can influence purchasing decisions, which in turn affects the COGS calculation. To learn more, read about inventory management strategies.
  • Product Mix: If you sell multiple products, you must apply the FIFO method separately to each product’s inventory.

Frequently Asked Questions (FAQ)

1. What does FIFO stand for?

FIFO stands for First-In, First-Out. It’s a method for inventory accounting.

2. Is calculating COGS using FIFO always the best method?

Not always. While it’s logical for many businesses, some prefer LIFO (Last-In, First-Out) or the Weighted-Average method, especially for tax purposes in certain regions. For a comparison, you might want to read about LIFO vs. FIFO.

3. How does FIFO affect taxes?

In an inflationary environment, FIFO results in higher reported profits, which can lead to a higher income tax liability compared to LIFO.

4. What happens if I sell more units than I have in the oldest batch?

The calculation automatically moves to the next oldest batch to account for the remaining units sold, as shown in the examples above.

5. Are units and costs the only inputs?

Yes, for a basic FIFO COGS calculation, the essential inputs are the units and their associated costs, organized into chronological batches.

6. Can I use this calculator for any type of product?

Yes, this calculator is unit-agnostic. It works for any item as long as you can provide the number of units and the cost per unit for each purchase.

7. What is ending inventory?

Ending inventory is the value of the goods that remain unsold at the end of the accounting period. With FIFO, this consists of the most recently purchased items.

8. How does COGS relate to Gross Profit?

Gross Profit is calculated as Revenue minus COGS. Therefore, an accurate COGS calculation is essential for determining your company’s profitability. A guide to the profit and loss statement can provide more context.

© 2026 SEO Tools Inc. All rights reserved.



Leave a Reply

Your email address will not be published. Required fields are marked *