Gross margin %
What is SaaS gross margin?
SaaS gross margin is the percentage of subscription revenue left after paying the direct costs of delivering your software, such as hosting, third-party APIs, AI inference, payment processing, and customer support. A SaaS company with $890,000 in revenue and $195,000 in cost of revenue has a gross margin of about 78%. Founders, CFOs, investors, and boards use gross margin to judge how scalable a SaaS business is, calculate LTV and CAC payback, and spot rising infrastructure or support costs.
Gross margin %
(Revenue − cost of revenue) ÷ revenue × 100
Embed this free calculator on your website—copy the snippet after signup and keep the Built with Calclet link for attribution (or upgrade to remove branding).

SaaS gross margin formula
Subtract cost of revenue from subscription revenue, divide by revenue, and multiply by 100.
Gross margin (%) = (Subscription revenue − Cost of revenue) ÷ Subscription revenue × 100- Gross profit = Subscription revenue − Cost of revenue.
- Maximum cost of revenue for a target margin = Revenue × (1 − Target margin).
- Gross-margin-adjusted LTV = Monthly ARPA × Gross margin ÷ Monthly churn rate.
Inputs explained
Use recognized revenue and the same cost of revenue definition each period so gross margin trends are meaningful.
- Period subscription revenue ($)
- Recognized subscription revenue for the period after refunds and credits, not bookings or contract value signed in your CRM.
- Cost of revenue ($)
- Direct costs of delivering the product: cloud hosting, third-party APIs and AI model fees, payment processing, customer support, and onboarding staff. Exclude R&D, sales, and marketing.
Example SaaS gross margin calculation
A SaaS company earns $890,000 in subscription revenue in a quarter and spends $195,000 on hosting, AI inference, support, and onboarding. Gross profit = $890,000 − $195,000 = $695,000. Gross margin = $695,000 ÷ $890,000 × 100 ≈ 78.09%. To reach 80%, cost of revenue would need to fall to $178,000, a $17,000 reduction.
Put this calculator on your site
We'll copy this tool into your Calclet account—tweak branding and fields, then paste the embed on WordPress, Webflow, Shopify, or any HTML page. Every embed can link back to Calclet for discovery.
How to use the gross margin %
- Input period subscription revenue ($) consistent with your GAAP or management reporting definition—recognized revenue after allowances, not contracted ACV booked in CRM.
- Input cost of revenue ($) using your chart-of-accounts mapping for COS: hosting, third-party APIs billed per tenant, success labor coded below gross profit, and payment fees tied to subscription billing.
- Read gross margin percentage and gross profit dollars; flag outliers where COR excludes embedded AI usage spikes still hitting hosting invoices.
- Compare rolling gross margin to cohort revenue mix before tying results to Rule of 40 or sales-comp planning.
Common SaaS gross margin mistakes
- Leaving customer support or onboarding costs out of cost of revenue, which inflates gross margin.
- Forgetting payment processing fees and third-party API or AI usage costs.
- Mixing low-margin professional services revenue with subscription revenue.
- Using bookings or ARR instead of recognized revenue for the period.
- Changing cost classifications between periods, which makes trends unreliable.
SaaS gross margin benchmarks
- Software-heavy SaaS gross margin bands
- Public SaaS benchmarks frequently cite mid-to-high seventy-percent gross margins as common among scalable cloud software vendors once COS for hosting and customer success scales sublinearly.
- Cost-of-revenue composition
- ASC-compliant COR typically bundles hosting, payment processor fees allocable to subscriptions, customer-support labor mapped to COS, and embedded third-party data fees—distinct from R&D and field sales opex.
- Services-heavy portfolios
- Implementations booked below margin often compress consolidated gross margin unless segmented into PS revenue lines with their own COS treatment.
FAQs
Our new AI features are eating into gross margin—how much?
Add AI inference costs to cost of revenue and recalculate. Adding $60,000 in LLM fees to $195,000 of existing costs drops gross margin from about 78.09% to 71.35% on $890,000 of revenue. To get back to 78% without cutting costs, revenue would need to reach about $1.16 million. Consider usage-based pricing, caching, or smaller models for routine tasks.
How much will cutting cloud hosting costs improve gross margin?
Subtract the savings from cost of revenue. Cutting $40,000 in hosting through reserved instances, rightsizing, or removing unused resources lowers cost of revenue to $155,000 and raises gross margin from about 78.09% to 82.58%. Review hosting costs per customer regularly as you scale.
What cost of revenue do we need to hit an 80% gross margin?
Multiply revenue by 1 minus the target. On $890,000 of revenue, an 80% margin allows up to $178,000 in cost of revenue, $17,000 below the current $195,000. You can also reach 80% by growing revenue faster than delivery costs.
Should customer support costs be in cost of revenue?
Usually, yes. Support that keeps customers running is a cost of delivering the service. Moving a $50,000 support team out of cost of revenue would raise gross margin from about 78.09% to 83.71%, but investors often adjust for this, so classify support consistently and be transparent.
How does gross margin affect customer lifetime value?
LTV should use gross profit, not revenue. A customer paying $500 a month with 2% monthly churn has an LTV of about $19,523 at a 78.09% margin. At 71.35%, LTV falls to about $17,838. Lower gross margin also lengthens CAC payback: a $6,000 CAC takes about 15.4 months to recover at 78% versus 16.8 months at 71%.
Why did our gross margin drop when we added professional services?
Services usually have much lower margins than software. Adding $150,000 in implementation revenue that costs $135,000 to deliver drops blended gross margin from about 78.09% to 68.27%. Report subscription and services margins separately so investors can see the true software margin.
Will our gross margin improve as we grow?
Often, if part of your cost of revenue is fixed. If $80,000 of your $195,000 in costs is fixed and the rest scales at about 12.9% of revenue, doubling revenue to $1.78 million lifts gross margin from about 78.09% to 82.58%. Costs that grow with usage, like AI inference, limit that improvement.
Should payment processing fees count in cost of revenue?
Many SaaS companies include them, since they're a direct cost of collecting subscription revenue. At about 3% of $890,000, fees add $26,700 and lower gross margin from about 78.09% to 75.09%. Whatever you choose, apply it consistently.
What is a good gross margin for a SaaS company?
Many established SaaS companies report gross margins in the mid-to-high 70s or above. Products with heavy AI usage, hardware, payments, or services often run lower. At 78.09%, this example is in a healthy range, but compare against companies with a similar business model.
Is gross margin the same as contribution margin?
No. Gross margin subtracts only cost of revenue, while contribution margin also subtracts other variable costs, such as sales commissions or variable marketing. Use gross margin to judge product delivery efficiency and contribution margin to judge per-customer or per-deal profitability.
Related calculators
Related guides
Step-by-step articles on building, embedding, and ranking calculator pages like this one.
Category: SaaS profitability and unit economicsTopics: Gross margin, Cost of revenue, Subscription revenue
Last reviewed: 2026-05-07
Reviewed by: Souhayb Kama Ldine