What is cost of goods sold?
Cost of goods sold is the total of the costs that exist only because a sale was made: the materials, labour and delivery that go into each unit. It is the first cost subtracted from revenue on the income statement, and the result is gross profit.
The test for whether something is COGS: if you sold nothing, would this cost disappear? Product you bought to resell would. The marketing manager's salary would not.
COGS formula
For a business that holds stock, the formula is:
COGS = opening inventory + purchases during the period - closing inventory
This counts only the stock that left the shelves. Stock bought but not yet sold stays on the balance sheet as an asset and becomes COGS when it sells.
For a business with no stock, such as software or services, COGS is simply the sum of the direct delivery costs for the period. Software companies often call it cost of revenue.
What is included in COGS?
| Business | Included | Not included |
|---|---|---|
| Retail and ecommerce | Product cost, freight in, packaging | Advertising, store rent, head office staff |
| Manufacturing | Raw materials, production wages, factory overhead | Sales team, research and development |
| Software | Hosting, third-party tools inside the product, customer support, payment processing | Engineers building new features, sales and marketing |
| Agencies and services | Pay for the people doing client work, subcontractors | Account managers selling new work, office costs |
The line between COGS and operating expenses involves judgment, and companies draw it differently. What matters is drawing it the same way every period, so the trend in gross margin means something.
Why COGS matters
COGS decides gross margin, and gross margin decides how much a company can afford to spend to win a customer. Two companies with the same revenue and very different COGS are not the same size of business in any useful sense.
COGS also affects tax, because it reduces taxable profit. The rules on what may be included and how inventory is valued are set by tax authorities, so follow your accountant's method, not a blog's.