SaaS Gross Margin: Formula and Benchmarks (2026)
SaaS gross margin tells you how much revenue remains after the direct cost of delivering your software. It is one of the quickest tests of whether growth is improving your economics or merely increasing your cloud, support, and service bills.
The formula is simple. The accounting judgment is not. Put the wrong costs into COGS, mix subscription revenue with low-margin services, or compare unlike business models, and a clean-looking percentage can lead you straight into a bad pricing or hiring decision.
This guide gives you the formula, a worked example, practical 2026 benchmark ranges, and a repeatable way to calculate the metric from your billing and cost data.
SaaS gross margin formula
SaaS gross margin = (Revenue − Cost of Goods Sold) ÷ Revenue × 100.
Gross profit is the amount left in currency. Gross margin is that amount as a percentage of revenue. If monthly revenue is $100,000 and COGS is $22,000, gross profit is $78,000 and gross margin is 78%.
Use recognized revenue and the related costs from the same period. Do not divide this month’s annual prepayments by this month’s costs. That compares cash collection with service delivery and distorts the result.
Calculate the number monthly, then review a trailing three-month or twelve-month trend. A single month can move because of annual contracts, cloud credits, support hiring, or one-off implementation work.
What belongs in SaaS COGS?
COGS should contain costs required to deliver the service to current customers. Common categories are cloud hosting, storage, bandwidth, third-party APIs used by the product, payment processing tied to revenue, production monitoring, customer support, and direct implementation or professional-services labor.
For AI products, model inference, vector storage, data processing, and usage-based API fees deserve separate visibility. These costs can grow much faster than customer count, so a blended hosting line hides the part of the product that is eroding margin.
Sales and marketing, general administration, and product R&D usually sit below gross profit as operating expenses. New feature development is not the same as maintaining and delivering the current service. Your accounting policy should state the boundary and apply it consistently.
Customer success is the awkward category. SaaS Capital’s guidance puts support, enablement, and ongoing customer fulfillment in COGS, while renewal, expansion, and commercial account management belong in sales and marketing. If one team does both, allocate payroll using a documented rule instead of choosing whichever treatment makes the chart prettier.
Do not blindly copy another company’s COGS policy. Confirm the treatment with your accountant, especially for capitalized development, stock compensation, taxes, or audited reporting. The management metric is useful only when it reconciles to your financial statements.
SaaS gross margin benchmarks for 2026
For core SaaS license revenue, 80–85% is a strong benchmark. SaaS Capital reports that range across its portfolio and private-company survey data. Stripe describes more than 75% as generally good and less than 70% as a reason to investigate pricing or delivery costs.
Treat those numbers as reference points, not commandments. A product that resells telecom, payments, data, human services, or expensive AI inference can be healthy below 80%. A mature, low-support workflow product may reasonably run above it.
A practical interpretation is: 80% or higher indicates strong core-software economics; 70–80% is workable but worth segmenting; below 70% needs an explanation; and a falling margin matters more than missing a generic benchmark by two points.
Always separate subscription and professional-services margins when services are material. A 40% implementation margin can pull a healthy 84% software margin down to a mediocre-looking blended result. That does not make services bad, but it changes what the headline number means.
Benchmark against companies with similar delivery models, customer sizes, and revenue mix. Comparing a self-serve SaaS app with a managed data platform or communications API is accounting cosplay, not analysis.
Worked SaaS gross margin example
Assume a company records $180,000 of subscription revenue and $20,000 of implementation revenue in one month. Its direct costs are $18,000 for cloud infrastructure, $7,000 for third-party product APIs, $15,000 for support payroll, and $12,000 for implementation labor.
Total revenue is $200,000. Total COGS is $52,000. Gross profit is $148,000, so blended gross margin is 74%.
Now split the streams. If $40,000 of COGS supports the subscription product, its margin is 77.8%. The implementation business has $20,000 of revenue and $12,000 of direct labor, producing a 40% margin. The split immediately shows where pricing, automation, or scope control can help.
How to calculate SaaS gross margin from your database
1. Define one monthly revenue dataset
Create a monthly table or view with recognized subscription revenue, usage revenue, services revenue, credits, refunds, and customer identifiers. Keep cash collections separate. Tag each row by product, plan, region, and revenue type so you can segment the result later.
2. Bring direct costs to the same grain
Load cloud bills, model or API usage, payment fees, support payroll, and services labor for the same month. Whenever possible, attach a customer, workspace, product, or usage unit. Keep unallocated shared costs visible rather than silently dropping them.
3. Document allocation rules
Shared infrastructure might be allocated by compute usage, queries, storage, seats, or revenue. Support payroll might be allocated by ticket volume or customer time. Pick the closest causal driver, record the rule, and do not change it every month to manufacture a better trend.
4. Calculate blended and segmented margins
Start with the company total, then calculate margin by product, plan, cohort, and customer. Segments expose cross-subsidies. Your 80% company margin can conceal an enterprise plan at 90% and an underpriced usage-heavy plan at 45%.
5. Monitor the trend and trigger action
A spreadsheet is fine for the first calculation. It becomes fragile when billing, cloud, and support data change every day. Refresh the metric automatically and alert the owner when total margin falls below a threshold or a customer’s delivery cost jumps.
With AI for Database, you can ask your connected database questions such as “What was gross margin by plan for the last six months?” in plain English, save the result to a self-refreshing dashboard, and trigger an email, Slack message, or webhook when margin crosses your threshold. You still define revenue and COGS; the product removes the recurring SQL and reporting queue.
Five mistakes that make gross margin misleading
First, mixing billings with recognized revenue. Annual prepayments make the collection month look absurdly profitable and later months look weak.
Second, excluding support or infrastructure because the cost is salaried or prepaid. Payment timing does not decide whether a cost is required to deliver the service.
Third, putting all engineering payroll into COGS. Separate current-service operations and maintenance from new product development using a documented policy.
Fourth, reporting only a blended margin. Subscription, usage, implementation, and managed-service revenue often have very different economics.
Fifth, watching the company average but ignoring customers. Usage outliers can destroy contribution margin long before they move the blended number enough to attract attention.
How to improve SaaS gross margin
Start with segmentation, not a blanket cost cut. Find the product, plan, workload, or customer cohort causing the decline. Then decide whether the problem is price, usage policy, architecture, support load, or services scope.
Price usage-heavy features against the resource they consume. Add limits or overages where unlimited plans create uncapped delivery cost. Optimize high-volume queries and storage before negotiating tiny discounts on low-impact tools.
Reduce avoidable support through product fixes, better onboarding, and documentation. Do not simply make support harder to reach; that can improve one month’s margin while damaging retention and lifetime value.
For professional services, standardize packages, cap scope, and measure delivery hours. If services are deliberately low-margin because they accelerate large subscriptions, show that relationship explicitly rather than pretending the services line is healthy on its own.
Questions SaaS teams ask
What is a good gross margin for a SaaS company?
A core software margin of 80–85% is strong, while more than 75% is commonly considered healthy. Your best benchmark depends on whether you also deliver payments, data, telecom, AI inference, implementation, or human services.
Should customer support be included in SaaS COGS?
Yes, when the work is required to support and fulfill the current service. Renewal, upsell, and commercial account-management work generally belongs in sales and marketing. Split mixed roles using a consistent allocation rule.
How often should a startup calculate gross margin?
Calculate it monthly and review both the latest month and the trend. Usage-based or AI-heavy products may also monitor estimated margin weekly so a cost spike does not wait for the month-end close.
Can I track SaaS gross margin without writing SQL?
Yes. If revenue and direct costs are already stored in connected tables, AI for Database can query them in plain English, refresh a gross-margin dashboard, and send an alert when the result crosses a threshold.
Sources and next step
Benchmark and accounting references: Stripe, “SaaS gross margin explained” (https://stripe.com/resources/more/saas-gross-margin-explained-what-it-is-and-why-it-is-important); SaaS Capital, “What Should be Included in COGS for My SaaS Business in 2025?” (https://www.saas-capital.com/blog-posts/what-should-be-included-in-cogs-for-my-saas-business/).
Your next step is not another spreadsheet template. Define the revenue and COGS policy in one page, calculate the last six months by product or plan, and investigate the segment with the weakest trend. If the data already lives in your database, connect it to AI for Database and turn that calculation into a live operating metric.
Frequently asked questions
What is a good gross margin for a SaaS company?
A core software margin of 80–85% is strong, while more than 75% is commonly considered healthy. Adjust the comparison for delivery models that include payments, data, telecom, AI inference, implementation, or human services.
Should customer support be included in SaaS COGS?
Include support and success work required to fulfill the current service. Put renewal, upsell, and commercial account management in sales and marketing, and allocate mixed roles consistently.
How often should a startup calculate gross margin?
Calculate SaaS gross margin monthly and review the trend. Usage-based or AI-heavy products may also monitor an estimated weekly margin to catch cost spikes sooner.
Can I track SaaS gross margin without writing SQL?
Yes. If your revenue and direct costs are in connected tables, AI for Database can query them in plain English, refresh a dashboard, and alert you when margin crosses a threshold.