MB Calculator
Finance May 13, 2026 20 views

FIFO Calculator: Calculate Cost of Goods Sold & Ending Inventory (Step-by-Step)

Use our FIFO Calculator to calculate Cost of Goods Sold (COGS) and ending inventory instantly. Includes formulas, examples, FIFO vs LIFO comparison, and more.

Calculator Tool

Interactive Tool
Inventories bought
•••
•••
•••
•••
•••
•••
Units sold
•••
•••

Quick Result Guide

Enter purchase prices, purchased units, total units sold, and selling price. This calculator uses FIFO, so the oldest inventory is sold first.

Status Waiting
Inventory value -
Inventory remaining value -
Cost of goods sold (COGS) -
Revenues -
Enter values to calculate profit/loss and gross margin.

Method & Formulas

FIFO Method

FIFO means First In, First Out. The units purchased first are treated as sold first.

Inventory Value

Inventory value = Sum of all purchased units × their purchase price

Cost of Goods Sold

COGS = Units sold from 1st batch × 1st price + units sold from 2nd batch × 2nd price + units sold from 3rd batch × 3rd price

Revenue

Revenue = Total units sold × Selling price

Profit or Loss

Profit/Loss = Revenue − COGS

Gross Margin

Gross margin = Profit ÷ Revenue × 100

FIFO Calculator: Calculate COGS & Ending Inventory