FIFO Calculator for Inventory
Enter your purchase batches (quantity and unit cost) and the number of units you sold during the period. The calculator applies the First-In, First-Out rule, consuming the oldest stock first, and instantly shows your Cost of Goods Sold, ending inventory value, gross profit, and a layer-by-layer breakdown table. Up to five purchase batches are supported. Add a selling price to unlock gross profit and revenue.
What is the FIFO method?
FIFO stands for First-In, First-Out. Under this inventory valuation method, the cost assigned to the first items you bought is the cost assigned to the first items you sell. In other words, the oldest inventory on hand is always assumed to leave the warehouse first, regardless of which physical units actually shipped. FIFO is the most widely used inventory costing method worldwide and is accepted under both US GAAP and IFRS. Perishable goods businesses such as grocery stores, pharmacies, and food manufacturers often follow FIFO in their physical operations as well as their accounting.
How this FIFO calculator works
Enter up to five purchase batches in chronological order, oldest first. For each active batch provide the number of units purchased and the cost per unit. Then enter how many units were sold during the period. The calculator applies FIFO layer by layer: sales are charged against Batch 1 until it is exhausted, then Batch 2, and so on. The FIFO Layer-by-Layer Breakdown table shows exactly how many units were consumed from each batch, what that cost, and how many units remain. If you enter a selling price per unit, the tool also calculates total revenue, gross profit, and gross margin so you can assess period profitability.
FIFO COGS formula and worked example
FIFO COGS = sum of (units consumed from each batch x that batch unit cost). For example, suppose you bought 100 units at $10 (Batch 1) and 80 units at $12 (Batch 2), then sold 120 units. FIFO consumes all 100 units from Batch 1 ($10 x 100 = $1,000) and 20 units from Batch 2 ($12 x 20 = $240), giving COGS of $1,240. Ending inventory is 60 units from Batch 2 at $12 = $720. If the selling price is $18 per unit, revenue is $2,160, gross profit is $920, and gross margin is 42.6%.
FIFO vs LIFO and average cost: which to choose?
FIFO typically produces a higher ending inventory value and lower COGS during periods of rising prices because cheaper, older costs flow through the income statement first. That means higher reported gross profit and, consequently, higher income tax in rising-price environments. LIFO (Last-In, First-Out) does the opposite and reduces taxable income during inflation, but it is not permitted under IFRS and is only available under US GAAP. The Weighted Average Cost method smooths price fluctuations by blending all purchase costs. FIFO is the default choice for businesses that sell perishable goods, operate under IFRS, or want their balance sheet to reflect current market values.
FIFO and financial reporting
Under FIFO, ending inventory on the balance sheet reflects the most recent (and usually highest) purchase prices, which approximates current replacement cost better than LIFO does. On the income statement, COGS reflects the older (and often lower) costs, so gross profit tends to be higher. This can be advantageous for securing financing or meeting investor expectations, but it can also mean a higher current-period tax bill. Accountants and auditors appreciate FIFO because it matches the physical flow of goods in most industries and is straightforward to audit.
Inventory Valuation Methods Compared
| Method | Rising Prices: COGS | Rising Prices: Ending Inventory | Tax Impact | Allowed Under IFRS |
|---|---|---|---|---|
| FIFO | Lower (oldest, cheaper cost) | Higher (recent, higher cost) | Higher taxable income | Yes |
| LIFO | Higher (newest, higher cost) | Lower (old, cheaper cost) | Lower taxable income | No |
| Weighted Avg. Cost | Blended average | Blended average | Middle ground | Yes |
| Specific Identification | Exact cost of items sold | Exact cost of items held | Varies | Yes |
How FIFO, LIFO, and Weighted Average Cost treat ending inventory and COGS across rising and falling price environments.
Frequently asked questions
What does FIFO stand for in inventory?
FIFO stands for First-In, First-Out. It is an inventory costing assumption under which the oldest units purchased are considered to be the first ones sold. This means the cost of the earliest inventory batches flows through Cost of Goods Sold first, and the most recently purchased units remain in ending inventory.
How do I calculate COGS using FIFO?
List your purchase batches in chronological order with the quantity and unit cost of each. Then take your total units sold and allocate them to the oldest batch first. Multiply the units consumed from each batch by that batch cost, then add the results together. For example: 100 units at $10 and 80 units at $12, with 120 units sold - COGS = (100 x $10) + (20 x $12) = $1,240.
What is ending inventory under FIFO?
Ending inventory under FIFO is the value of units not yet sold, calculated at the most recent purchase prices. After sales are allocated oldest-first, any units left over carry their original batch cost. Because newer (usually higher-priced) batches are the ones most likely to remain, FIFO ending inventory tends to reflect current market values more closely than LIFO.
Does FIFO always give a higher gross profit than LIFO?
During periods of rising prices, yes - FIFO assigns the lower older costs to COGS, leaving higher costs in inventory, which results in a higher gross profit compared to LIFO. During periods of falling prices the relationship reverses: FIFO then produces a higher COGS and lower gross profit. In stable-price environments the two methods converge.
Is FIFO required by GAAP or IFRS?
FIFO is permitted under both US GAAP and IFRS. LIFO is permitted under US GAAP but prohibited under IFRS. Businesses in countries that follow IFRS (most of the world outside the US) can choose FIFO or Weighted Average Cost but cannot use LIFO. FIFO is generally the simpler, more internationally accepted choice.
What is the difference between FIFO and Weighted Average Cost?
FIFO uses the specific costs of individual purchase batches in order, oldest first. Weighted Average Cost divides the total cost of all available inventory by the total units available, producing a single blended cost per unit applied equally to all units sold. FIFO better matches physical goods flow and balance-sheet values to current prices; Weighted Average is simpler to apply when many small batches arrive frequently.
Can I use FIFO for tax purposes in the US?
Yes. The IRS allows FIFO as a permissible inventory costing method. Because FIFO typically produces a higher ending inventory value and lower COGS in a rising-price environment, it generally results in higher taxable income compared to LIFO. Some US businesses choose LIFO for tax deferral, but LIFO requires IRS approval and comes with complex rules. FIFO has no such restrictions.