SaaS gross margin: the formula, what counts and real benchmarks

SaaS gross margin is revenue minus cost of revenue, divided by revenue. Cost of revenue includes hosting, customer support, the people who deliver the service and third-party software the product runs on. Sales, marketing and most engineering stay out. Benchmarkit's 2025 survey found a median of 81% on subscription revenue and 77% on total revenue, and Stripe says under 70% can worry investors.

Updated · 5 min read · By the Accountable team

The short version

  • Gross margin equals (revenue - cost of revenue) ÷ revenue.
  • Cost of revenue covers hosting, support, service delivery and third-party software the product needs, while sales, marketing, research and general costs stay out.
  • Benchmarkit's 2025 medians are 81% for subscription, 77% for total and 30% for professional services.
  • Report subscription margin and services margin apart, because services drag the total down.
  • A gross margin below 70% is the level where Stripe says investors start to worry.

Gross margin is revenue minus cost of revenue, divided by revenue

Gross margin shows how much of each revenue dollar is left after the direct cost of delivering the product. The formula is (revenue - cost of revenue) ÷ revenue, shown as a percentage. Cost of revenue is also called cost of goods sold, or COGS.

It matters because gross profit has to pay for sales, marketing, engineering and everything else. A company at 80% has 80 cents of each dollar to spend on growth. A company at 60% has 60 cents.

A startup with $1.15 million of revenue and a 68.3% gross margin

The company sells subscriptions and also charges for onboarding. Here is a year of its numbers.

Revenue, cost of revenue and gross margin for one year
LineAmountMargin
Subscription revenue$1,000,000
Services revenue (onboarding)$150,000
Total revenue$1,150,000
Cloud hosting$90,000
Third-party services inside the product (AI models, email, SMS)$50,000
Payment processing fees$29,000
Customer support team$100,000
Subscription cost of revenue$269,000
Onboarding team$95,000
Total cost of revenue$364,000
Subscription gross margin$731,00073.1%
Services gross margin$55,00036.7%
Total gross profit$786,00068.3%

The company is under the medians, and the table shows why: services run at 36.7% and they are 13% of revenue. The next sections show the benchmark and the levers.

What goes in cost of revenue and what stays out

Stripe's guide lists hosting and infrastructure, customer support, development and maintenance of the live product, usage-based cloud costs and professional services delivery as cost of revenue, and says sales, marketing, general administration and research and development do not belong. SaaS Capital's survey also breaks out hosting and DevOps as cost-of-revenue lines. Companies differ on the edges, so choose a rule and keep it the same every month.

Common SaaS costs and whether they belong in cost of revenue
CostIn cost of revenue?Why
Cloud hosting and storageYesIt runs the product for customers.
Third-party APIs the product callsYesThey scale with usage.
Customer support salaries and toolsYesThey keep customers using the product.
Onboarding and implementation staffYes, as services costThey deliver a paid service.
Engineers who keep the live product running (DevOps)YesThey operate the service.
Payment processing feesUsually yesThey rise with each charge. Keep the same rule every month.
Engineers building new featuresNoThat is research and development.
Sales, marketing and commissionsNoThey win customers rather than serve them.
Finance, legal and general administrationNoThey run the company, not the product.

Benchmarks: 81% for subscription, 77% in total and 30% for services

SaaS gross margin benchmarks from published sources
MeasureBenchmarkSource
Subscription gross margin, median81%Benchmarkit 2025
Total gross margin, median77%Benchmarkit 2025
Professional services gross margin, median30%Benchmarkit 2025
Considered good75% or moreStripe
Exceptional80% or moreStripe
Investors may worryBelow 70%Stripe
Acceptable early on50% or moreStripe
Median hosting cost5% of annual recurring revenueSaaS Capital 2026
Median DevOps cost4% of annual recurring revenueSaaS Capital 2026
Median professional services cost of revenue5% of annual recurring revenueSaaS Capital 2026

Benchmarkit notes that professional services are about 15% of revenue at the median, and that when services exceed 15% to 20% of revenue, or services margin falls under 30%, total margin usually drops below 77%. SaaS Capital's figures come from a March 2026 survey of more than 1,000 private B2B SaaS companies.

Report subscription margin and services margin separately

Investors value subscription revenue at a higher multiple than services revenue, so they ask for the two margins apart. In the example, total margin is 68.3%, but subscription margin is 73.1% and services margin is 36.7%. Showing only the total hides that the recurring business is healthier than the blend.

Split revenue into subscription and services accounts, and split cost of revenue the same way, so the profit and loss can show both margins without a spreadsheet. The account setup is in startup chart of accounts.

Four levers raise gross margin, and each has a number

  • Hosting: a 10% cut in cloud spend saves $9,000 and lifts total margin from 68.3% to 69.1%.
  • Services price: onboarding costs $95,000 to deliver. Charging $190,000 instead of $150,000 raises services margin from 36.7% to 50%, and total margin from 68.3% to 69.4% with subscription revenue unchanged: ($1,190,000 - $364,000) ÷ $1,190,000.
  • Support load: fixing the top three causes of tickets lets the same team serve more customers, so cost grows slower than revenue.
  • Usage-priced costs: pass AI and messaging costs through in your pricing, or cap them per plan, so one heavy customer does not sink the margin.

Questions founders ask

What is a good gross margin for a SaaS company?

Stripe calls 75% or more good, 80% or more exceptional and under 70% a concern. Benchmarkit's 2025 medians are 81% for subscription revenue and 77% for total revenue.

What is included in SaaS cost of revenue?

Hosting, customer support, service delivery staff, third-party software the product runs on and the engineers who operate the live service. Sales, marketing, general costs and new-feature engineering stay out.

Is customer support in cost of revenue?

Yes, most SaaS companies include customer support and customer success costs in cost of revenue, because they keep the service running for customers.

Is gross margin the same as net margin?

No. Gross margin subtracts only the direct cost of delivering the product. Net margin subtracts every cost, including sales, marketing, research and administration.

How do I calculate gross margin in dollars and percent?

Gross profit in dollars is revenue minus cost of revenue. Divide it by revenue for the percent. In the example, $1,150,000 - $364,000 = $786,000, and $786,000 ÷ $1,150,000 = 68.3%.

Gross profit is already on your profit and loss

Accountable's Profit and loss has a Gross profit row and a % of revenue view, so your margin is on the statement once hosting and support are coded to cost of revenue. Reports › Analysis breaks cost of revenue down further.

Start free