Overview

Cost of goods sold, COGS, is what the items you actually sold cost you. This works it out from your inventory counts and purchases, and adds gross profit and margin.

Enter your beginning inventory, purchases, ending inventory and revenue for the period.

Worked examples

InputsResult
Beginning inventory ($)20,000Purchases ($)50,000Ending inventory ($)15,000Revenue ($)100,000Cost of goods sold: $55,000Gross profit: $45,000Gross margin: 45%
Show 2 more examples
Beginning inventory ($)5,000Purchases ($)12,000Ending inventory ($)4,000Revenue ($)25,000Cost of goods sold: $13,000Gross profit: $12,000Gross margin: 48%
Beginning inventory ($)100,000Purchases ($)300,000Ending inventory ($)120,000Revenue ($)500,000Cost of goods sold: $280,000Gross profit: $220,000Gross margin: 44%

Cost of goods sold by purchases

With the calculator's starting values, the cost of goods sold is $55,000. The table shows how it changes with the purchases.

Purchases ($)Cost of goods sold
$30,000$35,000
$40,000$45,000
$50,000starting value$55,000
$60,000$65,000
$70,000$75,000

Other inputs: Beginning inventory: $20,000 · Ending inventory: $15,000 · Revenue: $100,000. Change them in the calculator above for your own numbers.

How it works

You start with beginning inventory, add what you bought, and subtract what is left. What remains must have been sold, or lost. COGS appears on the income statement, and subtracting it from revenue gives gross profit.

The formula

COGS = beginning inventory + purchases − ending inventory
Gross margin(Revenue − COGS) ÷ revenue

Practical tips

  • $20,000 + $50,000 − $15,000 gives a COGS of $55,000.
  • Count stock on the same date each period for consistent figures.
  • Include freight costs on purchases, but not selling or admin costs.

Frequently asked questions

Do services have COGS?

Service firms often report “cost of revenue”, such as direct labor, in its place.

Why does the inventory method matter?

FIFO and LIFO value stock differently, so they can change COGS when prices move.