# SaaS Gross Margin: How to Calculate and What Good Looks Like

> Learn how to calculate SaaS gross margin, which costs belong in cost of revenue, and what margin ranges are healthy for different stages of a software business.
- **Author**: Ayush Agarwal
- **Published**: 2026-04-12
- **Category**: SaaS Finance
- **URL**: https://dodopayments.com/blogs/saas-gross-margin

---

Gross margin is one of the most important SaaS finance metrics because it tells you how much revenue remains after delivering the product. It is the bridge between growth and business quality. Two companies can report the same ARR and the same growth rate, yet have very different economics if one is running a 55% gross margin business and the other is running at 82%.

That difference affects almost everything. Gross margin shapes hiring pace, payback periods, valuation quality, expansion flexibility, and how much room you have to absorb mistakes in pricing or churn.

This guide explains how to calculate SaaS gross margin, which costs belong in cost of revenue, what margin ranges are considered healthy, and how SaaS teams can improve gross margin without damaging growth.

For related context, read our posts on [SaaS profit](https://dodopayments.com/blogs/saas-profit), [cloud cost planning](https://dodopayments.com/blogs/cloud-costs-planning), [boosting SaaS profitability](https://dodopayments.com/blogs/boost-saas-profitability), and the [SaaS accounting guide](https://dodopayments.com/blogs/saas-accounting-guide).

## What is SaaS gross margin?

SaaS gross margin is the percentage of revenue left after subtracting the direct costs required to deliver your product or service.

The formula is:

```text
Gross Margin = (Revenue - Cost of Revenue) / Revenue x 100
```

If your company generates $100,000 in revenue and spends $22,000 on cost of revenue, your gross margin is:

```text
(100,000 - 22,000) / 100,000 x 100 = 78%
```

Gross margin is not a measure of total profitability. It does not include all operating expenses such as sales, marketing, general admin, or product R&D. It tells you how efficient the business is at delivering what it sells.

> The billing model you choose in month one will constrain your pricing flexibility in year two. Build on infrastructure that supports subscriptions, usage, credits, and hybrid models from the start.
>
> - Ayush Agarwal, Co-founder & CPTO at Dodo Payments

## Why gross margin matters so much in SaaS

SaaS is attractive partly because software businesses can scale revenue faster than direct delivery cost. But that advantage is not automatic.

Gross margin matters because it tells you:

- how much room you have to invest in growth
- how resilient the business is under pricing pressure
- whether your infrastructure and support model scale well
- how efficiently each dollar of revenue turns into future operating leverage

Strong gross margin also supports healthier [revenue forecasting](https://dodopayments.com/blogs/revenue-forecasting-saas) and more realistic [burn rate and runway planning](https://dodopayments.com/blogs/saas-burn-rate-runway).

In practical terms, gross margin determines how much of each new dollar of revenue can be reinvested. Higher gross margin creates more room for product development, sales capacity, and experimentation without putting the company under immediate cash pressure.

## What goes into SaaS cost of revenue?

This is where many teams get gross margin wrong. Cost of revenue should include the direct costs required to serve customers.

Common SaaS cost of revenue items include:

- cloud hosting and infrastructure
- third-party usage fees directly tied to delivery
- customer support salaries or support tooling directly tied to customers
- implementation or onboarding services if they are part of delivery
- payment processing and billing fees
- content delivery or storage costs
- some security or compliance tools if they scale directly with service delivery

Your [SaaS accounting guide](https://dodopayments.com/blogs/saas-accounting-guide) should define these categories clearly so finance does not reclassify them differently every quarter.

## What should not go into SaaS gross margin?

These items generally belong below gross profit as operating expenses:

- product R&D salaries
- general admin salaries
- brand marketing spend
- paid acquisition spend
- founder salaries not tied directly to service delivery
- broad software overhead not directly required to serve customers

Some teams include everything remotely technical under cost of revenue, which artificially depresses margin and makes benchmarking harder.

## Gross margin vs contribution margin vs operating margin

These terms are related but not interchangeable.

### Gross margin

Revenue minus direct cost of delivering the product.

### Contribution margin

Often includes additional variable costs tied to acquiring and serving customers, depending on the company's internal definition.

### Operating margin

Revenue minus all operating costs, including sales, marketing, R&D, and G&A.

If you want to understand business quality at the product-delivery layer, gross margin is the right lens.

```mermaid
flowchart TD
    A[Revenue] --> B[Minus Cost of Revenue]
    B --> C[Gross Profit]
    C --> D[Gross Margin Percentage]
    C --> E[Minus Operating Expenses]
    E --> F[Operating Profit or Loss]
```

## What is a good SaaS gross margin?

There is no single correct number for every SaaS company, but broad ranges are useful.

| Gross Margin Range | What It Usually Means                                                              |
| ------------------ | ---------------------------------------------------------------------------------- |
| Below 60%          | Margin is under pressure. Delivery cost may be too high or pricing may be too low. |
| 60% to 70%         | Common for infrastructure-heavy, services-assisted, or early-stage SaaS.           |
| 70% to 80%         | Healthy range for many growing SaaS businesses.                                    |
| 80% to 90%         | Strong software economics, often seen in efficient subscription businesses.        |

Context matters though. An AI-heavy product with high inference cost may operate at a lower gross margin than a lightweight workflow app. A services-assisted enterprise onboarding model may also depress gross margin in the short term.

## The 5 biggest drivers of SaaS gross margin

### 1. Infrastructure cost

Cloud spend is often the biggest direct cost. If compute, storage, or data transfer rises faster than customer value, gross margin compresses quickly. That is why [cloud cost planning](https://dodopayments.com/blogs/cloud-costs-planning) is not just an engineering problem. It is a finance discipline.

### 2. Pricing quality

Poor pricing can hide behind growth for a while. If your product delivers more value than your pricing captures, gross margin will suffer even when customers are happy. Review your [subscription pricing models](https://dodopayments.com/blogs/subscription-pricing-models), [usage-based billing design](https://dodopayments.com/blogs/usage-based-billing-saas), and [pay-per-seat packaging](https://dodopayments.com/blogs/pay-per-seat-billing-b2b) regularly.

### 3. Payment and billing cost

Billing fees are part of cost of revenue for most SaaS companies. They may seem small, but they matter at scale, especially with international sales, subscription complexity, and multiple payment providers.

### 4. Support intensity

If every new customer requires heavy hand-holding, low automation, or custom troubleshooting, your support cost of revenue increases. That can be worthwhile for enterprise ACV, but it should be measured.

### 5. Product and customer mix

Some plans, segments, or geographies are simply more expensive to serve than others. Cohort-based gross margin analysis is sometimes useful if you sell very different products or contract types.

## A simple SaaS gross margin example

Suppose your company generates $250,000 in monthly revenue.

Direct costs that month:

- cloud hosting: $32,000
- payment and billing fees: $11,500
- support team cost allocated to service delivery: $18,000
- implementation labor: $8,500

Total cost of revenue = $70,000

```text
Gross Profit = 250,000 - 70,000 = 180,000
Gross Margin = 180,000 / 250,000 x 100 = 72%
```

A 72% gross margin can be healthy, but the next question is what is pushing it down or up. If hosting cost jumps as usage scales while pricing stays flat, margin may deteriorate even with solid revenue growth.

## Common mistakes when calculating gross margin

### Confusing support and success costs

Reactive customer support tied to service delivery often belongs in cost of revenue. Broader success programs, renewals, and expansion teams often sit below gross margin. Document the distinction clearly.

### Ignoring billing fees

Payment processing, fraud, tax tooling, and billing infrastructure are part of delivering revenue for digital businesses. If you exclude them, margin looks better on paper than it really is.

### Mixing annual billings with monthly margin analysis

Large annual payments can distort month-level revenue views if you do not align them with recognized revenue. This is another reason finance teams should connect gross margin work with [SaaS accounting](https://dodopayments.com/blogs/saas-accounting-guide) and [billings vs revenue](https://dodopayments.com/blogs/billings-vs-revenue).

### Benchmarking without business context

Comparing a low-support, self-serve SaaS app to a high-touch enterprise AI platform is rarely useful. Margin benchmarks only make sense when delivery models are comparable.

## How to improve SaaS gross margin

### Optimize infrastructure intentionally

This includes right-sizing compute, reducing waste, improving caching, and understanding which product behaviors are driving cost. Again, [cloud cost planning](https://dodopayments.com/blogs/cloud-costs-planning) is often the fastest lever.

### Improve pricing architecture

If customers receive more value than you capture, revisit packaging. Hybrid billing, usage thresholds, or seat-based expansion can align price with value better than one flat plan.

### Reduce preventable revenue leakage

Failed payments, tax errors, and billing gaps hurt margin because the delivery cost often happens whether revenue is collected or not. Better [dunning management](https://dodopayments.com/blogs/dunning-management) and [revenue leakage controls](https://dodopayments.com/blogs/revenue-leakage-saas) matter here.

### Move repetitive support into self-serve flows

Clear documentation, automated onboarding, and a strong customer portal can reduce direct support burden over time. Teams can use the [customer portal docs](https://docs.dodopayments.com/features/customer-portal), [subscription docs](https://docs.dodopayments.com/features/subscription), [payment methods docs](https://docs.dodopayments.com/features/payment-methods), [webhooks guide](https://docs.dodopayments.com/developer-resources/webhooks/intents/webhook-events-guide), and [TypeScript SDK docs](https://docs.dodopayments.com/developer-resources/sdks/typescript) to automate more of the billing experience.

### Measure gross margin by product line when needed

If one product line or customer segment is far more costly to serve, blended company-level gross margin may hide the problem.

## Where Dodo Payments affects SaaS gross margin

Billing infrastructure has a direct impact on gross margin because payment fees, tax handling, and renewal recovery all sit close to revenue delivery.

Dodo Payments operates as a Merchant of Record across 220+ countries and regions. For SaaS companies, that can reduce operational complexity around tax and compliance while keeping pricing easy to model: 4% + 40c for domestic US transactions, +1.5% international, and +0.5% for subscriptions.

That matters when gross margin analysis needs clear visibility into billing cost, international expansion cost, and preventable revenue loss. If the billing layer is fragmented, margin analysis becomes harder to trust.

You can learn more at [Dodo Payments](https://dodopayments.com) and [Dodo Payments pricing](https://dodopayments.com/pricing).

## FAQ

### What is a good gross margin for a SaaS company?

Many SaaS companies aim for 70% to 80% gross margin, but the right number depends on delivery model, product complexity, and stage. Infrastructure-heavy or services-assisted SaaS may run lower while still being healthy.

### Are payment processing fees included in SaaS gross margin?

Yes, in most cases they should be included in cost of revenue because they are directly tied to delivering and collecting SaaS revenue. Excluding them can overstate your true gross margin.

### Is customer support included in cost of revenue for SaaS?

Direct support tied to serving active customers often is. Broader success, account management, and revenue expansion programs are usually treated separately below gross margin, depending on company policy.

### Why is SaaS gross margin lower than expected in some companies?

Common causes include underpriced plans, rising infrastructure spend, high support intensity, poor billing recovery, and inconsistent cost classification. You usually need to inspect the components rather than relying on one blended margin figure.

### How often should SaaS gross margin be reviewed?

Monthly is a strong default because infrastructure cost, payment mix, and support burden can shift quickly. Quarterly review alone often delays important pricing or cost decisions.

## Conclusion

Gross margin is one of the cleanest indicators of SaaS business quality because it shows whether revenue scales faster than the direct cost of serving customers. If growth is the headline, gross margin is the fine print that tells you how valuable that growth really is.

Calculate it carefully, classify cost of revenue consistently, and improve it through pricing, infrastructure discipline, and billing efficiency. Over time, better gross margin gives you more strategic room everywhere else.
---
- [More SaaS Finance articles](https://dodopayments.com/blogs/category/saas-finance)
- [All articles](https://dodopayments.com/blogs)