Cost of goods sold (COGS) calculator
Work out COGS from opening inventory, purchases and closing inventory, and optionally gross profit.
Formula
How it works
Goods available for sale are the opening inventory plus purchases; whatever is left at the end is not yet sold, so COGS is the difference. Enter sales revenue to see gross profit and margin too.
Worked example
The same calculation with the default values:
- Beginning inventory 20,000
- Purchases during the period 55,000
- Ending inventory 18,000
- Sales revenue (optional) 0
- COGS = 20,000 + 55,000 − 18,000 = 57,000
Result: Cost of goods sold: 57,000.00 USD
Common mistakes
- Using purchase price alone for "purchases" without including freight-in and other costs needed to get inventory ready for sale, which belong in COGS under most accounting standards.
- Mixing up beginning and ending inventory - swapping them flips the sign of the inventory change and produces a nonsensical COGS figure.
- Confusing COGS with total operating expenses - COGS is only the direct cost of the goods sold, not rent, marketing, or administrative costs (see the net-profit calculator for those).
Related calculators
Break-even calculator
Find how many units you must sell to cover your fixed costs, and how many to reach a profit target.
Budget variance calculator
Compare actual with budget and see whether the variance is favourable or unfavourable.
Cash flow projection
Project month-by-month cash balance from inflows, outflows and growth rates.
Contribution margin calculator
Find how much each sale contributes towards fixed costs and profit.