Gross margin is the ceiling on every other number in your business. You can run a brilliant sales engine and still build a fragile company if too much of each dollar leaves again to keep the product running. For SaaS, gross margin is the first test of whether the model works: how much of your revenue is left after the direct cost of delivering the software.
It sounds simple, and the formula is. What trips founders up is what belongs in the cost line, where the healthy range sits, and why a margin that looks fine on the surface can quietly cap your growth. This guide covers the definition, what counts as cost of goods sold, the benchmark bands, a worked example, and the levers that move the number.
What is SaaS gross margin?
Gross margin is the share of revenue left after the direct costs of delivering your service. The formula is short:
Gross margin = (Revenue − Cost of goods sold) / Revenue
Cost of goods sold (COGS) is everything you spend to keep the product live and customers served. It is not what you spend to win them or build new features. That distinction is the whole game. A company that buries hosting and support costs below the gross-margin line reports a flattering number that falls apart the moment an investor rebuilds it properly.
The reason the metric matters so much in software: a high gross margin is what separates SaaS from a services business. Sell more seats and your costs barely move, so most of the new revenue drops toward profit. Sell more consulting hours and your costs rise almost in step. Gross margin is where that difference shows up in the numbers.
What counts as COGS in SaaS?
The line between COGS and operating expense decides whether your margin is honest. Here is where most software costs land:
| Belongs in COGS | Belongs in operating expense (not COGS) |
|---|---|
| Cloud hosting and infrastructure (AWS, GCP, Azure) | Sales and marketing |
| Customer support and success teams | Research and development / engineering for new features |
| Third-party software and APIs baked into the product | General and administrative (finance, HR, legal) |
| Payment processing fees | Brand, content, and demand generation |
| Data, storage, and bandwidth | Office, tooling, and overhead |
| Professional services and onboarding delivery | Stock-based compensation (often shown separately) |
The grey zones cause the arguments. Engineering that keeps the lights on belongs in COGS; engineering that builds the next product does not. Customer success that fixes problems is COGS; customer success that upsells is closer to sales. Be consistent, document the split, and apply it the same way every quarter so the trend means something.

A worked example
Take a company with $10,000,000 in annual recurring revenue. Its direct delivery costs for the year break down like this:
- Cloud hosting: $1,200,000
- Customer support and success: $900,000
- Third-party APIs and payment fees: $400,000
Total COGS is $2,500,000. Gross profit is $10,000,000 minus $2,500,000, or $7,500,000. Gross margin is 7,500,000 divided by 10,000,000, which is 75%. That is a healthy figure: three-quarters of every revenue dollar is free to fund growth, product, and eventually profit.
Now imagine hosting costs double to $2,400,000 because the product added compute-heavy AI features. COGS climbs to $3,700,000, gross profit drops to $6,300,000, and the margin slips to 63%. Same revenue, same customers, but the business now has 12 fewer cents per dollar to spend on everything else. That is the kind of move that decides whether a feature is worth shipping.
What is a good SaaS gross margin?
Investors read the number in bands, and the band you sit in shapes how your other metrics get judged:
| Gross margin | Read |
|---|---|
| 80% and above | Best in class. Pure software with lean delivery costs. |
| 70% to 80% | Healthy. The range most public SaaS companies live in. |
| 60% to 70% | Acceptable but watch it. Often infrastructure-heavy or services-heavy. |
| Below 60% | A flag. The model looks more like services than software. |
Context changes the verdict. A usage-based product that resells a lot of compute will run lower than a seat-based tool, and that can be fine if pricing keeps pace. A business with heavy onboarding might carry more professional-services cost early, then climb as it scales. The trend matters more than any single quarter: a margin moving up as you grow is a strong signal; one drifting down as you add customers points to a delivery cost that scales with revenue, which is the thing pure SaaS is supposed to avoid.
Why AI features are pushing margins down
For a decade, software gross margins drifted up as cloud costs fell. That trend reversed for many teams in 2024 and 2025. Products that call large language models on every request carry a real, per-use inference cost that behaves more like cost of goods than a fixed expense. A support tool that answers tickets with a model pays for tokens each time, so its COGS now rises with usage.

This is why the question "what does this AI feature do to gross margin?" has moved into board decks. Some teams price the feature high enough to protect the margin. Others absorb the cost to win the market and plan to optimise inference later. Either choice is defensible. Making it without looking at the margin is not.
How gross margin connects to your other metrics
Gross margin is the foundation the rest of your unit economics sit on, so read it next to them rather than alone.
- It sets the ceiling for the Rule of 40, because the profit half of that score is gross-margin driven.
- It is the blind spot in the SaaS Magic Number, which measures sales efficiency but ignores how profitable that revenue is.
- It decides whether a healthy LTV:CAC ratio turns into real cash, since lifetime value should be calculated on gross profit, not raw revenue.
For how all of these fit together, see our guide to SaaS unit economics. The short version: a strong margin makes every other metric easier, and a weak one quietly drains them.
How do you improve a low gross margin?
Two routes move the number: cut what it costs to serve, or earn more per customer for the same delivery cost.
- Right-size infrastructure. Reserved capacity, smarter autoscaling, and cheaper storage tiers often recover several margin points without touching the product.
- Automate support and onboarding. Self-serve setup and good documentation let the support team cover more customers per head, which is the single biggest swing for many teams.
- Cut or renegotiate third-party costs. APIs and tools embedded in the product are pure COGS; trimming the ones that no longer earn their place flows straight to margin.
- Move customers up-market or up-tier. Larger contracts usually carry similar delivery cost on a much bigger revenue base, lifting the percentage.
One caution. Do not protect the margin by starving the things customers actually feel. Gut support to post a prettier number and churn follows a quarter later, which costs you far more than the points you saved. The goal is efficient delivery, not the thinnest possible cost line.
Where gross margin can mislead
The metric is only as honest as the COGS definition behind it. A company that classifies hosting as an operating expense will show an inflated margin that does not survive scrutiny. Early-stage businesses run noisy margins because a single big infrastructure bill or a one-off services project can swing the quarter. And a high margin says nothing about whether anyone wants the product; you can post 85% on a tiny, shrinking revenue base. Read it as a measure of model quality, paired with growth and retention, not as a verdict on its own.
Frequently asked questions
What is a good gross margin for a SaaS company?
Most healthy SaaS businesses sit between 70% and 80%, and best-in-class pure software runs above 80%. Anything below 60% suggests the cost of delivering the service is too high and the model leans toward services rather than software.
What is included in SaaS cost of goods sold?
COGS covers the direct cost of running the product and serving customers: cloud hosting, customer support and success, third-party APIs and software baked into the product, payment processing, and onboarding delivery. Sales, marketing, and new-feature engineering are operating expenses, not COGS.
Why is gross margin different from net margin?
Gross margin only subtracts the direct cost of delivering the service. Net margin subtracts everything else as well, including sales, marketing, research, and overhead. A SaaS company can have a strong 75% gross margin and still lose money overall while it spends heavily to grow.
Do AI features lower SaaS gross margin?
Often, yes. Features that call large language models carry a per-use inference cost that lands in COGS and rises with usage. Teams either price the feature to cover it or absorb the cost deliberately while they optimise, but the margin impact should be a conscious decision.
Gross margin will not win you customers or close a round on its own. What it tells you is whether the customers you already have add up to a real business. Watch it as a trend, define COGS the same way every quarter, and treat it as the floor that every other metric is built on. Get it right and growth compounds. Ignore it and even a fast-growing company can run out of room.



