SaaS Gross Margin: What to Include in COGS
By Newtown Analytics · · 8 min read
For startup founders
SaaS gross margin is the share of subscription revenue left after the costs of delivering the service, and it sets the ceiling on how much a software company can spend on growth and still make a profit. A high gross margin means each new dollar of recurring revenue adds mostly profit. A low one means the company is partly a services or infrastructure business in disguise. The difficulty is deciding what belongs in the cost of revenue, because hosting is obvious and customer support, onboarding and third-party licenses are not. This guide sets out what to include, works through a full example with subscription and services lines and checked arithmetic, shows how a cost change flows through, explains margin per customer and lists the main levers. It belongs to unit economics and budgeting and forecasting, builds on the burn multiple and the SaaS magic number, and leads to expansion revenue and customer concentration risk.
What belongs in the cost of revenue
The principle is to include every cost that is needed to deliver the service to existing customers, and to exclude the costs of selling and building the product. Accounting policies vary and auditors have views, so confirm your classification with your accountant and apply it consistently.
| Cost | Usually in cost of revenue? | Notes |
|---|---|---|
| Cloud hosting and infrastructure for production | Yes | Includes storage, bandwidth and monitoring |
| Third-party software and data licenses built into the product | Yes | Per-user or usage-based fees paid to vendors |
| Customer support | Yes | Staff handling tickets from existing customers |
| Customer success (retention focus) | Often partly | Split between retention and expansion; the expansion share often goes to sales and marketing |
| Onboarding and implementation | Yes, often reported against services revenue | Staff who set up new customers |
| Payment processing fees | Yes, usually | Cost of collecting subscription revenue |
| Amortization of capitalized software | Often | Depends on accounting policy |
| Allocated facilities and IT for these teams | Yes | Part of fully loaded cost |
| Product development and engineering | No | Research and development |
| Sales and marketing | No | Cost of acquiring customers |
| General and administrative | No | Overhead |
Engineers who spend part of their time keeping production running may need to be split between cost of revenue and development. A time allocation based on a reasonable method, documented, is usually acceptable.
A worked example
A company with the following results for a year (hypothetical, in millions):
| Line | Subscription | Services | Total |
|---|---|---|---|
| Revenue | $8.0 | $1.0 | $9.0 |
| Hosting and infrastructure | -$1.2 | ||
| Customer support | -$0.8 | ||
| Third-party licenses in the product | -$0.3 | ||
| Implementation and onboarding team | -$0.9 | ||
| Cost of revenue | -$2.3 | -$0.9 | -$3.2 |
| Gross profit | $5.7 | $0.1 | $5.8 |
| Gross margin | 71.3% | 10.0% | 64.4% |
Check: subscription cost of revenue is 1.2 + 0.8 + 0.3 = 2.3; gross profit 8.0 - 2.3 = 5.7; margin 5.7 / 8.0 = 71.25 percent. Services: 1.0 - 0.9 = 0.1; 0.1 / 1.0 = 10 percent. Blended: cost 2.3 + 0.9 = 3.2; profit 9.0 - 3.2 = 5.8; 5.8 / 9.0 = 64.4 percent. Reporting only the blended 64.4 percent would hide that the subscription business earns 71 percent and the services business roughly breaks even. Investors and boards usually want the margins separately. When a company's services revenue grows faster than subscription revenue, its blended margin declines even if both lines are stable.
A cost change flows straight through
Suppose hosting costs rise by 10 percent, from $1.2 million to $1.32 million, with no change in revenue.
- Subscription cost of revenue = 1.32 + 0.8 + 0.3 = $2.42 million
- Subscription gross profit = 8.0 - 2.42 = $5.58 million
- Subscription gross margin = 5.58 / 8.0 = 69.75 percent, down from 71.25 percent, a drop of 1.5 points
The $0.12 million increase in cost reduces gross profit by the same amount and the margin by 1.5 points. Revenue growth that does not require proportional hosting spend improves the margin, and the reverse is also true: features that use a lot of compute (video, analytics, artificial intelligence workloads) can reduce the margin if they are included in a fixed price. Price those features on usage or tier to protect the margin.
Gross margin per customer
The aggregate margin hides differences between customers. Allocate hosting, support and licenses to customers by their actual use, where you can measure it, and compute a margin for each. A simplified example with three customer groups (hypothetical):
| Group | Annual revenue | Allocated cost of revenue | Gross margin |
|---|---|---|---|
| Large accounts | $4.0M | $0.9M | 77.5% |
| Mid-size | $3.0M | $0.9M | 70.0% |
| Small | $1.0M | $0.5M | 50.0% |
| Total | $8.0M | $2.3M | 71.25% |
Check: (4.0 - 0.9) / 4.0 = 77.5 percent; (3.0 - 0.9) / 3.0 = 70.0 percent; (1.0 - 0.5) / 1.0 = 50.0 percent; total cost 0.9 + 0.9 + 0.5 = 2.3, and 5.7 / 8.0 = 71.25 percent. Small customers consume a disproportionate share of support, and their margin is 50 percent. A change such as a self-serve support model, a minimum plan price or a premium support tier can fix it. Without the breakdown, the average gives no hint of the problem.
Why the margin matters
Gross margin determines how fast you can recover the cost of acquiring customers and how much room there is to invest. Return to the sales efficiency example: a dollar of new annual revenue at a 75 percent gross margin pays back in 1.33 years, and at 50 percent in 2 years, a 50 percent longer payback for the same sales effort. It also feeds valuation, since a dollar of recurring revenue at a higher margin is worth more. See the SaaS magic number and the Rule of 40.
Levers to improve gross margin
- Hosting efficiency. Right-size infrastructure, commit to reserved capacity where usage is predictable, remove unused resources and monitor cost per customer.
- Architecture. Reduce the compute needed per transaction.
- Vendor terms. Renegotiate licenses and data fees, or replace vendors.
- Support productivity. Improve documentation and self-service, fix the causes of tickets and use tiered support.
- Pricing and packaging. Charge more for features that cost more to deliver and set minimums for small accounts. See value-based pricing.
- Services mix. Price implementation to cover cost, use partners for low-margin work and productize repeatable setups.
- Contract terms. Annual prepayment lowers payment processing as a share of revenue and improves cash.
Reporting practice
Report subscription gross margin and services gross margin separately, and the blended margin. Show the trend over at least eight quarters. Document what is included in cost of revenue, and keep the definition constant. If the definition changes, restate prior periods. Compare with peers only when definitions match. Tie the figures to the general ledger and to the cloud bills each month.
Common mistakes
- Leaving support and onboarding out of cost of revenue.
- Reporting only the blended margin.
- Ignoring hosting growth as usage rises.
- Giving away compute-heavy features in flat-price plans.
- Changing classification to improve the margin.
- Not tracking margin by customer.
How classification choices change the margin
Customer success is a good example. Suppose the company has a customer success team that costs $1.0 million a year. The team does two things: it helps customers use the product and renew (retention work), and it identifies upsell opportunities for the sales team. Suppose 60 percent of its time goes to retention and 40 percent to expansion.
- If 60 percent, or $0.6 million, is classified as cost of revenue, subscription cost of revenue rises from $2.3 million to $2.9 million.
- Subscription gross profit becomes 8.0 - 2.9 = $5.1 million, and the margin is 5.1 / 8.0 = 63.75 percent, compared with 71.25 percent before.
The difference of 7.5 points comes from a classification decision and not from any change in operations. Two companies with identical economics can report quite different margins on this basis alone. This is why a clear policy matters, and why comparisons with other companies must be made with caution. When you report to investors or lenders, disclose which costs are included, and keep to it.
Unit cost metrics
Absolute margins are useful, and unit measures show where the cost is going. Dividing hosting cost by the number of customers, users or transactions gives a cost per unit that you can track over time. In the example, if the company has 400 customers, hosting costs $1.2 million / 400 = $3,000 per customer per year, and revenue per customer is $8.0 million / 400 = $20,000. Hosting is therefore 15 percent of subscription revenue (1.2 / 8.0), and a customer using twice the average compute would cost $6,000 a year to host, 30 percent of average revenue. Tracking cost per customer by segment shows which accounts are expensive to serve, and it supports pricing and packaging decisions. Support cost per ticket and tickets per customer give the same view for the support team.
A quarterly review checklist
- Reconcile cost of revenue to the general ledger, with hosting bills tied to the cloud invoices.
- Compare each line as a percentage of subscription revenue with the previous four quarters.
- Review the allocation of shared teams and update it if roles have changed.
- Calculate margin by customer segment and identify the lowest-margin group.
- Review upcoming vendor renewals and usage commitments.
- Check that new features and pricing have been tested for their effect on cost to serve.
- Write a short explanation of any movement of more than one point.
FAQs
What is SaaS gross margin?
Subscription revenue less the cost of delivering the service, divided by subscription revenue, where the costs include hosting, support, third-party licenses and similar items.
What should be included in SaaS cost of revenue?
Production hosting, third-party software built into the product, customer support, onboarding and implementation, and payment processing. Confirm with your accountant.
Why report subscription and services margins separately?
Services usually have much lower margins. A blended figure hides the economics of each business and changes when the mix shifts.
Does customer success count as cost of revenue?
Partly. The part focused on keeping customers running is often included. The part focused on selling expansion is often included in sales and marketing.
How can I improve gross margin?
Improve hosting efficiency, renegotiate vendor terms, increase support productivity, price costly features appropriately and set minimums for small accounts.
Keep reading
This article is for general information. It is not accounting, tax, legal or investment advice, and examples use illustrative numbers rather than client data. Confirm decisions that carry financial or legal consequences with a qualified professional.