Gross margin: what it is, how to calculate it and what is healthy in SaaS
By Tiago Costa · Updated on July 9, 2026

Definition
Gross margin is the share of revenue left after the direct cost of delivering the service: (revenue minus COGS) divided by revenue.
- Formula: (Revenue - COGS) / Revenue, as a percentage.
- Pure SaaS usually runs 70% to 85% or more.
- It is the base of LTV and of the ability to reinvest.
What gross margin is
Gross margin measures how much of each dollar of revenue is left after paying the direct cost of delivering the service. It is revenue minus COGS (the cost of goods sold), divided by revenue, expressed as a percentage. In a SaaS, it answers a simple question: of every $100 that comes in, how much remains before paying sales, marketing, product and overhead?
Unlike a factory, a SaaS has almost no raw-material cost. What delivers the product is cloud infrastructure, support and a few third-party fees. That is why a pure SaaS tends to run a high gross margin, in the 70% to 85% range or above, and it is exactly that headroom that sustains the model and funds reinvestment in growth.
How to calculate gross margin
The formula is direct: take the revenue for the period, subtract COGS and divide the result by revenue.
- Gross margin = (Revenue - COGS) / Revenue.
- The numerator (Revenue - COGS) is gross profit in absolute value.
- Multiply by 100 to read it as a percentage.
Example: a SaaS with $1 million in revenue and $200k of COGS has $800k of gross profit and an 80% gross margin. The sensitive part is not the arithmetic, it is what you put in COGS: if costs that do not belong there sneak in, the margin looks worse than it is; if real costs are left out, it looks better.

What belongs in SaaS COGS
COGS for a SaaS gathers only the costs directly tied to delivering and running the service for customers who already pay. The rule of thumb: if a cost grows when you serve more customers, it is probably COGS; if it would exist with no new customers at all, it probably is not.
- Hosting and cloud infrastructure (servers, database, CDN, storage).
- Customer support and customer success tied to the running service.
- Payment processing and third-party fees embedded in the service.
- Onboarding costs and the on-call team that keeps the product up.
Left out of COGS are the costs of selling and growing (marketing, sales commissions) and of building the product (R&D, engineering of new features). Those sit lower in the income statement and affect operating margin, not gross.
Gross, contribution and operating margin
The three margins measure what is left at different layers of the income statement, and confusing them leads to wrong decisions.
- Gross margin: revenue minus COGS. What is left after the cost of delivering.
- Contribution margin: also removes the variable costs of selling that specific customer or product. Useful for pricing and mix decisions.
- Operating margin: goes down to after all operating expenses (sales, marketing, R&D, admin). It shows whether the whole business turns a profit.
Gross margin is the ceiling: none of the others can be higher than it. That is why it is the first number to look at. A low gross margin caps everything that follows, no matter how efficient the operation is.
What a healthy SaaS gross margin looks like
For pure SaaS, the reference band tends to sit between 70% and 85%. Software companies with strong operating leverage can push past 85%, while businesses with a heavy services component, intense infrastructure use or third-party resale land below. The private SaaS benchmarks published by KeyBanc and by Benchmarkit consistently show the median SaaS gross margin comfortably above 70%.
A margin persistently below 70% is not automatically a problem, but it is a signal to investigate: cloud costs growing faster than revenue, too much manual service baked into delivery, or prices that do not keep up with the cost to serve. Tracking gross margin over time matters more than any single month. The 2024 SaaS benchmarks compiled by Benchmarkit are a useful reference point.

Why gross margin underpins LTV and valuation
Gross margin is the bridge between revenue and value. It goes straight into the LTV / CLV calculation: the lifetime value of a customer is the revenue they generate times the gross margin, because only the part left after the cost to serve is real profit. Two SaaS with the same ticket but margins of 80% and 50% have very different LTV.
That is why gross margin weighs so heavily in company valuation. Funds such as Bessemer look at gross margin to understand how much of each dollar of growth converts into reinvestable cash, and revenue multiples tend to be higher for high-margin businesses. The private SaaS survey by KeyBanc Capital Markets reinforces this logic: strong gross margin and good retention go together in the companies that grow most efficiently. A healthy margin is what gives room to reinvest in acquisition and product without burning cash.
Frequently asked questions
Gross margin is the share of revenue left after the direct cost of delivering the service: (revenue minus COGS) divided by revenue, as a percentage.
Subtract COGS from revenue and divide by revenue. A SaaS with $1M in revenue and $200k of COGS has an 80% gross margin.
Pure SaaS usually runs 70% to 85% or more. Below 70% is worth investigating; the median in SaaS benchmarks sits comfortably above 70%.
Gross profit is revenue minus COGS in absolute value. Gross margin is that same gross profit expressed as a percentage of revenue.
Gross margin removes only COGS; net margin removes all expenses, taxes and interest. Gross is the ceiling, net is the bottom line.
Hosting and cloud infrastructure, customer support tied to the service, payment and third-party fees, and onboarding. Marketing, sales and R&D do not.
Related concepts

COGS
COGS (Cost of Goods Sold) is the direct cost of delivering a SaaS service: hosting and infrastructure, customer support, third-party fees and payment processing. It does not include sales, marketing or R&D, which are OpEx. It is the base of gross margin: revenue minus COGS equals gross profit.

Contribution margin
Contribution margin is revenue minus variable costs, measured per unit or in total. It is what each sale leaves over to cover fixed costs and, after that, become profit. Unlike gross margin, which subtracts all of COGS, it isolates only what changes with volume, which is why it underpins break-even analysis and pricing decisions.

Operating margin
Operating margin is operating profit divided by revenue: how much of each dollar of revenue is left after paying the cost of service (COGS) and operating expenses (OPEX), before interest and taxes. It measures the profitability of the operation itself, with no effect from capital structure or taxes. In SaaS, it is the profitability component that adds to growth in the Rule of 40.