Calculating the true cost of goods sold (COGS) for SaaS is one of the most misunderstood exercises in startup finance—and getting it wrong has real consequences. Investors use it to benchmark your gross margin. You use it to set pricing. Your board uses it to decide whether your unit economics actually work.
Here’s what you need to know at a glance:
- SaaS COGS ≠ traditional COGS. There’s no physical inventory. Instead, it’s every direct cost tied to delivering your software to paying customers.
- Core components include cloud hosting, DevOps/infrastructure labor, customer support, third-party APIs, payment processing fees, and security/compliance costs.
- The formula: COGS = Sum of all direct delivery costs for a given period (monthly or quarterly).
- Why it matters: COGS directly determines your gross margin—the number investors scrutinize most closely when evaluating SaaS businesses.
- The 2026 benchmark: According to SaaS Capital and the LinkedIn 2026 SaaS Benchmarks Report, pure SaaS companies should target 75–82% gross margin, which means COGS should sit at roughly 18–25% of revenue.
Why Calculating the True Cost of Goods Sold (COGS) for SaaS Is Harder Than It Looks
Here’s the thing. Traditional COGS is clean. You make a widget, you count raw materials and labor, you’re done.
SaaS doesn’t work that way.
Your “product” lives in the cloud, scales automatically, and gets delivered to thousands of users simultaneously. That makes the cost boundary blurry. People consistently dump the wrong costs into COGS—then wonder why their gross margin looks worse than their competitors, or why their VC’s eyebrows went up during a pitch.
The dirty little secret? GAAP doesn’t explicitly define what goes into SaaS COGS. According to SaaS Capital, this ambiguity is the root cause of most misclassification errors. So you need a framework—not just a formula.
Think of SaaS COGS like the waterline on a ship. Everything below the waterline (in direct contact with the water of service delivery) belongs in COGS. Everything above it—sales, marketing, admin, most of R&D—is operating expense. The moment you blur that line, your financial picture gets distorted.
What Actually Belongs in SaaS COGS (And What Doesn’t)
Before you calculate a single dollar, get the classification right. This table cuts through the noise:
| Cost Category | In COGS? | Examples |
|---|---|---|
| Cloud hosting & infrastructure | ✅ Yes | AWS, Azure, Google Cloud compute/storage |
| Content delivery networks (CDN) | ✅ Yes | Cloudflare, Amazon CloudFront |
| DevOps / SRE labor (production uptime) | ✅ Yes | Engineers keeping production live |
| Customer support salaries (retention-focused) | ✅ Yes | Support tickets, onboarding enablement |
| Third-party APIs & licensed data | ✅ Yes | Payment APIs, data enrichment services |
| Payment processing fees | ✅ Yes | Stripe fees (~2.5–3% of revenue) |
| Security & compliance audits | ✅ Yes | SOC 2, pen testing, compliance tooling |
| R&D / new feature development | ❌ No | New product engineering belongs in OpEx |
| Sales commissions | ❌ No | This is a selling expense |
| Marketing & advertising | ❌ No | Goes under operating expenses |
| General & administrative | ❌ No | Executive salaries, HR, legal |
| Customer success focused on upselling | ❌ No | Cross-sell/upsell = sales activity |
One nuance worth flagging: customer success is a gray area. If your CS team’s primary function is retention, satisfaction, and enablement, they belong in COGS. The moment their KPIs shift toward expansion revenue? Move them to sales.
How to Calculate SaaS COGS: Step-by-Step for Beginners
This is where most founders freeze up. Don’t overthink it. Walk through this once a month.
Step 1: Pull Your Direct Cost Line Items
Open your accounting software (QuickBooks, Xero, whatever you use) and pull every expense that falls under these buckets:
- Cloud hosting and infrastructure (AWS, GCP, Azure invoices)
- CDN and bandwidth costs
- DevOps/SRE salaries × their percentage of time spent on production (not new builds)
- Customer support team fully-burdened labor costs (salary + benefits + payroll taxes)
- Third-party software licenses embedded in your product
- Payment processing fees
- Security software, compliance audit costs
Step 2: Use Fully-Burdened Labor Costs
Don’t just count base salary. A “fully-burdened” employee cost includes salary + employer payroll taxes + health benefits + any equity-based compensation. SaaS Capital recommends calculating total employee overhead as a percentage of salary and applying it uniformly to all COGS-allocated headcount.
Step 3: Apply the SaaS COGS Formula
$$\text{COGS} = \text{Infrastructure} + \text{Usage-Based Services} + \text{Transaction Costs} + \text{Direct Labor}$$
A quick example: say your monthly costs break down as follows—
- AWS/GCP hosting: $6,000
- Stripe payment processing: $2,500
- Customer support labor (fully burdened): $3,000
- Third-party APIs: $1,450
- Security tooling: $2,050
$$\text{COGS} = $6{,}000 + $2{,}500 + $3{,}000 + $1{,}450 + $2{,}050 = $15{,}000$$
Step 4: Calculate Your Gross Margin
$$\text{Gross Margin} = \frac{\text{Revenue} – \text{COGS}}{\text{Revenue}} \times 100$$
If your MRR is $80,000 and COGS is $15,000:
$$\text{Gross Margin} = \frac{$80{,}000 – $15{,}000}{$80{,}000} \times 100 = 81.25%$$
That’s a healthy number. Keep it above 75% and most investors won’t blink.
Step 5: Monitor Monthly, Review Quarterly
COGS isn’t a set-it-and-forget-it calculation. Hosting costs scale with customers. Support headcount grows. Run a cross-functional COGS review every quarter—bring finance, engineering, and product to the same table. According to CloudZero’s 2025 SaaS Gross Margin Benchmarks guide, the companies protecting their margins are the ones running these reviews systematically and allocating cloud spend down to the service or feature level.
Common Mistakes When Calculating the True Cost of Goods Sold (COGS) for SaaS
Even seasoned operators trip on these. Here’s what to watch for—and how to fix it.
H4: Mistake 1 — Dumping All Engineering Salaries Into COGS
The fix: Only include engineers who spend meaningful time maintaining the production environment—DevOps, SRE, infrastructure teams. Engineers building new features? That’s R&D. The split matters more than you think.
H4: Mistake 2 — Forgetting Payment Processing Fees
Stripe and similar processors charge roughly 2.5–3% of revenue. At $1M ARR, that’s $25,000–$30,000 annually sitting in COGS that many founders forget to count. Don’t leave it out.
H4: Mistake 3 — Including Sales Commissions
Sales commissions are a selling cost—full stop. They have no place in COGS. Including them inflates your cost base and tanks your reported gross margin artificially.
H4: Mistake 4 — Mixing Professional Services Revenue With SaaS COGS
If you offer implementation or onboarding services, track those revenues and costs separately. Blending them into your core SaaS COGS obscures whether your core product is actually profitable.
H4: Mistake 5 — Using Partial-Burden Labor Costs
If you’re only counting base salaries, you’re understating COGS. Use fully-burdened costs every time—it gives you a more honest picture and prevents surprises during due diligence.

What “Good” Looks Like in 2026
So what’s the target? According to Stripe’s SaaS Gross Margin resource and the 2026 SaaS Benchmarks Report published on LinkedIn by Ryan Allis, here’s how margin benchmarks break down by company type:
| SaaS Model | Target Gross Margin | Implied COGS % of Revenue |
|---|---|---|
| Pure SaaS (self-serve, cloud-native) | 80–85% | 15–20% |
| Enterprise SaaS | 75–82% | 18–25% |
| SaaS + professional services | 65–75% | 25–35% |
| AI-native SaaS (compute-heavy) | 55–70% | 30–45% |
| Vertical SaaS with payments | 60–70% | 30–40% |
| Hardware-enabled SaaS | 40–60% | 40–60% |
AI-native companies are the wildcard in 2026. GPU infrastructure and LLM API inference costs (per-token pricing from OpenAI, Anthropic, etc.) are dragging gross margins to 55–70%—well below the traditional SaaS bar. If you’re building AI-first, you need a separate cost accounting strategy for inference workloads.
Key Takeaways
- COGS in SaaS = direct delivery costs only. If removing that cost wouldn’t immediately degrade your service, it probably doesn’t belong in COGS.
- Fully-burdened labor costs are non-negotiable for an accurate picture—include salary, benefits, and payroll taxes.
- Infrastructure, support, APIs, payment fees, and security are the five pillars of SaaS COGS.
- 75%+ gross margin is the 2026 benchmark for pure SaaS; AI-native models sit structurally lower (55–70%).
- Never mix professional services costs into your core SaaS COGS—it corrupts both line items.
- Run monthly calculations and quarterly reviews—bring finance and engineering into the same room.
- Misclassifying COGS doesn’t just hurt your financials internally—it damages your credibility with investors during fundraising.
- The customer success gray area is real: CS focused on retention = COGS; CS focused on expansion = sales expense. Know the difference.
Calculating the true cost of goods sold (COGS) for SaaS isn’t glamorous work. But it’s the foundation every other number rests on—your gross margin, your unit economics, your Series B pitch. Get this right once, build a repeatable monthly process, and you’ll have a financial model that actually tells the truth about your business. Start with your cloud invoices, add your fully-burdened support costs, and build from there. It’s more straightforward than it sounds—and dramatically more valuable than leaving it vague.
Frequently Asked Questions
Q1: What’s the biggest difference between calculating COGS for SaaS vs. a physical product company?
Traditional product COGS uses beginning inventory, adds production costs, and subtracts ending inventory. In SaaS, there’s no inventory—so calculating the true cost of goods sold for SaaS focuses entirely on direct service delivery expenses per period (month or quarter). You’re measuring the cost to serve customers, not to manufacture a unit.
Q2: Should I include customer success managers in SaaS COGS?
Only partially—and only the right portion. Customer success managers focused on onboarding, retention, satisfaction scores, and enablement belong in COGS. Those who primarily drive upsell or cross-sell activity are effectively part of your sales team and should be classified under operating expenses. Splitting the allocation by time or role function is acceptable and defensible.
Q3: How does calculating the true cost of goods sold for SaaS change as you scale?
Early-stage SaaS companies ($0–$1M ARR) often see COGS at 40–50% of revenue because infrastructure is over-provisioned, support is high-touch, and there are no economies of scale. As you grow past $5M ARR, right-sizing infrastructure, automating support, and standardizing onboarding typically pushes gross margins toward the 70–80% range. The COGS categories don’t change—but the efficiency ratios within each category improve dramatically.



