The direct costs of delivering your product or service
Cost of Goods Sold (COGS) represents the direct costs of producing or delivering the goods or services a company sells. These are the costs that vary directly with the volume of products or services delivered to customers.
COGS is a critical metric because it determines gross profit and gross margin—key indicators of a company's fundamental economics.
Gross Profit = Revenue - COGS
Gross Margin % = (Revenue - COGS) ÷ Revenue × 100%
Example: $1M revenue - $300K COGS = $700K gross profit (70% gross margin)
The key principle: COGS only includes costs directly tied to delivering the product or service. If a cost scales with customer volume, it's likely COGS.
These are Operating Expenses (OpEx), not COGS:
For SaaS companies, cloud infrastructure is directly required to deliver the service to customers. If you have zero customers, you need minimal infrastructure. As customers grow, infrastructure costs grow proportionally.
This is a hypothetical, illustrative example for teaching purposes, not an actual case study.
| Cost Category | Monthly Cost | Classification |
|---|---|---|
| Production Azure VMs (serving customers) | $80,000 | COGS |
| Production databases (Azure SQL) | $45,000 | COGS |
| Storage & CDN (customer data) | $15,000 | COGS |
| Monitoring & security (prod environments) | $10,000 | COGS |
| Subtotal - Production Infrastructure: | $150,000 | COGS |
| Operating Expenses (R&D): | ||
| Dev/Test environments | $30,000 | R&D OpEx |
| Engineering team salaries ($150K × 20 engineers) | $250,000 | R&D OpEx |
| Development tools (GitHub, IDEs, etc.) | $5,000 | R&D OpEx |
Key Distinction: Production infrastructure = COGS (required to deliver service). Development infrastructure & engineers building features = R&D OpEx (improving the product, not delivering it).
Gross Margin Calculation:
A 75% gross margin is excellent for SaaS. If you classified dev environments in COGS, you'd show 70% margin—still good, but not as strong. Proper classification matters for valuation.
75-85%
Typical Gross Margin
COGS Includes: Cloud infrastructure, third-party APIs, payment processing, customer-facing support
Low COGS = high margins. Software scales beautifully.
25-50%
Typical Gross Margin
COGS Includes: Product inventory costs, fulfillment, shipping, packaging, payment processing
Physical goods = higher COGS, lower margins than pure software.
30-60%
Typical Gross Margin
COGS Includes: Raw materials, direct labor, factory overhead, equipment depreciation, shipping
Heavy physical production = significant COGS.
40-60%
Typical Gross Margin
COGS Includes: Billable consultant time, subcontractors, project-specific expenses
People-based delivery = COGS tied to labor hours.
As a cloud engineer, you have direct control over the largest component of COGS for SaaS companies: infrastructure costs.
This is a hypothetical, illustrative example for teaching purposes, not an actual case study.
Scenario: Your optimization work reduces production Azure costs by 20% ($30K/month savings on $150K spend)
Understanding COGS transforms how you think about your work:
Career Insight: Cloud engineers who understand COGS and can articulate their impact on gross margin become strategic business partners, not just technical resources. This understanding opens doors to architecture leadership, FinOps roles, and executive conversations.
Continue your learning journey