Back to Blog
Metrics Calculation
13 min read

Gross Margin Calculation for SaaS Companies

Calculate SaaS gross margin correctly: include hosting, support, and third-party costs. Target 70-80%+ for healthy unit economics and investor expectations.

Published: August 16, 2025Updated: December 28, 2025By Rachel Morrison
Finance accounting calculator and metrics
RM

Rachel Morrison

SaaS Analytics Expert

Rachel specializes in SaaS metrics and analytics, helping subscription businesses understand their revenue data and make data-driven decisions.

CPA
SaaS Analytics
Revenue Operations
12+ years in SaaS

Based on our analysis of hundreds of SaaS companies, gross margin separates sustainable SaaS businesses from cash-burning operations—yet 70% of early-stage companies miscalculate this critical metric. Unlike traditional software with near-100% margins, SaaS companies face real costs of goods sold: cloud infrastructure, customer support, third-party tools, and payment processing fees that directly scale with revenue. Best-in-class SaaS companies achieve 75-85% gross margins, while struggling companies hover at 50-60% or worse. The difference often lies in what costs get included. This guide explains exactly how to calculate SaaS gross margin, what costs to include, industry benchmarks by stage and segment, and strategies to improve margins without sacrificing growth.

Understanding SaaS Gross Margin Fundamentals

Gross margin measures what percentage of revenue remains after covering the direct costs of delivering your service. For SaaS, this means all costs that scale with customer count or usage.

The Basic Formula

Gross Margin = (Revenue - Cost of Goods Sold) / Revenue × 100%. A company with $1M revenue and $250K COGS has 75% gross margin. The remaining 75% covers sales, marketing, R&D, and generates profit. Higher margins mean more capital for growth.

COGS vs Operating Expenses

COGS includes costs that directly scale with delivering the service: hosting, support team salaries, third-party software per-user fees. Operating expenses (R&D, Sales, G&A) don't count toward COGS—they affect operating margin, not gross margin.

Why SaaS Gross Margin Matters

Gross margin determines unit economics viability. At 40% gross margin, you need 2.5x more revenue to achieve the same gross profit as a company at 80% gross margin. Low margins make customer acquisition economics nearly impossible to work.

The Software Premium

Traditional software achieved 90%+ gross margins—burn a CD, ship it, done. SaaS trades some margin for recurring revenue and customer relationships. 75-80% gross margin remains excellent because the recurring revenue model compounds value over time.

Benchmark Reality

Public SaaS companies average 71% gross margin. Top quartile achieves 78%+. Enterprise software typically reaches 80%+. If you're below 65%, unit economics will struggle regardless of growth rate.

What to Include in SaaS COGS

Accurate COGS calculation requires including all costs that directly support service delivery and scale with customer count or usage. Common categories that should be included in COGS:

Cloud Infrastructure Costs

AWS, GCP, Azure compute, storage, bandwidth, and database costs are primary COGS. Include all production infrastructure supporting customer-facing services. Development and staging environments are R&D expense, not COGS.

Customer Support Operations

Support team salaries, helpdesk software, phone systems, and ticket management tools are COGS. These costs directly scale with customer count. Success managers focused on retention also belong in COGS; sales-focused roles don't.

Third-Party Service Costs

Per-user or per-transaction fees for embedded services count as COGS: payment processing (2.9% + $0.30 per transaction), data providers, API services, embedded AI/ML costs. If it scales with customer usage, it's COGS.

DevOps and Infrastructure Team

Engineers maintaining production systems, ensuring uptime, and managing infrastructure belong in COGS. They directly enable service delivery. Engineers building new features belong in R&D expense.

Common Exclusions

Don't include in COGS: sales team costs, marketing spend, product development, office rent, or executive salaries. These are operating expenses that don't directly scale with service delivery.

Industry Benchmarks by Stage and Segment

Gross margin expectations vary by company stage, market segment, and business model. Understand your relevant benchmark before optimizing.

By Company Stage

Seed/Series A: 60-70% acceptable while scaling. Series B+: 70-75% expected. Growth/Pre-IPO: 75-80% required. Public companies: 75-85% median. Early companies often have lower margins due to infrastructure inefficiency at scale.

By Market Segment

SMB SaaS: 70-75% typical (higher support intensity). Mid-market: 75-80% achievable. Enterprise: 80-85% possible (lower support ratio per revenue). Enterprise commands higher prices while support costs don't scale linearly.

By Business Model

Pure software SaaS: 75-85%. Embedded payments: 60-70% (interchange costs). Hardware + software: 50-65%. Services-heavy: 40-60%. Your model determines achievable gross margin ceiling.

By Vertical

Horizontal SaaS: 75-80%. Vertical with data costs: 65-75% (healthcare, financial data). Vertical with compliance: 70-78% (security, regulatory). Some verticals inherently have higher COGS structures.

Investor Threshold

Most VCs require 70%+ gross margin for SaaS investments. Below 65% raises serious questions about unit economics viability. Above 80% signals excellent efficiency but may also indicate underinvestment in support.

Common Gross Margin Calculation Mistakes

SaaS companies frequently make errors that either inflate or deflate reported gross margins. Both create problems—inflated margins disappoint investors during diligence; deflated margins undervalue the business.

Excluding Payment Processing Fees

Credit card processing fees (2.9% + $0.30 typically) directly scale with revenue and should be COGS. Excluding them inflates gross margin by 2-4 percentage points. Include all payment processing costs.

Misclassifying Support vs Sales

Customer success focused on retention and reducing churn is COGS. Account management focused on upselling is Sales expense. Implementation services may be either depending on whether they're one-time or ongoing. Classify consistently.

Infrastructure Allocation Errors

All customer-facing production infrastructure is COGS. Don't include development environments, CI/CD systems, or internal tools—those are R&D. If customers never touch it, it's probably not COGS.

Ignoring Third-Party Per-User Costs

Embedded software with per-seat licensing (Twilio, data providers, AI APIs) creates variable COGS. As you add customers, these costs scale. Include all per-user and per-transaction third-party fees.

Audit Preparation

Document your COGS classification methodology clearly. Auditors and due diligence teams will scrutinize classifications. Consistency and clear documentation prevent painful reclassification surprises.

Strategies to Improve Gross Margin

Improving gross margin requires reducing COGS without sacrificing service quality or customer experience. Several strategies work across different SaaS businesses.

Infrastructure Optimization

Reserved instances save 30-60% vs on-demand. Right-sizing reduces waste from overprovisioned resources. Multi-cloud arbitrage captures best pricing. Serverless for variable workloads eliminates idle capacity costs. Infrastructure efficiency directly improves gross margin.

Support Efficiency Improvements

Self-service documentation reduces ticket volume. In-product guidance prevents issues before support contact. AI-powered support handles common questions. Better onboarding reduces support intensity. Each improvement allows support team to handle more customers.

Pricing and Packaging Optimization

Price increases directly improve gross margin (COGS stays flat, revenue increases). Usage-based pricing aligns revenue with costs. Premium tiers for high-support customers capture value. Pricing is the fastest lever to improve margins.

Third-Party Cost Negotiation

Volume discounts reduce per-unit third-party costs as you scale. Alternative providers may offer better rates. Building in-house replaces expensive APIs with owned solutions. Renegotiate vendor contracts annually as usage grows.

Improvement Target

A 5-point gross margin improvement (70% to 75%) on $10M ARR adds $500K annually to gross profit. This compounds as you grow—worth significant investment in optimization.

Gross Margin Impact on Other Metrics

Gross margin connects to virtually every other SaaS metric. Understanding these relationships reveals why margin matters so much for business health.

LTV Calculation Dependency

Customer Lifetime Value = (ARPA × Gross Margin) / Churn Rate. Lower gross margin directly reduces LTV. A customer paying $1,000/month with 80% gross margin has LTV of $40,000 at 2% monthly churn; same customer at 60% gross margin has LTV of $30,000—25% lower.

CAC Payback Period

CAC Payback = CAC / (ARPA × Gross Margin). Lower margins extend payback period. If CAC is $5,000 and monthly contribution margin is $800 (80% GM), payback is 6.25 months. At 60% GM, payback extends to 8.3 months—33% longer.

Unit Economics Viability

LTV:CAC ratio benchmarks assume reasonable gross margins. A 3:1 LTV:CAC at 80% gross margin is healthy. The same ratio at 50% gross margin means half the actual contribution to covering operating costs—likely unsustainable.

Path to Profitability

Rule of 40 (Growth Rate + Profit Margin) becomes much harder with low gross margin. A 70% gross margin company can achieve 20% operating profit with 50% operating expense ratio. A 50% gross margin company at same OpEx ratio loses money.

The Margin Multiplier

Every dollar of revenue has different value depending on gross margin. $1 at 80% margin contributes $0.80 to cover costs and profit. $1 at 50% margin contributes $0.50. Revenue quality matters as much as quantity.

Frequently Asked Questions

Should professional services revenue be included in gross margin calculation?

Calculate separately: Software gross margin (subscription revenue - software COGS) and Services gross margin (services revenue - services COGS). Services typically have 20-40% gross margin vs 75-80% for software. Blending them obscures software business health. Report both but emphasize software gross margin.

How do I handle costs that are partially COGS and partially OpEx?

Allocate based on time spent. If an engineer spends 30% on production operations and 70% on development, allocate 30% of their cost to COGS and 70% to R&D. Document methodology and apply consistently. Reasonable allocation matters more than perfect precision.

What gross margin should I target for fundraising?

Seed/Series A: 60%+ acceptable if path to 70%+ is clear. Series B: 70%+ generally expected. Later stage: 75%+ preferred. Sub-60% raises significant concerns unless business model inherently has lower margins (payments, hardware) and you can articulate why.

How does gross margin differ from contribution margin?

Gross margin includes all COGS (fixed and variable). Contribution margin focuses on variable costs only—what changes with each additional customer. Contribution margin is useful for unit economics; gross margin is standard for financial reporting and benchmarking.

Should I include stock-based compensation in COGS?

Yes, allocate SBC to COGS for support and DevOps employees the same way you allocate their cash compensation. This provides accurate total cost picture. Some companies report both GAAP (with SBC) and non-GAAP (without SBC) gross margins for comparison.

How often should I track gross margin?

Monthly for operational decisions and trend monitoring. Quarterly for board reporting and external communication. Annual for benchmarking and strategic planning. Sudden changes warrant investigation—infrastructure cost spikes, support team additions, or third-party fee increases all affect margin.

Disclaimer

This content is for informational purposes only and does not constitute financial, accounting, or legal advice. Consult with qualified professionals before making business decisions. Metrics and benchmarks may vary by industry and company size.

Key Takeaways

Gross margin is the foundation of SaaS unit economics—it determines how much revenue actually contributes to covering operating costs and generating profit. Include all direct costs of service delivery: hosting, support, third-party per-user fees, and payment processing. Target 75%+ for healthy economics, and understand that every point of margin improvement compounds as you scale. QuantLedger helps track revenue by category, segment by customer cohort, and analyze contribution margin trends so you can optimize pricing and cost structure for sustainable growth.

Transform Your Revenue Analytics

Get ML-powered insights for better business decisions

Related Articles

Explore More Topics