---
title: "What is COGS? Formula and example | Product Metrics"
description: "COGS (cost of goods sold) is what the products you sold cost you to buy or make. See the formula, a worked example and how it feeds your margins."
canonical: "https://www.productmetrics.io/glossary/cost-of-goods-sold"
pageType: article
language: en
publisher: "Product Metrics"
author: "Berend Vrakking"
datePublished: 2026-10-07
dateModified: 2026-10-07
---

> Content index: https://www.productmetrics.io/llms.txt

# 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.

## 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

A month of buying and selling:

| 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?

Add your purchases to your opening stock, then subtract your closing stock. With €10,000.00 opening stock, €25,000.00 of purchases and €12,000.00 closing stock, COGS is €23,000.00.

### Is COGS an income or an expense?

An expense. IRS Publication 334 subtracts it from sales to reach gross profit.

### Does COGS include ad spend?

Usually not. Ad spend, shipping to customers and payment fees sit outside COGS, which is why contribution margin takes them off separately.

## Sources

- [IRS Publication 334: Tax Guide for Small Business (a US example)](https://www.irs.gov/publications/p334)

## Keep reading

- [Gross margin](https://www.productmetrics.io/glossary/gross-margin): Revenue minus COGS, as a percentage of revenue.
- [Contribution margin](https://www.productmetrics.io/glossary/contribution-margin): The margin after COGS and the other variable costs.
- [Break-even ROAS per product](https://www.productmetrics.io/blog/break-even-roas-per-product): Start from each product’s cost of goods.
- [Break-even ROAS calculator](https://www.productmetrics.io/break-even-roas-calculator): Find the return each product needs to break even.
- [Markup and margin calculator](https://www.productmetrics.io/margin-calculator): Work out margin, markup and selling price from cost.

---

Written by Berend Vrakking, founder of Product Metrics. Last updated 2026-10-07.

HTML version: https://www.productmetrics.io/glossary/cost-of-goods-sold
