Gross margin is the percentage of revenue that remains after subtracting the cost of goods sold, which in a subscription software company means the direct cost of hosting, delivering and supporting the service. Among SaaS metrics in the SaaS & startups field, it is the clearest indicator of how much each additional dollar of revenue can fund growth, research and profit.
The formula is simple: gross margin equals revenue minus cost of revenue, divided by revenue. Mature software businesses commonly report gross margins in the range of 70 to 85 percent, far above most hardware, services or retail companies, and investors treat the figure as a test of whether a company truly behaves like software.
How gross margin is calculated in SaaS
Gross margin is calculated by taking recognized revenue for a period, subtracting the cost of revenue (also called cost of goods sold, or COGS) for the same period, and dividing the result by revenue. A company with 10 million dollars of quarterly revenue and 2.5 million dollars of cost of revenue has a gross margin of 75 percent.
The difficult part is not the arithmetic but the classification of costs. In SaaS, cost of revenue includes only expenses that scale with delivering the existing service to existing customers. Expenses that build new product or win new customers belong to operating expenses instead. The table below shows the usual split.
| Cost item | Usually in cost of revenue | Reason |
|---|---|---|
| Cloud hosting and infrastructure | Yes | Scales directly with usage |
| Customer support staff | Yes | Serves existing customers |
| Third-party software embedded in the product | Yes | Paid per customer or per use |
| Payment processing fees | Often yes | Tied to each transaction |
| Research and development | No | Builds future product |
| Sales and marketing | No | Acquires new customers |
Gray areas are common. Customer success teams focused on renewals and expansion are sometimes placed in sales and marketing, while onboarding and implementation staff may sit in cost of revenue. Because policies differ, comparing companies requires reading how each one allocates these functions.
Subscription gross margin versus blended gross margin
Many SaaS companies report two margins because their revenue has two very different components. Subscription gross margin covers recurring software revenue, while professional services margin covers implementation, training and consulting. The blended gross margin combines both.
| Revenue stream | Typical gross margin | Main cost driver |
|---|---|---|
| Subscription software | About 75 to 90 percent | Hosting and support |
| Professional services | Near zero to 30 percent | Consultant salaries |
| Usage-based or AI features | Often 50 to 70 percent | Compute and model inference |
| Hardware bundled with software | Often 20 to 50 percent | Device manufacturing |
Services are often priced near cost to remove adoption friction, so a low services margin is not necessarily a problem. Analysts usually focus on subscription gross margin, because it reflects the long-term economics of the recurring base and feeds directly into lifetime value calculations.
Why gross margin matters for SaaS valuation
Gross margin matters because it determines how much revenue converts into contribution available for operating expenses and profit. Two companies with identical annual recurring revenue can deserve very different valuations if one keeps 80 cents of every dollar and the other keeps 55 cents.
Gross margin also sits inside several other SaaS metrics. Customer lifetime value should be computed on gross profit rather than revenue, otherwise the LTV to CAC ratio is overstated. The CAC payback period is likewise more accurate when measured on gross-margin-adjusted revenue. The table compares gross margin with neighboring profitability measures.
| Metric | What it subtracts from revenue | What it reveals |
|---|---|---|
| Gross margin | Cost of revenue only | Efficiency of service delivery |
| Contribution margin | Cost of revenue plus variable selling costs | Profit per customer or unit |
| Operating margin | All operating expenses | Profitability of the whole business |
| Free cash flow margin | Cash costs and capital spending | Cash generation capacity |
Because the Rule of 40 and the burn multiple use revenue growth and cash results, a weak gross margin eventually shows up in those metrics as well, even if headline growth looks strong.
How to improve gross margin
Improving gross margin means reducing the cost to serve each customer or raising the price for the same service. Most gains come from infrastructure efficiency and support automation rather than from a single dramatic change.
| Lever | Typical action | Main risk |
|---|---|---|
| Infrastructure optimization | Rightsize instances, commit to reserved capacity | Engineering time diverted |
| Multi-tenant architecture | Share resources across customers | Migration effort and isolation concerns |
| Support deflection | Self-service help and better onboarding | Lower satisfaction if overdone |
| Pricing changes | Charge for heavy usage or premium tiers | Churn among price-sensitive accounts |
| Vendor renegotiation | Lower fees for embedded third-party services | Switching costs |
Single-tenant deployments for large enterprise customers often lower margin, because each customer needs dedicated infrastructure and operations. Companies that offer them usually charge a premium sufficient to cover the extra cost to serve.
Pitfalls when interpreting gross margin
The most common pitfall is comparing margins across companies without checking cost allocation. A company that places support staff in operating expenses will show a higher gross margin than an otherwise identical competitor, without being more efficient.
- Early-stage distortion: startups often run underused infrastructure, so low margins may improve naturally with scale.
- AI compute costs: products built on large language models can carry materially lower margins than classic SaaS, and margins depend on inference prices.
- Capitalized costs: capitalizing software development shifts expense between periods and affects amortization inside cost of revenue.
- Ignoring trend: a stable 72 percent can be healthier than a falling 80 percent.
Gross margin should therefore be read as a trend and in context, together with retention and growth, rather than as a single number that settles whether a business is healthy.
Understanding it simply
Imagine selling lemonade for one dollar a cup. If lemons, sugar and cups cost 20 cents, you keep 80 cents from each sale before paying for your stand, your signs or your time. That 80 percent is your gross margin.
For a software company, the lemons and cups are mainly servers and customer support. Because copying software costs almost nothing, good software companies keep most of every dollar they earn. That leftover money pays for building new features and finding new customers, which is why a high gross margin makes growth easier.
Applied in practice
A B2B analytics startup earning 4 million dollars in annual recurring revenue prepared for a funding round. Its finance lead calculated a blended gross margin of 61 percent, well below what investors expected from software. A closer review showed two causes: oversized cloud clusters provisioned for peak loads that occurred only a few hours a week, and implementation consultants whose salaries were mixed into subscription costs.
The team separated professional services from subscription revenue, which revealed a subscription gross margin of 71 percent. Engineers then introduced autoscaling and moved steady workloads to committed-use pricing, cutting hosting costs by roughly a third over two quarters. Support added an in-product help center that reduced repetitive tickets.
Within six months, subscription gross margin reached about 79 percent. The company could now present investors with clean, comparable figures, and its lifetime value calculations, based on gross profit, became materially stronger.