FIFO Cost of Goods Sold (COGS) Calculator


FIFO Cost of Goods Sold (COGS) Calculator

This tool helps you calculate cost of goods sold using fifo (First-In, First-Out), a crucial inventory valuation method for accurate financial reporting. Enter your inventory purchases and sales to see your COGS and ending inventory value instantly.

FIFO COGS Calculator

Add each batch of inventory you purchased. The first entry should be your oldest inventory.







Please enter a valid, positive number of units sold.

Enter the total quantity of items sold during the period.


What is the First-In, First-Out (FIFO) Method?

The First-In, First-Out (FIFO) method is a widely used inventory valuation technique where it is assumed that the first goods purchased are the first ones to be sold. When a company needs to calculate cost of goods sold using fifo, it matches the cost of its oldest inventory against the revenue from its recent sales. This approach is logical because most businesses aim to sell their oldest stock first to avoid obsolescence or spoilage, especially in industries dealing with perishable goods, electronics, or fashion.

This method is not just an accounting principle but often reflects the actual physical flow of goods. For financial reporting, using FIFO means that the inventory remaining on the balance sheet is valued at the most recent prices, which provides a more accurate picture of the current value of a company’s assets. During periods of rising prices (inflation), this method results in a lower cost of goods sold, higher net income, and consequently, a higher tax liability.

FIFO Formula and Mathematical Explanation

The core principle to calculate cost of goods sold using fifo does not rely on a single complex formula, but rather on a systematic process of allocating costs. The process involves identifying the units sold and assigning the cost of the oldest inventory layers to these units until the sale quantity is fully accounted for.

The step-by-step process is as follows:

  1. List Inventory Layers: Record all inventory purchases in chronological order, detailing the number of units and the cost per unit for each batch.
  2. Identify Units Sold: Determine the total number of units sold during the accounting period.
  3. Assign Costs from Oldest Layers: Begin with the very first inventory layer (the oldest). Assign its cost to the units sold. If the number of units sold is greater than the units in this layer, use up this entire layer and move to the next oldest layer.
  4. Continue Until All Sold Units Are Accounted For: Keep applying costs from successively newer layers until the total number of units sold has been costed. The sum of these costs is your COGS.
  5. Calculate Ending Inventory: The units that remain unsold constitute the ending inventory. Their value is calculated using the costs of the most recently purchased batches.
Table of Variables in FIFO Calculation
Variable Meaning Unit Typical Range
Purchase Layer Units The number of items in a specific purchase batch. Units 1 – 1,000,000+
Cost Per Unit The price paid for a single item in a purchase batch. Currency ($) $0.01 – $100,000+
Units Sold Total quantity of items sold in the period. Units 1 – Total available units
Cost of Goods Sold (COGS) The total cost assigned to the units sold. Currency ($) Dependent on units sold and costs.
Ending Inventory Value The value of the inventory remaining at the end of the period. Currency ($) Dependent on remaining units and recent costs.

Practical Examples to Calculate Cost of Goods Sold Using FIFO

Real-world examples help clarify how the FIFO method works in practice.

Example 1: A Small Coffee Roastery

A specialty coffee roaster tracks its green bean inventory. Here are its purchases for the month:

  • Jan 1: 100 kg of beans at $20/kg
  • Jan 10: 150 kg of beans at $22/kg
  • Jan 25: 120 kg of beans at $25/kg

In January, the roastery sold 200 kg of roasted beans (assuming a 1:1 ratio for simplicity). To calculate cost of goods sold using fifo:

  • The first 100 kg sold are costed from the Jan 1 batch: 100 kg * $20/kg = $2,000.
  • The remaining 100 kg sold are costed from the Jan 10 batch: 100 kg * $22/kg = $2,200.
  • Total COGS: $2,000 + $2,200 = $4,200.
  • Ending Inventory: 50 kg from Jan 10 at $22/kg and 120 kg from Jan 25 at $25/kg. Value = (50 * $22) + (120 * $25) = $1,100 + $3,000 = $4,100.

Example 2: An Electronics Retailer

A store sells a specific model of headphones. Their inventory transactions are:

  • Q1 Purchase: 200 units at $50/unit
  • Q2 Purchase: 300 units at $45/unit (supplier discount)
  • Q3 Purchase: 250 units at $55/unit (price increase)

The retailer sold 450 units over the three quarters. Here’s the FIFO calculation:

  • The first 200 units sold are from the Q1 purchase: 200 units * $50/unit = $10,000.
  • The next 250 units sold are from the Q2 purchase: 250 units * $45/unit = $11,250.
  • Total COGS: $10,000 + $11,250 = $21,250.
  • Ending Inventory: 50 units remaining from the Q2 purchase (300-250) and all 250 units from the Q3 purchase. Value = (50 * $45) + (250 * $55) = $2,250 + $13,750 = $16,000. A topic you might find interesting is the LIFO vs FIFO comparison.

How to Use This FIFO COGS Calculator

Our tool simplifies the process to calculate cost of goods sold using fifo. Follow these steps for an accurate calculation:

  1. Enter Purchase Layers: In the “Inventory Purchases” section, enter each batch of inventory you acquired. Start with the oldest purchase at the top. For each batch, provide the ‘Units Purchased’ and the ‘Cost per Unit’. Use the “+ Add Purchase Layer” button to add more batches as needed.
  2. Enter Units Sold: In the “Total Units Sold” field, input the total quantity of items sold during the period for which you are calculating COGS.
  3. Review the Results: The calculator automatically updates. The primary result, ‘Cost of Goods Sold (FIFO)’, is displayed prominently. You can also see key intermediate values like ‘Ending Inventory Value’ and ‘Total Units in Ending Inventory’.
  4. Analyze the Breakdown: The chart and table below the results provide a visual and detailed breakdown of the calculation. The chart compares COGS to Ending Inventory Value, while the table shows exactly which inventory layers were used to calculate COGS. This is helpful for understanding your inventory valuation methods.

Key Factors That Affect COGS Results

Several factors can influence the outcome when you calculate cost of goods sold using fifo. Understanding them is crucial for sound financial analysis.

  • Purchase Price Fluctuation: The most direct factor. Rising costs (inflation) will lead to a lower COGS and higher gross profit under FIFO, as cheaper, older costs are recognized first. Conversely, falling costs (deflation) will result in a higher COGS and lower profit.
  • Purchase Timing and Volume: The timing and size of your inventory purchases create the cost layers. Making large purchases before a known price increase can lock in lower costs that will flow through COGS later, impacting profitability.
  • Sales Volume: Higher sales volume will accelerate the rate at which you move through inventory layers. A rapid sales pace means you might burn through older, cheaper layers quickly and start expensing newer, more expensive inventory sooner.
  • Inventory Spoilage or Obsolescence: If products spoil or become obsolete, they must be written off. This removes them from the inventory pool and they are not included in the standard FIFO calculation for sold goods, instead being recorded as a separate expense, which reduces overall profitability.
  • Supplier Discounts and Rebates: Bulk discounts or rebates effectively lower the ‘Cost per Unit’ for a purchase layer. Properly accounting for these reductions is key to an accurate FIFO calculation and can significantly lower your reported COGS. This is related to the overall gross profit calculation.
  • Shipping and Freight Costs: Landed cost, which includes shipping, taxes, and duties, should be part of the unit cost. Fluctuations in these costs will change the cost of your inventory layers and directly impact your FIFO COGS calculation.

Frequently Asked Questions (FAQ)

1. Why is FIFO the most common inventory method?

FIFO is popular because it’s logical—it often matches the actual physical flow of goods for most businesses. It is also straightforward to apply and is accepted under both GAAP and IFRS accounting standards. During inflationary periods, it reports a higher net income, which can be appealing to investors and lenders.

2. How does inflation affect the FIFO calculation?

In an inflationary environment, prices are rising. When you calculate cost of goods sold using fifo, you are expensing your oldest (and cheapest) costs first. This results in a lower COGS, a higher gross profit, and a higher taxable income compared to other methods like LIFO.

3. Is FIFO always the best method?

Not necessarily. While it’s widely used, the best method depends on the business and its goals. For example, in times of rising prices, the LIFO method can result in lower reported profits and thus a lower tax bill. However, LIFO is not permitted under IFRS. You should consult with an accountant to determine the best ending inventory formula and method for your specific situation.

4. Can I switch from FIFO to another method?

Yes, but you cannot do it frequently. Switching inventory valuation methods requires a valid business reason and must be disclosed in your financial statements. You must also apply the change retrospectively to past financial statements for consistency, which can be a complex process. The IRS generally requires approval for such a change.

5. What is the difference between FIFO and the Weighted-Average Cost method?

The weighted-average cost method calculates a single average cost for all available inventory and applies that average cost to both the units sold (COGS) and the units in ending inventory. In contrast, FIFO uses specific cost layers, selling the oldest costs first and leaving the newest costs in inventory. FIFO provides more specific cost tracking, while the average method smooths out price fluctuations.

6. Does FIFO work for a service business?

Generally, no. FIFO is an inventory costing method designed for businesses that sell physical goods. A service business does not hold inventory in the same way, so concepts like COGS are calculated differently (often based on direct labor and materials for the service provided) and methods like FIFO do not apply.

7. How does a perpetual inventory system affect how I calculate cost of goods sold using fifo?

A perpetual inventory system updates inventory records in real-time with every purchase and sale. When using FIFO with a perpetual system, the COGS is calculated at the time of each sale by pulling from the oldest inventory layer available at that exact moment. Our calculator performs this same logic based on the total period’s sales. This is a common part of a good perpetual inventory system.

8. What happens if I sell more units than I have in my oldest layer?

This is the standard scenario in FIFO. If you sell 150 units but your oldest layer only has 100 units, you will first expense all 100 units from that layer. Then, you will take the remaining 50 units you need from the second-oldest inventory layer and expense them at that layer’s cost. This process continues until the full sales quantity is accounted for.

© 2026 Date-Related Web Tools. All Rights Reserved.




Leave a Reply

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