How should I calculate SaaS gross margin?

Metrics, retention and the organization · Answered by Golden Section from more than 400 B2B software companies observed

The Golden Section answer

Take total revenue, subtract every cost of delivering it, and divide by total revenue. Cost of revenue includes hosting, embedded third-party licenses, AI inference, customer support, and the implementation and services staff who deliver onboarding; it excludes R&D and sales and marketing. Report subscription and services margins separately with a blended figure beside them, because a buyer will compute the blend anyway. If AI is in the product, line out AI inference revenue and inference cost of revenue separately where you can, and track one against the other every month. As a reference, we look for gross margin above 65% with a path to 75% or better, and the median public B2B software company runs about 76%. Start by moving support and implementation payroll into cost of revenue if it sits in operating expense.

The decision rule

Report gross margin after implementation and support costs, blended and by revenue type, every month. Where AI is in the product, report AI inference revenue and cost as their own lines and track that margin over time. Judge services on customer outcomes with margin as a floor.

The numbers

MetricValueWhat it meansSource
Median public B2B software gross margin76%gross profit ÷ revenue69% for product-led and SMB software; each point below 80% comes directly off the steady-state cash-flow ceilingGolden Section, publishedInvesting in Software addendum, September 2026
What great looks like72%+gross marginBalanced Path benchmarkGolden Section, publishedThe Balanced Path
GS equity screenabove 65%, path to 75%+gross marginWhat we look for at investmentGolden Section, publishedGrowth Equity
GS lending minimums65%; 68%+ for term loansgross marginBelow 65%, most SaaS companies struggle to service debtGolden Section, publishedGrowth Capital Lending
AI product gross margin52% median (2026)gross margin on AI-delivered productsICONIQ State of AI; we underwrite AI-delivered revenue separately at 50–60%Golden Section, publishedInvesting in Software addendum, September 2026

Why

Gross margin sets how much of each new dollar is available to pay for growth and, eventually, to become cash flow. In the mature public software companies our research examined, every one above 30% cash-flow margin had gross margin at or above 80%. So the definition is not a technicality. A company that books support and onboarding staff in operating expense reports a margin in the 80s while its true blended margin sits much lower, and a lender or buyer who finds the gap reprices everything. The P&L explained play walks the line items; implementation hours tracking gives you the labor data to allocate cost honestly.

AI deserves its own lines. Gross margin benchmarks are changing as inference enters the cost base, and buyers will inspect whether AI revenue scales, whether it sticks, and what it implies for the blend. You can answer only if AI inference revenue and cost are separated and tracked over time; the AI pricing model play covers how pricing choices move that line.

Services need a different lens. Where your advantage is what your team knows about the vertical, value pinnacle services should be judged on customer outcomes, with margin as a floor. When customers use your people more than your product, the business has become a services firm.

Illustrative scenario

A $4M company reports 84% gross margin. Its cost of revenue contains hosting and licenses only; six support and implementation staff costing $620K sit in operating expense, and $700K of revenue is implementation and training fees. Moving that payroll into cost of revenue gives a blended margin near 69%, with subscription at about 80% and services near 11%. The CEO reprices implementation from tracked hours, packages training into fixed-price units and reports all three margins monthly. Blended margin reaches 73% within a year. All figures are invented for illustration.

When this does not hold

Companies early in adding AI features may see margin fall before inference costs decline; show AI revenue and inference cost as their own lines rather than blending them away. Payments or embedded-finance revenue should be reported net or separately, since pass-through volume distorts margin.

What to do on Monday

  1. Move support, implementation and onboarding payroll into cost of revenue
  2. Split revenue and cost of revenue into subscription and services lines
  3. Line out AI inference revenue and inference cost separately and chart them against each other monthly
  4. Track implementation hours by customer for the next two quarters
  5. Report blended, subscription and services margin every month

Mistakes founders make here

From the Golden Section mistakes list, each paired with the play that prevents it.

Mistake 155: Services Should Support Product, Not Replace It

When services replace product, gross margin falls and the company stops being valued as software.

Mistake 164: Optimizing services for margin instead of customer outcomes

Pushing services toward software-level margin can cost the customer outcomes that drive retention.

Mistake 85: Ignoring rev-rec

Without a GAAP revenue recognition policy, revenue and margin by type cannot be stated reliably.

Plays we would run

In the order we would run them. Each is on its own page, most with a free Excel template.

P&L Explained

Sets up the P&L structure so cost of revenue is complete.

Implementation Hours Tracking

Tracks implementation hours so services cost and pricing rest on data.

Value Pinnacle Services

Packages services so they are sold repeatably and judged on outcomes.

Unit Economics

Carries the true gross margin into CAC payback and lifetime value.

AI Pricing Model Selection

Decides whether AI is bundled, metered or priced on outcomes, which shapes the AI revenue and inference cost lines you track.

Sales & marketing plays The P&L and unit economics plays live here and connect gross margin to every downstream SaaS metric.

Questions this page answers

What is a good gross margin for B2B SaaS?

Blended margin above about 72% is strong for vertical software with a services layer, and subscription margin should sit near software norms of 75% to 85%. We invest above 65% with a path to 75% or better and lend from 65%.

Should customer support be in cost of goods sold?

Yes. Support that keeps delivered software working for customers is a cost of delivering revenue, and buyers will move it there in diligence if you have not. Customer success aimed at expansion can sit in sales and marketing if you define it that way consistently.

How does AI affect SaaS gross margin?

It adds a cost that rises with usage, and AI products currently run far below traditional SaaS margins. Line out AI inference revenue and inference cost separately, track that margin over time, and price AI features to cover it. Buyers will look at how AI revenue scales and sticks, so model margin at three times current usage.

Funding the next stage

Gross margin computed after implementation and support is one of the first numbers both our lending and equity teams check. Getting the definition right before a conversation avoids a repricing during one.

Talk to Golden Section →

Reviewed by Dougal Cameron, CEO & Co-Founder on 2026-09-23. Golden Section observations are labeled separately from external benchmarks and illustrative arithmetic.