Cost of goods sold (COGS)
Cost of goods sold (COGS) is what it cost you to buy or make the products you sold in a period.
By Berend Vrakking, founder of Product Metrics. Updated 7 October 2026.
Formula
COGS = opening stock + purchases − closing stock
Only the stock you sold counts. IRS Publication 334, a US example, also lists costs such as freight-in and direct labour; what counts as COGS depends on your accounting rules.
Example
| Step | Value |
|---|---|
| Opening stock | €10,000.00 |
| Purchases in the month | €25,000.00 |
| Available to sell (€10,000.00 + €25,000.00) | €35,000.00 |
| Closing stock | €12,000.00 |
| COGS (€35,000.00 − €12,000.00) | €23,000.00 |
The month’s sales cost €23,000.00 to buy. The €12,000.00 still on the shelf waits its turn. Illustrative data.
For one product, and for an account
Per product, COGS is what you paid for the units you sold: 100 units at €45.00 each is €4,500.00 (illustrative data). Add every product together and you get the shop’s COGS, a large total that says nothing about which product earns its ad spend.
Per-product COGS is the starting point for margin data. Subtract it from the price for gross margin, then subtract shipping, payment fees and returns for contribution margin. Connect those margins and Product Metrics moves from ROAS to POAS.
Common mistake
Counting everything you bought as COGS. Unsold stock is still an asset, so the month you stock up for winter looks like a bad month for profit when it was only a busy month for buying.
Questions
How do you calculate COGS?
Is COGS an income or an expense?
Does COGS include ad spend?
Keep reading
- Gross marginRevenue minus COGS, as a percentage of revenue.
- Contribution marginThe margin after COGS and the other variable costs.
- Break-even ROAS per productStart from each product’s cost of goods.
- Break-even ROAS calculatorFind the return each product needs to break even.
- Markup and margin calculatorWork out margin, markup and selling price from cost.