If you’re building a SaaS company at $5M–$15M ARR, one of the highest-leverage metrics you can master is SaaS COGS (Cost of Goods Sold). Get it right, and you unlock 5–7 percentage points of additional gross margin. Get it wrong, and you’ll pitch investors on a business you think is worth 10x ARR when it’s actually worth 5x.
Here’s the problem: there is no consensus on what counts as COGS in SaaS. Most founders default to “anything related to delivering the product,” then end up classifying customer success salaries, onboarding labor, and even part of R&D as COGS. That’s a financial misstatement that compounds every valuation conversation.
This guide gives you the allocation rules, benchmarks, worked examples, and a playbook to get COGS right.
What Is SaaS COGS, and Why the Definition Matters
COGS (Cost of Goods Sold) is the cost to deliver the product to one additional customer, excluding sales, marketing, and overhead.
For a traditional manufacturer, COGS is straightforward: materials, labor, shipping. For SaaS, it’s slippery. You have no physical inventory. You have no incremental labor per customer (usually). So what counts?
The operative principle: COGS includes only costs that vary with customer count or customer usage, and are direct to delivery.
Costs that scale with revenue but serve the entire company (like R&D or executive salaries) are operating expenses, not COGS. Costs that support customer success after the technical product works (upselling, retention calls) are S&M or CS, not COGS. The distinction is critical because it separates “cost to deliver what the customer bought” from “cost to keep or expand the customer.”
SaaS COGS typically includes:
- Hosting and infrastructure (AWS, Google Cloud, Azure, Datadog)
- Third-party tools and APIs embedded in the product (Stripe, Twilio, OpenAI, Anthropic, etc.)
- Customer support and technical support (not success/account management)
- Onboarding and implementation labor (if required to activate the customer)
- DevOps, SRE, and incident response (maintaining production systems)
- Hosting/monitoring/observability tools (Datadog, New Relic, Sentry)
- Payment processing fees (Stripe, PayPal commissions)
SaaS COGS does NOT include:
- R&D / Product Development — building new features, internal tooling
- Sales & Marketing — acquisition, events, advertising, content creation
- Customer Success & Account Management — upselling, retention, strategic reviews (these are S&M expense categories)
- G&A / Executive — CEO, CFO, HR, finance, legal
- Office / Overhead — rent, utilities, insurance

The Allocation Decision Tree: Gray Areas
The list above is clean, but implementation is messy. Here are the most common gray areas and how to resolve them.
Gray Area #1: Support vs. Customer Success
The product is live. A customer has a technical question. Who should you staff — support or customer success?
- Support (COGS): “Our API authentication isn’t working in this edge case. Help.”
- Customer Success (OpEx): “How do we architect this to scale to 100K users? Let me show you the roadmap.”
Support solves for product delivery. CS solves for adoption, expansion, and retention. In practice, many teams blend these. The allocation rule: only the portion of CS labor spent on onboarding, activation, and resolving delivery blockers belongs in COGS. If your CS team spends 60% of time on activation and 40% on upselling/expansion, only 60% of their salary is COGS. The 40% goes to S&M expense.
This requires honest tracking. Most founders avoid it and lump all CS salaries into OpEx, which understates COGS and overstates gross margin. Investors who dig into your metrics will catch it, so better to classify correctly upfront.
Gray Area #2: Infrastructure — Shared vs. Per-Customer
You run a multi-tenant SaaS platform. Most infrastructure costs (compute, storage, networking) scale with total customer count, not with any one customer. Do all of these costs belong in COGS?
Yes, but with allocation logic. COGS should be total infrastructure spend ÷ number of customers. That gives you per-customer COGS. Track it separately by segment (SMB gets lower per-customer COGS in multi-tenant, enterprise may require dedicated infrastructure and higher COGS).
Gray Area #3: Onboarding and Implementation
Customer signs up. They need onboarding to go live. Is that COGS?
If onboarding is required to activate the product and unlock value, it’s COGS. If it’s optional and tactical (nice-to-have training), it’s OpEx. Most companies err toward COGS here because onboarding directly enables revenue recognition.
Gray Area #4: DevOps, SRE, and Incident Response
You have a 4‑person SRE team maintaining production uptime, responding to incidents, and improving deployment infrastructure. Is their salary COGS?
Yes. These are operational costs to keep the live product live. Their work is not building features (R&D); it’s preserving the delivery platform. Allocate 100% of SRE salaries to COGS unless they also spend time on new architecture that supports future products (then prorate).
The Gross Margin Formula and Why It’s Your Profit Engine
Gross Margin = (Revenue − COGS) / Revenue × 100%
Example: $10M ARR company with $2M COGS. Gross Margin = ($10M − $2M) / $10M = 80%.
This one number determines three things:
- Profitability Ceiling — After gross margin, you pay sales, marketing, R&D, and overhead. A company with 60% gross margin can never reach 40% EBITDA margins (the SaaS benchmark). A company with 85% gross margin has room to build.
- Unit Economics & LTV/CAC — LTV depends on gross margin. LTV = ARPA × Gross Margin % × (1 / Monthly Churn Rate). Lower COGS = higher LTV = healthier unit economics = scalable growth.
- Valuation Multiple — Investors use gross margin as a signal of product-market fit, scalability, and unit economics. A 70% gross margin business trades at 8–10x ARR. An 85%+ margin business trades at 10–15x ARR. A 50% margin business trades at 4–6x. Improving gross margin by 5 percentage points is worth $3M–$5M in exit value for a $10M ARR company.
Benchmark Data: Where You Stand
SaaS gross margin benchmarks vary by company stage and vertical, but the data is clear.
| Metric | SaaS Median | Top Quartile | Notes |
|---|---|---|---|
| Gross Margin | 73% | 85%+ | Varies by vertical; enterprise SaaS higher |
| COGS as % of Revenue | 27% | 15%–20% | Lower is better (more margin to work with) |
| Gross Margin by ARR | |||
| $1M–$5M ARR | 65–70% | 75%+ | Larger payroll drag (support/ops) |
| $5M–$25M ARR | 70–75% | 80%+ | Economies of scale emerging |
| $25M–$100M+ ARR | 75–82% | 85%+ | Infrastructure amortized; SRE scalable |
Key insight: If you’re at $10M ARR with 65% gross margin and your competitor is at 80%, they’re 2–3x better positioned to reach $100M ARR profitably. They can spend more on acquisition, product, and operations while still hitting 40% EBITDA margins.

Multi-Tenancy vs. Single-Tenancy: COGS Implications
The architecture of your product determines your COGS curve.
Multi-Tenant Architecture (most SaaS companies):
- One shared infrastructure serves many customers
- Infrastructure costs per customer decline as you add customers (amortization)
- COGS as % of revenue decreases with scale
- At 10 customers: 40% COGS. At 100 customers: 20% COGS. At 1,000 customers: 8% COGS.
Scenario #1: Multi-Tenant SaaS, $10M ARR, 200 customers
- Annual hosting cost: $1.2M (scales sublinearly)
- Annual support: $600K (scales roughly linear with customers)
- COGS: $1.8M = 18% of revenue = 82% gross margin
Single-Tenant Architecture (some enterprise SaaS, most custom software):
- Each customer gets a dedicated instance (infrastructure, data, sometimes custom code)
- Infrastructure costs scale linearly with customer count
- COGS stays high or rises as you add customers
- At 10 customers: 50% COGS. At 100 customers: 55% COGS.
Scenario #2: Single-Tenant SaaS, $10M ARR, 50 customers ($200K ACV)
- Annual hosting cost (dedicated): $2.5M (scales with customer count + data size)
- Annual implementation: $800K (one-time per customer, amortized)
- Annual support: $500K
- COGS: $3.8M = 38% of revenue = 62% gross margin
The lesson: If you’re single-tenant, your COGS stays elevated. Your business is profitable only if ACV is high enough to absorb the delivery costs. If you’re multi-tenant and growing, your gross margin improves as you scale (a powerful advantage). Investors see this and price accordingly.
Worked Example: $10M ARR Company COGS Build
Let’s walk through a realistic company: 160 customers, $62.5K average ACV, multi-tenant SaaS, $10M ARR.
COGS Components:
| Category | Annual Cost | Cost per Customer | Notes |
|---|---|---|---|
| Hosting (AWS) | $900K | $5,625 | Scales with compute, storage, data transfer; 9% of revenue |
| Third-party APIs | $320K | $2,000 | Stripe (payment processing), SendGrid, Twilio, data warehouse costs |
| Customer Support (30 people) | $2.1M | $13,125 | Fully loaded salary + benefits; support@company.com team |
| Onboarding/Impl. Labor (10 people, 40% time) | $480K | $3,000 | Implementation engineers allocating 40% to onboarding |
| DevOps/SRE (5 people) | $600K | $3,750 | Maintaining production, incident response, CI/CD |
| Monitoring/Observability | $180K | $1,125 | Datadog, PagerDuty, Sentry |
| TOTAL COGS | $4.58M | $28,625 |
Gross Margin = ($10M − $4.58M) / $10M = 54.2%
This company is below median (73% benchmark). Why?
- Support headcount is high — 30 people for 160 customers = 1 support person per 5.3 customers. Industry benchmark is 1:10. This company either has high-touch service or inefficient triage. (Action: implement support tier structure, automate triage.)
- Onboarding costs are high — 10 people at 40% time is $1.2M blended, but allocated as $480K to COGS (40% of their time). If implementation is required for every customer, this is COGS; if optional, shift to OpEx. Either way, this is a lever. (Action: build automated onboarding flows, reduce per-customer implementation time.)
- Hosting costs are reasonable — 9% of revenue is solid for a scalable platform. No immediate action needed.
If this company optimizes support to 1:10 ratio and reduces implementation time by 30%:
- Support: $1.4M (20 people instead of 30)
- Implementation: $336K (30% reduction via automation)
- New COGS: $3.736M
- New Gross Margin: 62.6%
That 8.4 percentage point improvement is worth $4M–$7M in acquisition value (at 10–15x ARR multiple for a 62.6% margin company vs. 4–6x for a 54% margin company).
Usage-Based Billing and COGS Complexity
If you charge by usage (per-API-call, per-GB, per-seat), your COGS math becomes more interesting.
Scenario #3: Usage-Based SaaS, $5M ARR, 400 customers
Your product charges $0.10 per API call. You maintain servers, APIs, and pay for bandwidth. As your customers’ usage increases, your COGS increases.
Fixed COGS (infrastructure baseline):
- Hosting, monitoring, DevOps: $600K/year (doesn’t change with usage)
Variable COGS (scales with usage):
- AWS for API calls: $0.03 per call (your cost)
- You charge $0.10 per call, margin $0.07 per call
If customers run 50M API calls/year:
- Variable COGS: 50M × $0.03 = $1.5M
- Fixed COGS: $600K
- Total COGS: $2.1M = 42% of $5M ARR = 58% gross margin
If you increase infrastructure efficiency (AI, caching, CDN optimization), your per-call cost drops from $0.03 to $0.018:
- New variable COGS: 50M × $0.018 = $900K
- Total COGS: $1.5M = 30% of revenue = 70% gross margin
This is a 12-point margin improvement from infrastructure optimization. That’s a major lever for usage-based companies.
The 2025 Angle: AI Inference Costs in Your COGS
If your product includes AI/ML (LLM inference, embeddings, fine-tuning), you now have a new COGS line item: inference spend.
Running GPT‑4, Claude, Llama, or local models costs money. As of 2026, OpenAI’s GPT‑4 API costs ~$0.03–0.06 per 1K tokens. If your customers run 10B tokens per month, that’s $300K–$600K per month in inference spend alone.
Scenario #4: AI-Native SaaS, $8M ARR, 200 customers
You’ve embedded Claude into your product. Customers run roughly 100B tokens per month across the product.
- Inference cost: 100B tokens × $0.00004 per token = $4M/month = $48M/year
Wait, that’s more than your ARR. That means your COGS is 600% of revenue. This is not scalable.
What actually happens: You optimize. You use cheaper models (Llama 2, local inference). You cache heavily. You batch requests. You add usage limits. Your actual inference COGS becomes $800K/year instead of $48M.
The lesson: If you have AI inference in your product, model it explicitly. Inference costs can make or break your unit economics. Price high enough to cover inference, or your margins evaporate.
How COGS Affects Your Rule of 40 Score and Valuation
Investors use the Rule of 40 to assess company health: Rule of 40 = Growth Rate (%) + EBITDA Margin (%).
Companies that hit or exceed 40 are considered healthy. Companies below 30 are struggling.
Here’s how COGS feeds into this:
EBITDA Margin = (Revenue − COGS − OpEx) / Revenue × 100%
If you’re at $10M ARR with 65% gross margin and $3M OpEx, your EBITDA margin is:
- ($10M − $3.5M − $3M) / $10M = 35%
If you improve COGS from 35% to 20% (gross margin 65% → 80%), your EBITDA margin jumps to 50%. That’s a 15-point improvement.
If you’re growing at 25% and your EBITDA margin is 15%, your Rule of 40 score is 40 (barely passing). If you improve COGS so your EBITDA margin rises to 30%, your Rule of 40 becomes 55 (elite tier). That difference means a 3–4x valuation premium.
Allocation Playbook: How to Audit Your Own COGS
Most founders have never formally allocated COGS. Here’s a step-by-step playbook.
Step 1: List All Company Costs Pull your most recent year’s P&L. List every expense category. Don’t estimate; use actual numbers.
Step 2: Classify Each Cost For each line, ask: “Does this cost vary with customer count?” If yes, does it support product delivery (COGS) or business expansion (OpEx)?
| Cost | Varies with Customers? | COGS or OpEx? | Reason |
|---|---|---|---|
| AWS hosting | Yes | COGS | Direct to product delivery |
| VP Sales salary | No | OpEx | Doesn’t scale with customer count |
| Support team | Yes | COGS | Direct to product delivery |
| Customer success | Partial | OpEx (60%), COGS (40%) | Split by function |
| R&D / Engineering | No | OpEx | Building features, not delivering current product |
| Marketing | No | OpEx | Acquisition, not delivery |
| Executive / G&A | No | OpEx | Overhead |
Step 3: Allocate Shared Costs Support team salary is easy (all COGS). R&D is hard (no COGS). Customer Success is in the middle. Create a rule:
- If a person spends >50% of time on delivery/activation, allocate their full salary to COGS.
- If they spend <50%, allocate to OpEx.
- If 30–70% is mixed, track the percentage and allocate proportionally.
Step 4: Calculate COGS as % of Revenue
- Total COGS / Total Revenue = COGS %
- Gross Margin % = 100% − COGS %
Step 5: Benchmark
- Is your COGS in line with industry benchmarks (15–30% for healthy SaaS)?
- Is it higher? Identify the causes (high support, high implementation, high infrastructure).
- Is it lower? Ensure you’re not misclassifying OpEx as COGS.
Step 6: Identify Levers The top 3 COGS levers for most companies:
- Support efficiency — Reduce support headcount per customer via automation, tiering, or ticket deflection.
- Infrastructure optimization — Negotiate cloud discounts, improve resource utilization, use cheaper regions/instances.
- Onboarding automation — Build self-serve, reduce per-customer implementation labor.
Common Misclassifications and Why They Matter
Mistake #1: Including All Customer Success in COGS
Many founders allocate the entire CS team to COGS because “they serve customers.” But CS salaries are primarily S&M/OpEx. Only the portion tied to onboarding, activation, and support blockers is COGS.
Impact: Overstates COGS by 5–10 percentage points. Understates gross margin, making the company look less attractive to investors.
Mistake #2: Excluding Support as COGS
Some founders argue, “Support doesn’t directly impact the product.” Yes it does. Support solves for product usability and delivery. Without support, products fail.
Impact: Understates COGS by 2–5 percentage points. Overstates gross margin. When investors dig in, credibility drops.
Mistake #3: Including R&D/Product Development as COGS
“Our engineers maintain the product, so that’s COGS.” No. Maintaining existing features is DevOps/SRE (COGS). Building new features is R&D (OpEx). These are different cost centers.
Impact: Massively overstates COGS. Understates OpEx. Creates a false appearance of high-margin low-cost delivery. Investors won’t believe it.
Mistake #4: Not Allocating Multi-Customer Infrastructure Costs
“Our $2M AWS bill serves all customers. How do we allocate it to COGS?” Divide by customer count. $2M / 200 customers = $10K COGS per customer.
Impact: If you skip this, you can’t calculate per-customer unit economics. You’ll make bad pricing, expansion, and acquisition decisions.
FAQ: The Long-Tail Questions Founders Actually Ask
Q: Should onboarding be COGS if it’s required before a customer goes live?
A: Yes. If the customer can’t go live and use the product without onboarding, it’s a cost to deliver the product. Allocate it to COGS. If onboarding is optional/supplemental training, it’s OpEx.
Q: How do we handle shared infrastructure costs when we have both multi-tenant and single-tenant customers?
A: Calculate per-customer hosting COGS separately for each segment. Multi-tenant customers: divide shared infrastructure by multi-tenant customer count. Single-tenant customers: allocate dedicated infrastructure to those customers only. You’ll likely see 2–3x higher COGS per single-tenant customer.
Q: Is payment processing (Stripe fees) COGS or OpEx?
A: COGS. Stripe’s 2.9% + $0.30 per transaction is a cost to deliver revenue. It scales directly with revenue and is unavoidable. Include it in COGS.
Q: Can we allocate part of the CEO’s salary to COGS if they spend time on product?
A: No. Executive salaries are overhead, not variable costs tied to customer delivery. Even if the CEO codes, that’s R&D (OpEx). Keep it simple: CEO salary → G&A / OpEx.
Q: How do we handle contractors for implementation vs. full-time employees?
A: Same rule. If they’re doing onboarding/activation work required to deliver the product, their cost is COGS. Track time sheets and allocate proportionally if they work on both COGS and OpEx tasks.
Q: What if we have a tiered support model — some customers get premium support, others get basic?
A: Calculate COGS per tier. Premium-tier customers have higher per-customer COGS (more support labor). Basic-tier customers have lower per-customer COGS. This lets you reason about whether your pricing model is sustainable for each tier.
Q: If we use AI inference (Claude, GPT‑4), is that COGS?
A: Yes. Every API call you make to an external LLM service costs money and scales with customer usage. Model it explicitly. If your inference costs exceed your gross margin, you’re not sustainable. This is a critical lever to optimize.
The Optimization Playbook: Reduce COGS, Improve Margins
If you’re below-median gross margin, here’s the playbook to improve.
Tier 1 (Quick Wins — 0–6 months):
- Audit your COGS allocation (you’ll likely find 2–3 percentage points of misclassification)
- Negotiate cloud discounts (most companies overpay AWS/GCP by 20–30%)
- Implement support tiering (first-response triage, self-serve escalation)
- Build FAQ/knowledge base to deflect low-value tickets
Tier 2 (Medium Effort — 6–12 months):
- Automate onboarding flows (reduce per-customer implementation labor)
- Optimize infrastructure for per-customer cost (cache, CDN, region optimization)
- Shift routine support to chatbots (AI-powered support deflection)
- Implement usage metering/limits if necessary (cap unbounded usage)
Tier 3 (Structural — 12+ months):
- Move from single-tenant to multi-tenant (if applicable; reduces per-customer infrastructure cost)
- Build product features that reduce support burden (self-serve analytics, in-app troubleshooting)
- Shift support from email-driven to in-product (reduce ticket volume, faster resolution)
Most companies see 3–5 percentage point gross margin improvement per year if they focus on COGS optimization. That’s worth $2M–$3M in exit value per $10M ARR.
Closing: COGS Is Your Profit Engine
SaaS founders obsess over growth rate, MRR, and churn. Those metrics matter. But gross margin — driven by COGS — is what separates a $30M exit from a $100M exit.
Most founders misclassify COGS and don’t see it. Investors do. If you want to maximize valuation, obsess over COGS allocation, benchmark against peers, and build a relentless optimization program.
The companies that master this score 80%+ gross margins at $20M+ ARR. The companies that don’t cap out at 60–65% margins and plateau at $30M ARR. That difference is worth 3–5x.
Fix your COGS. Everything else flows from there.
Related Reading
Learn how SaaS COGS connects to your overall unit economics and scalability:
- The SaaS Magic Number: Your Revenue Efficiency Benchmark
- Customer Lifetime Value (LTV): The Formula and How to Calculate It
- Net Revenue Retention (NRR): The Metric That Predicts Exit Value
- Rule of 40: The SaaS Health Check Every Investor Uses
- SaaS Unit Economics: LTV/CAC, Payback Period, and Scaling
- Bookkeeping for SaaS Companies: Get Investor-Grade Financials Right

