Cost of goods sold (COGS)

COGS is the direct cost of the products you actually sold. Get it right and your gross profit and margin fall out correctly — get it wrong and every downstream number is off.

The COGS formula

For a business that carries inventory, cost of goods sold over a period is:

COGS = Beginning inventory + Purchases − Ending inventory

The logic: take everything you started with, add what you bought, then subtract what’s still on the shelf. What’s left is the cost of what actually left the door. If you don’t track inventory — many makers and service sellers don’t — your COGS is simply the direct cost of the units sold: materials plus the direct labour to produce them.

A worked example

What’s in — and what’s out

Included in COGS

  • Raw materials
  • Wholesale cost of stock
  • Direct labour to make the product
  • Inbound freight / import duties
  • Packaging that’s part of the product

Not in COGS

  • Advertising & marketing
  • Office rent & admin salaries
  • Shipping to the customer
  • Software & subscriptions
  • Sales commissions

The line between COGS and operating expenses is exactly what separates gross profit from net profit.

Why COGS matters for pricing

COGS is the number you build your price on top of. Once you know the true direct cost of a unit, use the profit margin calculator to set a price that hits your target margin, and see how to calculate profit margin for the full picture.

Frequently asked questions

What is the cost of goods sold formula?

COGS = beginning inventory + purchases during the period − ending inventory. This captures the cost of only the goods you actually sold, not everything you bought or made. For a maker without inventory tracking, COGS is simply the direct cost of the units sold (materials + direct labour).

What is included in COGS?

COGS includes the direct costs of producing or buying the goods you sold: raw materials, the wholesale cost of stock, direct labour to make the product, and inbound freight. It excludes indirect costs like marketing, office rent, admin salaries and distribution.

What is not included in COGS?

Operating expenses are not part of COGS: advertising, sales commissions, office rent, general salaries, software, and shipping to the customer (that's usually a selling expense). These sit below gross profit on the income statement and reduce net profit instead.

How does COGS affect profit margin?

COGS is the cost subtracted to get gross profit, so it directly sets your gross margin: gross margin = (revenue − COGS) ÷ revenue. Lower COGS means higher gross margin. It's the single biggest lever on product profitability for most sellers.

Is COGS the same as cost price?

For a single unit, COGS is essentially the direct cost price of that unit. As a total for a period, COGS is the combined direct cost of all units sold in that period. The idea is the same — the direct cost of the goods — just at different scales.