Table of Contents >> Show >> Hide
- What gross margin means in a SaaS business (in plain English)
- Step 0: Decide what “revenue” you’re using (GAAP vs. SaaS metrics)
- The real work: What counts as SaaS COGS?
- What usually does not belong in COGS (aka “below the line”)
- How to calculate SaaS gross margin (step-by-step)
- Two concrete examples (with numbers, not vibes)
- Gross margin “flavors” SaaS companies should track
- Benchmarks: what’s a “good” SaaS gross margin?
- Common mistakes when calculating SaaS gross margin
- A monthly checklist you can actually use
- How to improve SaaS gross margin (without turning into a cartoon villain)
- Wrap-up: the simplest way to get SaaS gross margin right
- Field Notes: Experiences SaaS teams commonly run into (and what they learn)
- SEO Tags
Gross margin in SaaS is like the “checking engine light” for your business modelignore it long enough and you’ll eventually end up on the side of the road, googling “why is AWS billing me like I’m powering NASA?”
The good news: calculating SaaS gross margin is not complicated math. The tricky part is deciding what counts as “Cost of Goods Sold” (COGS) in a software business where you’re not literally shipping goods. This guide shows you the clean, investor-friendly way to calculate gross margin in SaaS, plus practical examples, common mistakes, and a real-world-style checklist you can use every month.
What gross margin means in a SaaS business (in plain English)
Gross profit is the dollars you have left after you pay the direct costs of delivering your service. Gross margin is gross profit expressed as a percentage of revenue.
The formula (the part you already suspected)
Gross Margin % = (Revenue − COGS) ÷ Revenue × 100
Think of it this way: if gross margin is 80%, you keep $0.80 of every $1.00 in revenue after paying the “keep-the-lights-on-for-the-product” costs. The remaining $0.80 funds sales, marketing, R&D, leadership, and whatever snacks keep your engineering team from revolting.
Step 0: Decide what “revenue” you’re using (GAAP vs. SaaS metrics)
SaaS companies talk about revenue in multiple dialects: GAAP revenue, ARR, MRR, billings, “bookings,” “the number I told the board last week,” etc. Gross margin can be calculated on different revenue definitions, but you must label it clearly.
Two common approaches
- Financial-statement gross margin (GAAP): Use recognized revenue for the period (not cash collected), aligned with ASC 606. This is the version auditors and many investors expect for comparability.
- Operational gross margin (MRR/ARR-based): Useful for dashboards and unit economics. Just be consistent, and don’t mix it with GAAP without a big, friendly warning label.
A practical rule: if you’re sending this metric outside the company (investors, lenders, acquirers), default to GAAP-style definitions or provide a reconciliation. Internally, use the version that best supports decisions (pricing, support staffing, cloud optimization).
The real work: What counts as SaaS COGS?
In SaaS, COGS is often called cost of revenue or cost of sales. It includes costs directly tied to delivering and maintaining the service customers are paying for. The key word is directly.
Most SaaS COGS buckets (the usual suspects)
- Hosting & infrastructure: cloud compute, storage, bandwidth, CDN, databases, observability/monitoring that’s required to run production.
- Customer support: support team wages/benefits, support tools/licenses, and related overhead if they’re primarily supporting existing customers.
- Production operations / DevOps / SRE: roles and tools required to keep the production environment running reliably.
- Third-party software & APIs used in service delivery: embedded vendors, usage-based APIs, security/compliance tooling that is required to operate.
- Payment processing fees (often): especially when you want your unit economics to reflect the real cost to collect revenue.
- Professional services costs (if you have services revenue): implementation, training, onboarding labor tied to services, travel for services, etc.
A surprisingly useful “common-sense” test
Ask: “If I stop paying this cost, can customers still access and use the product?” If the answer is “no,” it usually belongs in COGS. If the answer is “yes,” it’s usually an operating expense (Opex).
Where SaaS teams often disagree (and how to stay sane)
Some expenses live in the gray zoneespecially customer success, engineering, and security. GAAP leaves room for judgment, but investors dislike “creative” classification. Pick a policy, document it, and apply it consistently.
- Customer Success (CS): Many SaaS companies put a portion of CS in COGS if the work is required to deliver/maintain the service (onboarding, support-like activities). If CS is primarily expansion/upsell, it often belongs below the line.
- Engineering: “Keeping the current product running” (maintenance, reliability, bug fixes for production) may be considered part of cost to deliver. “Building future products/features” typically sits in R&D (Opex). Split if you can do it consistently.
- Security & compliance: If it’s essential to operate the production service (e.g., required controls, monitoring, compliance tooling), many teams treat it as cost of revenue. Policy matters more than perfection.
What usually does not belong in COGS (aka “below the line”)
These costs are typically considered operating expenses, not SaaS COGS:
- Sales & marketing: ads, SDR/AE salaries, commissions, marketing tools, events, brand work.
- General & administrative: finance, legal, HR, executive leadership, office expenses.
- Most R&D: new features, new products, long-term roadmap work (unless your policy allocates “maintenance engineering” to COGS).
How to calculate SaaS gross margin (step-by-step)
Here’s the repeatable monthly/quarterly process that keeps you out of “wait… why did our margin jump 12 points?” conversations.
Step 1: Pull your revenue number for the period
Use your chosen definition: GAAP recognized revenue (recommended for external reporting), or subscription revenue / MRR for internal tracking. If you’re using GAAP, ensure you’re treating refunds/credits/discounts consistently and not counting pass-through taxes as revenue if you present net of taxes.
Step 2: Assemble SaaS COGS for the same period
Build a simple cost-of-revenue rollup (cloud, support, ops, tooling, vendor APIs, payment fees, and services deliveryif applicable). If you can’t allocate everything perfectly at first, start with the biggest buckets (cloud + support) and improve monthly.
Step 3: Calculate gross profit
Gross Profit = Revenue − COGS
Step 4: Calculate gross margin percentage
Gross Margin % = Gross Profit ÷ Revenue × 100
Two concrete examples (with numbers, not vibes)
Example A: Blended (subscription + services) gross margin
Suppose your SaaS has $1,000,000 in subscription revenue and $100,000 in professional services revenue this year. Your direct costs are hosting/infrastructure $150,000, customer support $100,000, and product maintenance/dev costs $200,000.
| Item | Amount |
|---|---|
| Total Revenue | $1,100,000 |
| Total COGS | $450,000 |
| Gross Profit | $650,000 |
| Gross Margin % | 59.1% |
This is a great example of why SaaS teams often calculate subscription gross margin separatelyservices can drag down the blended number. If professional services are a strategic “implementation accelerator,” you may accept lower services margin, but you should measure it intentionally.
Example B: A clean monthly SaaS gross margin
Your B2B SaaS generates $100,000 in monthly recognized revenue. Direct costs: $12,000 cloud hosting, $8,000 customer support, $5,000 API/payment fees. Total COGS = $25,000.
Gross margin = ($100,000 − $25,000) ÷ $100,000 = 75%
Translation: you keep $0.75 per $1.00 to pay for growth and overhead. Your CFO will smile. Your cloud provider will still not send you a holiday card.
Gross margin “flavors” SaaS companies should track
1) Subscription gross margin (the headline act)
Many SaaS investors care most about subscription gross margin because it reflects the scalability of recurring revenue. Calculate it using subscription revenue and subscription-related COGS (exclude professional services revenue and its direct costs).
2) Total gross margin (the full meal deal)
If you sell services, hardware, or pass-through usage, track a blended total gross margin too. It answers: “Is the overall business economically healthy?” even if subscription margins look gorgeous.
3) Gross margin by segment or cohort (where the truth lives)
A single company-wide percentage can hide problems like: enterprise customers generating big contracts but consuming triple the support hours, or newer customer cohorts costing more to serve than older cohorts. Cohort gross margin analysis (by signup month/quarter or by customer segment) can reveal whether unit economics are improving as you scale.
Benchmarks: what’s a “good” SaaS gross margin?
Benchmarks vary by product complexity, customer profile, services mix, and how much of support/success you include in COGS. Still, a few ranges show up repeatedly in SaaS finance conversations:
- ~70%–80% is commonly cited as a healthy SaaS gross margin range (especially for many B2B SaaS models).
- ~75%+ is a frequent target for subscription gross margins in benchmark-style guidance.
- 80%+ is often considered “top-tier” efficiency for mature, well-optimized SaaS businesses.
Don’t treat benchmarks as a morality test. Use them as a diagnostic tool. If you’re below the typical range, it doesn’t mean your product is bad it means you need to understand why: heavy services mix, expensive infrastructure, high-touch onboarding, underpriced usage, or a product that’s basically a disguised consulting firm wearing a SaaS hoodie.
Common mistakes when calculating SaaS gross margin
1) “Our gross margin is 95%!” (aka missing costs)
If your gross margin is suspiciously high, you may be under-counting delivery costsoften support, customer success, or infrastructure tooling. Overstating gross margin can backfire in diligence when an investor recalculates it using a more standard COGS definition.
2) Mixing GAAP and operational definitions without labels
If you compute gross margin on MRR in January, then switch to GAAP recognized revenue in February, your trend line becomes financial fan fiction. Choose a definition per report and label it clearly.
3) Forgetting services drag (or hiding it)
Professional services margins are often much lower than subscription margins. Track them separately, or you’ll end up arguing with your own P&L.
4) No allocation policy for shared costs
Support managers, DevOps tooling, shared cloud accounts, and security spend can be hard to allocate. “Hard” isn’t an excuse to skip it. Pick reasonable allocation drivers (tickets, seats, revenue, usage) and keep them consistent over time.
A monthly checklist you can actually use
- Lock revenue: recognized revenue (or subscription revenue) for the month.
- Pull cloud costs: compute, storage, bandwidth, CDN, managed services, required monitoring.
- Pull delivery labor: support + (policy-based) portion of CS/DevOps/maintenance engineering.
- Pull vendor/service-delivery tools: APIs, embedded vendors, support tooling, security required for operations.
- Separate services: if you have implementation/training revenue, track its direct costs and margin separately.
- Calculate: gross profit and gross margin; then compare to last month/quarter and annotate changes.
- Sanity-check: if margin moved a lot, identify the “because” (usage spike, vendor price change, staffing shift, pricing change).
How to improve SaaS gross margin (without turning into a cartoon villain)
- Optimize infrastructure: right-size instances, reduce idle resources, fix noisy queries, use caching wisely, and align pricing with usage.
- Reduce support load: improve onboarding, docs, in-app guidance, and self-serve troubleshooting (fewer tickets = less COGS pressure).
- Make services intentional: productize implementation, time-box it, price it properly, or treat it as a separate line with clear targets.
- Audit third-party vendors: usage-based APIs and tooling creep is real. Renegotiate or replace tools that don’t justify their cost.
- Fix pricing leaks: if heavy users cost 3× to serve but pay the same as light users, your gross margin is quietly screaming for help.
Wrap-up: the simplest way to get SaaS gross margin right
Calculating SaaS gross margin is easy on paper and meaningful in practice: define revenue, define COGS, compute the percentage, and apply the same rules every month. The “win” is not just a numberit’s the ability to explain what drives the number and what you’ll do next.
If you can walk into a board meeting and say, “Gross margin dipped 3 points because usage grew faster than our pricing tiers; we’re updating packaging and optimizing our top three cloud cost drivers,” congratulations: you’re doing SaaS finance the way grown-ups do it.
Field Notes: Experiences SaaS teams commonly run into (and what they learn)
In many SaaS businesses, the first “gross margin experience” is a simple one: someone asks for the number, and the company realizes it has five different answers. The CEO has a slide that says 85%. Finance has a spreadsheet that says 72%. Engineering says “it depends how you count Kubernetes.” And customer success quietly suspects they’re being categorized as either “COGS” or “not-COGS” based on whoever last spoke loudest in a meeting.
The teams that get through this phase usually do two things: they pick a definition that matches how outside stakeholders evaluate SaaS companies, and they document it in a one-page policy. That policy doesn’t have to be fancy. It just needs to clarify what goes into cost of revenue (hosting, support, production ops, required tooling, and a consistent treatment of customer success and maintenance engineering). Once that exists, gross margin stops being an argument and becomes a management tool.
Another common experience: the “services surprise.” A SaaS company adds implementation to reduce churn and speed up time-to-value, then watches gross margin fall. The mature response is not panicit’s segmentation. Subscription gross margin can still be strong while services gross margin is lower. When teams split the numbers, they can decide whether services are a strategic investment (acceptable lower margin) or an accidental business line that needs pricing, time-boxing, and productization. Often, just measuring services margin separately changes behavior: travel gets controlled, scopes get tighter, and “free” onboarding quietly disappears.
Many teams also experience the “cloud bill growth spurt.” Revenue grows 20%, but hosting costs grow 45% because usage patterns changed, a new feature is compute-heavy, or a vendor shifted pricing. The best operators treat this as a product and pricing conversation, not just an engineering one. They identify the drivers (top workloads, biggest tenants, most expensive endpoints), then decide whether to optimize, re-architect, or reprice. Over time, the strongest SaaS companies learn to align pricing with cost drivers so gross margin doesn’t erode as they scale.
Finally, there’s the “diligence moment.” When fundraising or M&A comes up, investors often recalculate gross margin using standard assumptions. Teams that previously parked too many costs below the line discover that “95% gross margin” creates skepticism rather than excitement. The lesson most finance leaders take away: it’s better to show a realistic margin with a clear path to improvement than to show a too-good-to-be-true number that collapses under scrutiny. When a SaaS business can explain its gross margin policy, demonstrate consistency over time, and show cohort/segment insights, the conversation shifts from “Do we trust the metric?” to “How big can this get?”
