What is Gross Margin?
Formula
Gross Margin % = (Revenue − Cost of Revenue) ÷ Revenue × 100
- Revenue
- Recognised subscription revenue for the period. Keep professional services on a separate line
- Cost of Revenue
- Infrastructure, third-party APIs and model inference, payment processing, support and customer success attributable to serving existing customers
Worked example
One month at a subscription business running $180,000 of MRR.
| Step | Value |
|---|---|
| 1Monthly recurring revenue | $180,000 |
| 2Hosting and infrastructure | $12,600 |
| 3Third-party APIs and model inference | $9,000 |
| 4Payment processing (3%) | $5,400 |
| 5Support and customer success | $14,400 |
| 6Total cost of revenue | $41,400 |
| 7Gross profit | $138,600 |
| 8Gross margin | 77% |
Result
77% gross margin: every $1.00 of MRR contributes $0.77 toward acquisition and operating costs. Reclassifying the customer success team out of cost of revenue and into operating expenses would report 85% instead — an eight-point improvement produced entirely by moving a line item, with no change in spending whatsoever.
What belongs in cost of revenue
For a subscription business, cost of revenue is everything required to keep the service running for customers who are already paying: compute, storage and bandwidth; monitoring, logging and security tooling that scales with usage; third-party APIs, data providers and model inference billed per call; payment processing and its fixed per-transaction fees; the support organisation; and the customer success headcount that serves existing accounts rather than closing new ones.
What does not belong: product engineering, general and administrative overhead, and sales and marketing — those sit below the gross-profit line and belong in CAC or operating expenses.
The judgement calls that move the number most
Customer success placement is the largest single lever, and as the worked example shows it can move reported margin by eight points or more without any change in spending. The usable test is what the team is paid to do: onboarding and adoption work that keeps existing customers alive is a cost of delivery; renewals and upsell work is closer to sales. Split the team's cost if it genuinely does both, decide once, and restate history when you change the rule.
Free tiers and trials consume real infrastructure. That cost is either an acquisition cost or a cost of revenue depending on how you treat non-paying users, but it is never zero, and a generous free tier can quietly take several points off margin.
Professional services — implementation, migration, bespoke work — usually run at far lower margin than software, sometimes near break-even. Blending them into one figure disguises both lines. Report subscription gross margin and services gross margin separately, and a blended figure only alongside them.
Why margin is the multiplier on everything else
Gross margin is not a standalone metric so much as a coefficient inside the others. LTV is ARPA over churn multiplied by margin. CAC payback is CAC over monthly revenue divided by margin. So a margin figure that is wrong by ten points carries a proportional error straight into both — and into the LTV:CAC ratio built on top of them. A company that misclassifies its support costs does not just report a flattering margin; it reports a flattering version of its entire unit economics, and it will over-invest in acquisition on the strength of it.
What moves gross margin over time
The traditional trajectory is upward: infrastructure gets cheaper per unit at scale, committed-use discounts land, support gets partly automated and fixed costs spread across a larger base.
Two forces push the other way, and both are worth watching monthly rather than annually. Mix shift toward usage-heavy customers raises variable cost faster than revenue when pricing is seat-based rather than usage-based. And AI features carry genuine marginal cost — inference is billed per token and does not amortise the way a database query does, so a product that adds a generous AI capability to an existing flat-rate plan converts a fixed cost base into a variable one. This is a structural change to subscription margins rather than a temporary expense, and it should be modelled per plan rather than absorbed into an overall figure.
Reporting it so it stays comparable
Define cost of revenue once, write the definition down, and restate history whenever you change it. Track margin by plan and by segment alongside the headline, because a blended margin hides the plan that is losing money on infrastructure. And check it against ARPU: at low price points, fixed per-transaction payment fees consume a share of revenue that becomes invisible in a blended percentage.
Where Gross Margin goes wrong
- Moving support or customer success out of cost of revenue to improve the reported figure. Nothing changed except the presentation, and every downstream metric — LTV, payback, LTV:CAC — is now overstated by the same proportion.
- Ignoring payment processing fees. At around 2.9% plus a fixed per-transaction charge, a low-priced subscription can lose five to eight percent of its revenue to processing, which is invisible until you compute margin per plan rather than in aggregate.
- Blending a low-margin professional services line into subscription revenue. The combined figure describes neither business, and it usually hides that services are being delivered close to break-even.
- Treating free-tier and trial infrastructure as costless. It is real spend serving non-paying users, and whether you classify it as acquisition cost or cost of revenue, leaving it out overstates margin.
- Changing the cost-of-revenue definition without restating history. The margin series becomes a record of your accounting decisions rather than of your business, and the trend it shows is an artefact.
Typical ranges
Public SaaS companies commonly report subscription gross margins in the seventies and low eighties, with infrastructure-heavy and inference-heavy products sitting meaningfully lower and businesses carrying a large professional-services line reporting a blended figure well below their software margin. Treat this as a directional range read from published SaaS financials rather than a target: the comparison that carries information is your own margin by plan, tracked on a stable definition.
Source: Directional range from publicly reported SaaS subscription margins
Related
Metrics that move with this one
No metric explains a business on its own. These are the figures that qualify, offset or explain Gross Margin.
Customer Lifetime Value (LTV)
Customer lifetime value (LTV, also written CLV or CLTV) is the total gross profit a business expects to earn from one customer across the whole of their relationship. The standard subscription estimate divides average revenue per account by the customer churn rate and multiplies by gross margin, but that formula assumes every customer has the same constant probability of cancelling every month — an assumption real cohorts violate — so LTV is a directional planning input rather than a measured figure.
Learn moreCAC Payback Period
CAC payback period is the number of months of gross profit it takes a new customer to repay the cost of acquiring them, calculated as customer acquisition cost divided by new-customer monthly recurring revenue multiplied by gross margin. Because it measures how fast acquisition spend returns as cash rather than how much it eventually returns, it constrains how quickly a company can grow without outside capital far more directly than the LTV:CAC ratio does.
Learn moreLTV to CAC Ratio (LTV:CAC)
The LTV:CAC ratio divides customer lifetime value by customer acquisition cost to express how many times over an average customer repays the cost of winning them. A ratio around 3:1 is the conventional target for venture-backed SaaS; below 1:1 the business loses money on every customer it acquires, and a very high ratio usually signals under-investment in growth rather than exceptional efficiency.
Learn moreAverage Revenue Per User (ARPU)
Average revenue per user (ARPU) is monthly recurring revenue divided by the number of active paying customers, giving the blended monthly value of a single account. It is frequently written ARPA — average revenue per account — and the distinction matters for any product where one account contains several seats, because dividing by seats and dividing by accounts produce different numbers and answer different questions.
Learn moreBurn Rate
Burn rate is the rate at which a company consumes cash, usually stated per month. Gross burn is total cash operating outflow; net burn is gross burn minus cash collected, and net burn is the figure that determines runway. Because burn is a cash measure rather than an accounting one, a company can post an accounting loss while burning very little, or post a small loss while burning heavily.
Learn moreMonthly Recurring Revenue (MRR)
Monthly recurring revenue (MRR) is the monthly-normalised value of every active paid subscription at a point in time: monthly plans at face value, quarterly plans divided by three, annual plans divided by twelve, plus recurring add-ons and less active discounts. It is a snapshot of contracted run rate rather than an accounting figure, so it deliberately excludes one-off charges, setup fees, usage overages and refunds, and it has no definition in GAAP or IFRS.
Learn moreGross Margin: frequently asked questions
What counts as cost of revenue for a SaaS business?
Does customer success belong in COGS?
What is a good SaaS gross margin?
Do payment processing fees go in cost of revenue?
How does gross margin affect LTV and CAC payback?
Why is our gross margin falling as we add AI features?
Stop recalculating Gross Margin by hand.
Connect Stripe and Bastle computes this metric — and the rest of the glossary — against your own billing history, with the definitions under your control. Free while in beta, no card required.