Calculate Cost of Goods Sold (FIFO) – FIFO COGS Calculator


Calculate Cost of Goods Sold (FIFO)

Easily determine your Cost of Goods Sold (COGS) using the First-In, First-Out (FIFO) inventory valuation method.


Total cost of inventory at the start of the period.


Total cost of all inventory purchased during the period.


The number of inventory units sold during the period.


The number of inventory units on hand at the start of the period.


The total number of inventory units purchased during the period.



Inventory Purchases and Sales Flow (FIFO)
Period Description Units In Cost Per Unit Total Cost In Units Out Cost Per Unit (FIFO) Total Cost Out Units Remaining Cost Per Unit (Remaining) Total Cost Remaining
Start Opening Inventory 100 $100.00 $10,000.00 0 $0.00 $0.00 100 $100.00 $10,000.00
Purchase 1 Inventory Purchase 200 $100.00 $20,000.00 0 $0.00 $0.00 300 $100.00 $30,000.00
Sale 1 Units Sold 0 $0.00 $0.00 150 $100.00 $15,000.00 150 $100.00 $15,000.00
FIFO Inventory Valuation Over Time

What is Cost of Goods Sold (FIFO)?

The Cost of Goods Sold (COGS) using the FIFO (First-In, First-Out) method is a fundamental accounting concept that determines the expense associated with the inventory sold by a business during a specific period. The FIFO principle dictates that the first inventory items purchased are assumed to be the first ones sold. This means that the cost of the oldest inventory is recognized as COGS, while the cost of the most recently purchased inventory remains in the ending inventory balance. Understanding COGS is crucial for accurately calculating a company’s gross profit and net income, as it directly impacts the profitability reported on financial statements.

Who Should Use It: The FIFO method is widely used by businesses that sell perishable goods or items with expiration dates, such as grocery stores, pharmacies, and food distributors. It is also a common choice for businesses where inventory turnover is relatively quick, and the cost of inventory tends to rise over time. Companies that need to present a higher net income and a higher inventory valuation on their balance sheet might also favor FIFO, especially in inflationary environments.

Common Misconceptions: A common misconception is that FIFO tracks the physical movement of inventory. In reality, it’s an accounting assumption. The actual physical units sold might not be the oldest ones. Another misconception is that FIFO always results in the lowest COGS. While often true in rising price environments, in a deflationary environment (where prices are falling), FIFO would result in a higher COGS compared to LIFO (Last-In, First-Out).

FIFO COGS Formula and Mathematical Explanation

The calculation of Cost of Goods Sold (COGS) using the FIFO method involves determining the cost of the oldest inventory units and assigning them to the units that have been sold. The core principle is that you sell your oldest stock first.

Step-by-Step Derivation:

  1. Calculate Goods Available for Sale: First, sum the cost of your opening inventory and all inventory purchases made during the period. This gives you the total cost of all goods available for sale.

    Goods Available for Sale = Opening Inventory Cost + Purchases Cost
  2. Calculate Units Available for Sale: Similarly, sum the number of units in your opening inventory and the number of units purchased.

    Units Available for Sale = Beginning Inventory Units + Units Purchased
  3. Determine Ending Inventory Units: Subtract the number of units sold from the total units available for sale.

    Ending Inventory Units = Units Available for Sale – Units Sold
  4. Calculate Cost of Ending Inventory: Since FIFO assumes the oldest units are sold first, the ending inventory consists of the most recently purchased units. You need to cost these units from the latest purchases backwards until you account for all ending inventory units.
  5. Calculate Cost of Goods Sold (COGS): The COGS is the cost of the inventory that has been sold. Using the FIFO principle, this is the cost of the oldest units. You can calculate this directly by costing the units sold from the oldest available stock, or indirectly using the formula:

    COGS (FIFO) = Goods Available for Sale – Cost of Ending Inventory

An alternative way to think about the FIFO COGS is that it represents the cost of the units sold, where the costs are assigned sequentially from the earliest purchases.

Variable Explanations

Variable Meaning Unit Typical Range
Opening Inventory Cost The total cost of inventory held at the beginning of the accounting period. Currency ($) $0 to millions, depending on business size.
Purchases Cost The total cost incurred for all inventory purchases during the accounting period. Currency ($) $0 to millions, depending on business activity.
Units Sold The quantity of inventory units sold to customers during the period. Units Non-negative integer; typically less than or equal to Units Available for Sale.
Beginning Inventory Units The quantity of inventory units on hand at the start of the accounting period. Units Non-negative integer.
Units Purchased The total quantity of inventory units acquired during the accounting period. Units Non-negative integer.
Goods Available for Sale The total cost of all inventory available to be sold during the period. Currency ($) Sum of Opening Inventory Cost and Purchases Cost.
Cost of Ending Inventory The total cost of inventory remaining at the end of the period, valued using FIFO. Currency ($) Valued based on the cost of the most recent purchases.
COGS (FIFO) The recognized expense for the inventory sold during the period using the FIFO assumption. Currency ($) Cannot exceed Goods Available for Sale.

Practical Examples (Real-World Use Cases)

Example 1: A Small Bakery

“Sweet Delights Bakery” starts the month with 100 croissants (baked on-site, cost $1.00 each). During the month, they bake 500 more croissants, costing $1.20 each due to rising ingredient prices. They sell 450 croissants.

  • Opening Inventory Cost: 100 units * $1.00/unit = $100.00
  • Purchases Cost: 500 units * $1.20/unit = $600.00
  • Goods Available for Sale: $100.00 + $600.00 = $700.00
  • Beginning Inventory Units: 100 units
  • Units Purchased: 500 units
  • Units Available for Sale: 100 + 500 = 600 units
  • Units Sold: 450 units
  • Ending Inventory Units: 600 – 450 = 150 units

FIFO Calculation for COGS:
Since FIFO assumes the oldest units are sold first, the 450 units sold are accounted for as follows:

  • 100 units from opening inventory @ $1.00/unit = $100.00
  • 350 units from the purchase @ $1.20/unit = $420.00

COGS (FIFO) = $100.00 + $420.00 = $520.00

Ending Inventory Cost: The remaining 150 units are from the latest purchase.

  • 150 units @ $1.20/unit = $180.00

Alternatively: Goods Available for Sale – COGS = $700.00 – $520.00 = $180.00.

Financial Interpretation: The bakery recognizes $520.00 as COGS. Their Gross Profit would be Revenue – $520.00. The ending inventory of $180.00 is reported on the balance sheet.

Example 2: An Electronics Retailer

“Gadget World” sold 30 units of a specific smartphone model. Their inventory records show:

  • Opening Inventory: 20 units @ $500/unit. Total Cost: $10,000.
  • Purchase 1: 40 units @ $520/unit. Total Cost: $20,800.
  • Purchase 2: 50 units @ $530/unit. Total Cost: $26,500.
  • Units Sold: 30 units.

FIFO Calculation for COGS:
The 30 units sold are assumed to be from the oldest stock first.

  • 20 units from Opening Inventory @ $500/unit = $10,000.00
  • 10 units from Purchase 1 @ $520/unit = $5,200.00

COGS (FIFO) = $10,000.00 + $5,200.00 = $15,200.00

Calculation of Ending Inventory:

  • Remaining from Purchase 1: 40 – 10 = 30 units @ $520/unit = $15,600.00
  • All from Purchase 2: 50 units @ $530/unit = $26,500.00

Ending Inventory Cost: $15,600.00 + $26,500.00 = $42,100.00

Check: Goods Available for Sale = $10,000 (Opening) + $20,800 (P1) + $26,500 (P2) = $57,300.
COGS + Ending Inventory = $15,200 + $42,100 = $57,300. The math balances.

Financial Interpretation: Gadget World reports $15,200 as the Cost of Goods Sold for these 30 units. In an environment where prices are rising (inflationary), this method results in a lower COGS and consequently higher gross profit compared to LIFO.

How to Use This FIFO COGS Calculator

Our free FIFO COGS Calculator simplifies the process of calculating your Cost of Goods Sold using the First-In, First-Out method. Follow these simple steps:

  1. Input Opening Inventory: Enter the total cost of your inventory at the very beginning of the accounting period in the “Opening Inventory Cost” field. Also, enter the number of units you had at the start in “Beginning Inventory Units”.
  2. Input Purchases: Enter the total cost of all inventory you purchased during the period in “Purchases Cost”. Enter the total number of units purchased in “Units Purchased”.
  3. Input Sales Data: Enter the total number of units sold during the period in the “Units Sold” field.
  4. Calculate: Click the “Calculate COGS” button. The calculator will automatically apply the FIFO principle.

How to Read Results:

  • Primary Result (FIFO COGS): This prominently displayed number is your calculated Cost of Goods Sold for the period using the FIFO method.
  • Average Cost Per Unit (for sold units): This shows the average cost attributed to each unit sold under FIFO.
  • Ending Inventory Units: The quantity of inventory remaining at the end of the period.
  • Ending Inventory Cost: The total cost of the inventory remaining, valued according to the FIFO method.
  • Formula Explanation: A brief description of the underlying calculation is provided for clarity.
  • Inventory Table: The table visualizes the flow of inventory, showing how costs are assigned based on the FIFO assumption as units are sold.
  • Inventory Chart: This chart provides a visual representation of how the inventory value changes over the period, highlighting the FIFO approach.

Decision-Making Guidance: The COGS figure derived from this calculator is essential for determining your business’s gross profit (Revenue – COGS). A lower COGS (in an inflationary period) using FIFO will lead to a higher reported gross profit. Conversely, a higher COGS (in a deflationary period) using FIFO will result in a lower gross profit. Use this information to assess pricing strategies, manage inventory levels, and understand your business’s profitability more accurately. The ending inventory value is crucial for your balance sheet.

Key Factors That Affect FIFO COGS Results

Several factors can influence the calculated Cost of Goods Sold (COGS) when using the FIFO method. Understanding these elements is key to accurate financial reporting and effective business management.

  1. Purchase Price Volatility: In periods of rising prices (inflation), FIFO results in a lower COGS because it uses the older, cheaper costs. In periods of falling prices (deflation), FIFO results in a higher COGS as it uses the older, more expensive costs. This directly impacts reported profitability.
  2. Volume of Purchases: The timing and quantity of inventory purchases significantly affect the cost layers available. Frequent, smaller purchases at varying prices create more complex cost assignments for ending inventory, but the FIFO principle ensures the oldest costs are expensed first.
  3. Sales Velocity and Timing: How quickly inventory is sold impacts which cost layers are expensed. Selling older inventory first means those costs are recognized sooner. The number of units sold directly determines how much of the available costs are allocated to COGS.
  4. Inventory Shrinkage and Spoilage: If units are lost due to theft, damage, or expiration (especially relevant for businesses using FIFO), the actual physical units remaining may be fewer than calculated. While FIFO assigns costs to units sold, shrinkage needs to be accounted for, often as a separate expense or adjustment to ending inventory.
  5. Accounting Period Length: The duration of the accounting period (monthly, quarterly, annually) affects the aggregation of purchases and sales. Shorter periods might reflect more immediate price changes more distinctly in COGS.
  6. Product Mix Complexity: For businesses selling diverse products with different cost structures, applying FIFO requires meticulous tracking for each item or category. Complicating factors like bundled products or components can add layers of difficulty.
  7. Returns and Allowances: Sales returns complicate COGS calculations. When a customer returns an item, the cost associated with that returned item needs to be removed from COGS and added back to inventory, typically at its original cost if possible.

Frequently Asked Questions (FAQ)

What is the main advantage of using FIFO for COGS?

In an inflationary environment (rising prices), FIFO generally results in a lower Cost of Goods Sold (COGS) and a higher ending inventory valuation. This can lead to a higher reported net income and gross profit, which might be favorable for financial reporting and investor relations. It also aligns well with the physical flow of goods for businesses selling perishable or time-sensitive items.

Does FIFO reflect the actual physical flow of inventory?

Not necessarily. FIFO is an accounting assumption about cost flow, not a mandate on the physical movement of inventory. While it often aligns with how businesses manage perishable goods, a business could physically sell its newest inventory first while still using the FIFO cost assumption for accounting.

When would FIFO result in a higher COGS?

FIFO results in a higher COGS than LIFO (Last-In, First-Out) only when inventory costs are falling (deflationary environment). In such a scenario, the older, higher costs are expensed first, leading to a higher COGS and a lower ending inventory value.

How do inventory write-downs affect FIFO COGS?

If inventory is impaired (e.g., becomes obsolete or its market value falls below cost), a write-down is necessary. This write-down reduces the carrying value of the inventory on the balance sheet. For FIFO, the write-down typically applies to the oldest inventory that is deemed impaired, effectively reducing its cost.

Can I switch between FIFO and LIFO methods?

Companies can choose an inventory costing method, but once chosen, switching requires approval from accounting authorities (like the IRS in the US) and must be justified by a change in business operations or accounting principles. It’s not a decision made lightly due to the impact on financial statements.

What is the relationship between FIFO COGS and Gross Profit?

Gross Profit is calculated as Revenue minus COGS. Therefore, the COGS figure directly impacts Gross Profit. Using FIFO, a lower COGS (in inflation) leads to a higher Gross Profit, assuming revenue remains constant.

How does FIFO impact taxes?

In an inflationary environment, FIFO generally results in lower COGS and higher taxable income, leading to a higher tax liability in the current period. Conversely, in a deflationary environment, FIFO would lead to higher COGS, lower taxable income, and lower current tax liability compared to LIFO.

Is FIFO suitable for all businesses?

FIFO is particularly suitable for businesses dealing with perishable goods, technological items prone to obsolescence, or where inventory turnover is rapid. For businesses in highly volatile price environments or those prioritizing tax deferral during inflation, other methods might be considered, though FIFO is widely accepted and understood.



// in the or before the closing tag.
// For strict single-file requirement, it's better to embed it if possible, or note the dependency.
// Given the prompt, we proceed assuming Chart is available.

// Add a placeholder script tag if Chart.js is not included inline.
// If you need to make this truly self-contained without external JS,
// you'd need to write a pure SVG or Canvas implementation without Chart.js.
// For this exercise, Chart.js is used for demonstration of dynamic charts.
// If Chart.js is not available, the chart will fail to render.



Leave a Reply

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