Metric Definition
COGS
Cost of goods sold
Cost of goods sold (COGS) represents the direct costs attributable to producing the goods or delivering the services that a company sells. It is the single largest determinant of gross margin and a critical input to pricing and profitability analysis.
7 min read
What is COGS?
Cost of goods sold is the total direct cost of producing or delivering the products and services a company sells. For a manufacturer, COGS includes raw materials, direct labour, and factory overhead. For a retailer, it includes the purchase price of inventory. For a SaaS company, it includes hosting costs, third-party service fees, and the cost of customer support.
COGS is deducted from revenue to calculate gross profit. This makes it the first and most important cost layer in the income statement. A company that cannot manage its COGS effectively will have thin gross margins that limit its ability to invest in growth, regardless of how efficiently it manages operating expenses.
The distinction between COGS and operating expenses matters for analysis. COGS should include only the costs that scale directly with revenue or are directly required to deliver the product. Sales salaries, marketing spend, and R&D are operating expenses, not COGS, even though they are essential to the business. Misclassifying costs between COGS and operating expenses distorts both gross margin and operating margin, making it harder to diagnose performance issues.
How to calculate COGS
For product businesses:
COGS = Beginning Inventory + Purchases - Ending Inventory
For SaaS and service businesses, COGS is typically calculated differently because there is no physical inventory:
COGS = Hosting and Infrastructure + Customer Support Labour + Third-party API Costs + Payment Processing Fees
Gross margin then follows:
Gross Margin = (Revenue - COGS) / Revenue x 100
| Business type | COGS typically includes | COGS typically excludes |
|---|---|---|
| SaaS | Hosting, support staff, third-party APIs, payment processing | Sales, marketing, R&D, G&A |
| E-commerce | Product cost, shipping, packaging, warehouse labour | Marketing, technology, corporate overhead |
| Manufacturing | Raw materials, direct labour, factory overhead | Sales, marketing, R&D, administrative |
| Professional services | Billable staff costs, project materials, subcontractors | Business development, unbillable time, overhead |
COGS in a metric tree
The tree reveals the cost structure behind gross margin. For SaaS companies, infrastructure costs are often the most scalable (they can grow sub-linearly with revenue through better architecture and vendor negotiation), while service delivery costs are the most challenging to scale because they require human labour. Companies that automate support and reduce the need for hands-on customer success can improve gross margins significantly as they scale.
COGS and gross margin benchmarks
| Business type | Typical COGS as % of revenue | Target gross margin |
|---|---|---|
| SaaS | 15-30% | 70-85% |
| E-commerce | 40-70% | 30-60% |
| Manufacturing | 50-70% | 30-50% |
| Professional services | 40-60% | 40-60% |
| Marketplace | 10-20% | 80-90% (on take rate) |
For SaaS companies, a gross margin below 70% is a red flag that suggests either heavy infrastructure costs, excessive support burden, or misclassified operating expenses. Best-in-class SaaS companies achieve 80-85% gross margin through efficient infrastructure, self-serve support, and automation of delivery processes. This is a key input to the Rule of 40 calculation.
How to reduce COGS
- 1
Optimise infrastructure spend
Implement reserved instances, auto-scaling, and architecture optimisations. Renegotiate cloud contracts as you scale. Infrastructure costs should grow sub-linearly with revenue.
- 2
Automate customer support
Self-serve knowledge bases, chatbots, and in-app help reduce the need for human support agents. Each support ticket avoided is a direct COGS reduction.
- 3
Renegotiate third-party contracts
As your volume grows, you gain leverage with API providers, payment processors, and data vendors. Renegotiate annually based on volume commitments.
- 4
Shift from professional services to product
If customers require significant implementation or customisation, build these capabilities into the product. This shifts costs from high-COGS services to low-COGS software.
Common mistakes
- 1
Including R&D in COGS
R&D costs are operating expenses, not COGS. Including them in COGS artificially deflates gross margin and inflates operating margin, making comparisons misleading.
- 2
Excluding support costs from COGS
Customer support that is required to deliver the service should be in COGS. Excluding it inflates gross margin and understates the true cost of serving customers.
- 3
Not tracking COGS per customer
Knowing total COGS is useful, but understanding COGS per customer reveals which customer segments are expensive to serve and which generate the highest gross margins.
Related metrics
Gross Profit
Revenue minus cost of goods sold
Financial MetricsMetric Definition
Gross Profit = Revenue - Cost of Goods Sold (COGS)
Gross profit is the revenue remaining after deducting the direct costs of producing goods or delivering services. It represents the profit available to cover operating expenses, debt service, and generate net income.
Gross Margin
Metric Definition
Gross margin expresses COGS efficiency as a percentage of revenue.
Operating Margin
Core business profitability
Financial MetricsMetric Definition
Operating Margin = (Operating Income / Revenue) x 100
Operating margin measures the percentage of revenue that remains after paying for both cost of goods sold and operating expenses. It isolates the profitability of core business operations, excluding the effects of financing decisions and tax strategies.
Decompose COGS and improve gross margin
Build a metric tree that breaks down cost of goods sold into infrastructure, service delivery, and third-party components to identify the highest-impact margin improvement opportunities.