FIFO Method Calculator: Calculate Cost of Goods Sold


FIFO Method Calculator

A smart tool to calculate Cost of Goods Sold (COGS) and ending inventory using the First-In, First-Out method.

1. Inventory Purchases

Enter each batch of inventory you purchased, starting with the oldest.


Units Purchased Cost per Unit ($) Action


2. Inventory Sales



Enter the total number of units sold during the period.

What is the FIFO Method?

The First-In, First-Out (FIFO) method is an inventory valuation principle where it is assumed that the first goods purchased are the first ones to be sold. Essentially, the oldest inventory items are recorded as sold first. This method is widely used in accounting to calculate the Cost of Goods Sold (COGS) and the value of the remaining inventory.

This approach aligns with the logical flow of many businesses, especially those dealing with perishable goods or products with a limited shelf life, like food or electronics, where selling older stock first is a business necessity to prevent spoilage or obsolescence. Even if a company’s physical inventory flow doesn’t strictly follow FIFO, it can still use this method for accounting purposes.

The FIFO Method Formula and Explanation

There isn’t a single, simple formula for the FIFO method; rather, it’s a process of assigning costs. The core idea is to match the cost of your oldest inventory with the revenue from sales until that batch is depleted, then move to the next oldest batch. The process to calculate using FIFO method is as follows:

  1. List all inventory purchases in chronological order (oldest first).
  2. Determine the total number of units sold in the period.
  3. Assign the cost of the oldest batch of inventory to the units sold until the batch is exhausted.
  4. If more units were sold than were in the first batch, move to the second-oldest batch and continue assigning its cost.
  5. Repeat this until the cost for all sold units has been determined. This total is your COGS.
  6. The cost of the remaining, unsold units constitutes your ending inventory value.
FIFO Calculation Variables
Variable Meaning Unit Typical Range
Units Purchased The quantity of items in a single purchase batch. Items, pieces, kg, etc. Positive numbers
Cost per Unit The price paid for a single item in that batch. Currency (e.g., USD, EUR) Positive numbers
Units Sold The total quantity of items sold during the accounting period. Items, pieces, kg, etc. Positive numbers

Practical Examples of FIFO Calculation

Example 1: Simple Scenario

Imagine a bookstore purchases books in two batches:

  • Purchase 1: 50 books at $10 each
  • Purchase 2: 100 books at $12 each

In the month, they sell 70 books. Using the FIFO method:

  • The first 50 books sold are costed at $10 (from the first batch). Cost = 50 * $10 = $500.
  • The remaining 20 books sold are costed at $12 (from the second batch). Cost = 20 * $12 = $240.
  • Total COGS = $500 + $240 = $740.
  • Ending Inventory: 80 books (100 – 20) remain from the second batch. Value = 80 * $12 = $960.

Example 2: Rising Prices (Inflation)

A coffee shop has the following inventory of coffee beans:

  • Jan 1: 20 kg at $20/kg
  • Jan 15: 30 kg at $22/kg
  • Jan 28: 25 kg at $25/kg

The shop sells 45 kg of coffee in January. Here’s how to calculate the COGS:

  • Sell the first 20 kg from Jan 1 purchase. Cost = 20 * $20 = $400.
  • Sell the next 25 kg from the Jan 15 purchase (45 sold – 20 from first batch). Cost = 25 * $22 = $550.
  • Total COGS = $400 + $550 = $950.
  • Ending Inventory: 5 kg left from Jan 15 batch (30-25) and all 25 kg from Jan 28 batch. Value = (5 * $22) + (25 * $25) = $110 + $625 = $735. You can find more details about inventory management with a Weighted-Average Cost Calculator.

How to Use This FIFO Method Calculator

Our tool simplifies the process to calculate using FIFO method. Follow these steps for an accurate result:

  1. Add Purchase Lots: In the “Inventory Purchases” section, click “Add Purchase Lot” for each batch of inventory you acquired. Enter the number of units and the cost per unit for each one. Make sure you enter them chronologically, with the oldest purchase first.
  2. Enter Units Sold: In the “Inventory Sales” section, input the total number of units sold during the period you are analyzing.
  3. Calculate: Click the “Calculate” button.
  4. Interpret Results: The tool will instantly display the total Cost of Goods Sold (COGS) as the primary result. You can also view intermediate values like the ending inventory value, total units remaining, and a detailed breakdown of which purchase lots were used for the calculation. The visual chart helps compare the value of goods sold against the value of inventory you still hold.

Key Factors That Affect FIFO Calculation

Several factors can influence the outcome of your FIFO calculations and its relevance to your business’s financial statements. Understanding them helps in better inventory management and financial planning. To learn more, consider exploring a Inventory Turnover Ratio calculator.

Inflation/Deflation
In a period of rising prices (inflation), FIFO results in a lower COGS and a higher net income because cheaper, older costs are matched against current revenues. The opposite occurs during deflation.
Purchase Timing and Volume
The frequency and size of your inventory purchases directly create the cost layers that the FIFO method uses. Bulk purchases may secure lower prices, affecting the cost of that inventory layer.
Inventory Holding Period
The longer you hold inventory, the more likely its cost will differ significantly from the current replacement cost, making the FIFO calculation particularly important for income statements.
Product Perishability
For businesses with perishable goods, the FIFO method of accounting often mirrors the actual physical flow of inventory, making it a very intuitive choice.
Record-Keeping Accuracy
Accurate and chronological records of all purchases are critical. An error in quantity or cost for any batch will lead to incorrect COGS and ending inventory values.
Market Demand Fluctuations
Sudden spikes in sales can cause a business to burn through several layers of inventory quickly, each with a different cost, which will be reflected in the COGS calculation for that period.

Frequently Asked Questions (FAQ)

1. What does FIFO stand for?
FIFO stands for “First-In, First-Out,” an inventory accounting method that assumes the first items placed in inventory are the first ones sold.

2. Why is FIFO important for businesses?
It provides a logical and consistent way to value inventory and calculate the Cost of Goods Sold (COGS). This is crucial for accurate financial statements, tax reporting, and understanding profitability. In times of inflation, it typically results in a higher reported net income. For further analysis, you may want to use a gross profit margin calculator.

3. How does FIFO compare to the LIFO method?
LIFO (Last-In, First-Out) is the opposite; it assumes the most recently purchased items are sold first. During periods of rising prices, LIFO results in a higher COGS and lower net income compared to FIFO. Explore this with a LIFO Calculator.

4. Does this calculator handle multiple sales periods?
This calculator is designed to calculate COGS for a single defined sales period. To calculate for a new period, you would “Reset” and enter the remaining inventory from the previous period as your new first batch.

5. What happens if I sell more units than I have in inventory?
Our calculator will show an error message. In a real-world scenario, selling more inventory than you have recorded is impossible and points to an inventory tracking or data entry error.

6. Is the FIFO method good for tax purposes?
It can be. During inflation, FIFO leads to higher taxable income because COGS is lower. While this means a higher tax bill, it also presents a stronger financial picture to investors and lenders. The best method depends on a company’s specific financial situation and goals.

7. What currency does the calculator use?
The calculator uses a generic currency symbol ($), but the logic applies to any currency. The calculation is based on the numerical values you enter, not the currency itself.

8. Can I use this calculator for cryptocurrency or stocks?
Yes, the FIFO principle is commonly used in accounting for capital gains on assets like stocks and cryptocurrency. You would treat each purchase of a specific crypto coin or stock as an “inventory purchase,” with “units” being the amount of stock/coins and “cost per unit” being the purchase price.

© 2026 Your Company. All Rights Reserved. For educational and informational purposes only.


Leave a Reply

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