Research-based overview. This article synthesizes financial reporting practice from public SaaS earnings filings, gross-margin benchmarks published by SaaS Capital, Bessemer’s Cloud Index, and OpenView’s annual SaaS Benchmarks, plus published unit-economics breakdowns from AI-SaaS operators. How we research.

One-sentence definition
Gross margin is the percentage of revenue that remains after subtracting the direct cost of delivering your product (the cost of goods sold, or COGS) — for SaaS, that means hosting, payment processing, AI API spend, and the other costs that scale roughly in line with usage, expressed as a percentage of revenue.

Gross margin is the single most-cited SaaS health metric after revenue itself, and the one solo founders most consistently calculate wrong. The math is one line of arithmetic, but the line depends entirely on which costs you put on which side of the equation — and that decision drives every downstream number an investor or acquirer will use to value your business. A SaaS quoting 90% gross margin is in one valuation regime; the same business calculated as 55% is in another regime entirely.

Gross margin matters more for SaaS than for almost any other model because SaaS, classically, has an almost-zero marginal cost to serve another customer. That is the structural reason public SaaS companies trade at 8 to 15 times revenue while services businesses trade at 1 to 3 times. The gross-margin number tells investors which regime a business is operating in — whether it is truly software-economic or whether it has services cost dynamics dressed up in a SaaS UI.

The formula

The formula is mechanical:

Gross Margin % = (Revenue - COGS) / Revenue × 100

Both inputs are dollars over the same period, usually a month or a year. The output is a percentage. A gross margin of 90% means that for every $100 of revenue, you keep $90 after the direct costs of delivering the product, before you have paid yourself, marketed, or built anything new.

Worked examples

Two concrete examples make the math — and the AI-SaaS difference — visible:

ScenarioMRRMonthly COGSGross profitGross margin
Classic SaaS — project management app on Vercel + Postgres$10,000$1,000 (hosting $700, Stripe fees $300)$9,00090%
AI SaaS — AI writing tool reselling Claude tokens$10,000$5,000 (Anthropic API $4,000, hosting $700, Stripe $300)$5,00050%

Both businesses pull in $10K MRR. Both look identical at the top line. The classic SaaS has $9K per month to spend on everything not in COGS — salary, marketing, product, taxes — before it loses money. The AI SaaS has $5K. That gap compounds the moment either business tries to hire or scale marketing. This is why AI SaaS unit economics dominate the operator conversation in 2026 — covered in depth in the true cost of running an AI SaaS.

What counts as COGS for SaaS

The hardest part of calculating gross margin is deciding what goes in the COGS bucket. SaaS accounting practice has converged on a specific rule: COGS includes costs that scale with revenue or usage; everything else is operating expense. The line gets fuzzy in places, but the core list is well-established.

In COGS

Not in COGS

The distinction matters because operating expenses are decisions you make about how to run the business; COGS is the cost of the business existing at all. A SaaS can cut marketing spend and grow more slowly; it cannot cut COGS without delivering a different (and likely worse) product.

Industry benchmarks

Gross-margin benchmarks for SaaS have been consistent for the past decade, with one major exception that arrived in 2023 and reshaped the conversation:

Gross margin vs operating margin vs net margin

Three margin metrics get used interchangeably in casual conversation and mean very different things in financial analysis:

Gross margin is the upstream number. It bounds what operating margin can ever be. A SaaS with 50% gross margin literally cannot have a 60% operating margin no matter how lean the operating budget gets. Gross margin is the ceiling.

Why solo founders mis-measure it

The same four mistakes show up in nearly every founder gross-margin calculation that is off:

1. Counting founder salary as COGS

If the founder runs the support inbox, fixes bugs, and handles onboarding, it feels like their time is delivery cost. Accounting disagrees: founder time is operating expense because it does not scale linearly with customer count. A founder running 50 customers and a founder running 500 customers can be the same one person, drawing the same salary. That is the test.

2. Forgetting Stripe fees

Stripe takes roughly 2.9 to 3.4 percent of revenue plus 30 cents per transaction — about 4 to 5 percent of revenue on a $20/month plan. Founders often forget to subtract this, inflating gross margin by 3 to 5 percentage points. The difference between 90% and 85% is the difference between best-in-class and merely-healthy framing.

3. Forgetting AI API costs in AI-SaaS calculations

The most consequential modern mistake. AI-SaaS founders sometimes report gross margin numbers that ignore inference cost, treating API spend as R&D rather than per-request COGS. When diligence happens the correction is brutal: 90% becomes 55%, the SaaS multiple becomes a services multiple, and the valuation conversation restarts at a third of the original number.

4. Counting Sentry, PostHog, and Loops as COGS

Usage-based pricing makes monitoring and analytics tools feel like COGS. They are not, by the scaling test: you pay roughly the same for Sentry at 100 or 200 customers because the volume is driven by your codebase, not your user base.

Why the number drives valuation

Gross margin is the metric that decides which industry multiple gets applied to your revenue at exit. Public-market data from the past decade is consistent:

The implication is dollars-and-cents real. A SaaS at $5M ARR with 85% gross margin is worth roughly $40M to $75M to an acquirer. The same $5M ARR business at 55% might fetch $15M to $30M. Getting your COGS line right is, at exit, worth tens of millions of dollars.

The strategic implications

Gross margin also bounds what marketing budget a business can sustain. The math:

This is why AI-SaaS operators obsess over the four levers that move gross margin: prompt caching, batch APIs, model routing, and output discipline. Each can add 5 to 15 percentage points, and each point unlocks marketing budget that does not exist otherwise. The true cost of running an AI SaaS walks through each lever with numbers.

How to improve gross margin

Beyond the AI-specific levers, the general moves for SaaS gross-margin improvement are well-established:

The honest takeaway for solo SaaS

For a SaaS below $10K MRR, gross margin matters mechanically but not strategically. A founder at $5K MRR worrying about 88 versus 84 percent is optimizing the wrong number — five points of margin there is $250 a month, which does not change any decision. At that stage the metrics that move the business are absolute MRR growth, churn, and trial-to-paid conversion. Gross margin is something to track for literacy, not optimize. The exception is AI SaaS, where bad gross-margin math at $5K MRR becomes a structural problem at $50K MRR.

The rule for the solo founder: get the calculation right (founder salary out, Stripe fees in, API costs in, internal tools out). Track the number. Do not optimize it until your revenue is large enough that a few percentage points means dollars you would otherwise spend on growth. The SaaS metrics that matter guide walks through the staged version per MRR band, the complete guide to SaaS pricing covers top-of-funnel levers, and the complete guide to SaaS analytics ties gross margin to the rest of the dashboard. ARR, ACV, and the Rule of 40 all live downstream of gross margin — get this one right and the rest become tractable.

Get one SaaS build breakdown every week

The stack, prompts, pricing, and mistakes to avoid — for solo founders building with AI.