FIFO Inventory Calculator — Cost of Goods Sold
Apply the FIFO (First In, First Out) method to calculate COGS and ending inventory value. Enter up to three purchase lots with quantities and unit costs, then specify units sold to see the exact cost allocation with step-by-step workings.
units
units
units
units
Cost assigned to units sold using FIFO — oldest costs consumed first
Lot 1: use 100 of 100 units @ $10/unit
Lot 2: use 100 of 150 units @ $12/unit
Total COGS (cost of goods sold)
How does this calculator work?
FIFO assigns the cost of the oldest purchase lots to COGS first. COGS = sum of (units from each lot × that lot's unit cost), oldest lot first. Ending inventory = total inventory cost − COGS. In a rising-cost environment FIFO results in lower COGS and higher profit than LIFO.
Formula
How this is calculated
Under FIFO (First In, First Out), the cost of the oldest inventory purchased is assumed to be the cost of the first units sold. When units from an older lot are fully consumed, sales then draw from the next-oldest lot. The steps in this calculator show exactly how many units come from each lot and at what cost, making the allocation transparent.
FIFO is one of three main inventory costing methods alongside LIFO (Last In, First Out) and weighted-average cost. Each produces different COGS and ending inventory figures when unit costs change over time. In a rising-cost environment, FIFO produces a lower COGS (older, cheaper costs flow through first) and a higher ending inventory value — raising reported gross profit. LIFO has the opposite effect. LIFO is not permitted under IFRS (used in most countries outside the US), while FIFO is accepted under both IFRS and US GAAP.
EndingInventory = TotalInventoryCost − COGS. This must balance: the sum of COGS and ending inventory always equals the total cost of all goods available for sale. This calculator supports up to three purchase lots, which is sufficient for most exam problems and many small-business scenarios. Real accounting systems track individual or batch-level costs across many more lots.
Frequently asked questions
FIFO assigns the older (lower) costs to COGS first and retains the newer (higher) costs in ending inventory. Because COGS is lower, gross profit is higher. LIFO does the reverse — newer, higher costs flow to COGS, reducing gross profit and taxable income. This is why many US companies preferred LIFO for tax purposes (it is disallowed under IFRS).
FIFO is an accepted method under both US GAAP and IFRS. In the US, you must consistently apply the same method; switching requires IRS approval (Form 3115). Your choice of inventory method affects taxable income, so consulting a tax advisor before choosing or changing methods is advisable.
Weighted-average cost assigns a single blended cost per unit — total goods available ÷ total units — to all sales. FIFO tracks the specific cost layer of each purchase lot. Weighted-average smooths out price fluctuations; FIFO better matches physical flow for perishable goods (which genuinely sell oldest-first). This calculator shows the weighted-average cost alongside the FIFO result for comparison.
Also known as
TG we-Calculate Editorial Team. (2026). FIFO Inventory Calculator — Cost of Goods Sold [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/fifo-for-inventories-calculator
TG we-Calculate Editorial Team. "FIFO Inventory Calculator — Cost of Goods Sold." TG we-Calculate. 2026. https://we-calculate.com/calculator/fifo-for-inventories-calculator.
TG we-Calculate Editorial Team, "FIFO Inventory Calculator — Cost of Goods Sold," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/fifo-for-inventories-calculator
@misc{wecalculate_fifo_for_inventories_calculator, title = {FIFO Inventory Calculator — Cost of Goods Sold}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/fifo-for-inventories-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
