Skip to main content
Back to blog
gross marginSaaS metricsprofitabilityCOGScost optimization

How to Calculate and Improve SaaS Gross Margin

Median SaaS gross margin is 75%. Below 70% signals a structural problem. How to calculate gross margin, what drags it down, and 5 ways to improve it.

T
Team culta
·11 min read

Gross margin is the first line of defense for your SaaS business. If your gross margin is weak, nothing downstream can save you -- not growth, not fundraising, not cost-cutting elsewhere. Every dollar of revenue that gets consumed by cost of goods sold is a dollar that cannot fund growth, R&D, or profit.

KeyBanc's 2024 SaaS Survey found the median gross margin for private SaaS companies is 75%. Pure software companies with minimal support needs hit 80-85%. Companies that bundle significant services or support typically land at 60-70%. And SaaS Capital's analysis shows that every 5-point improvement in gross margin increases enterprise value by 1-2x revenue multiples.

This guide covers how to calculate gross margin correctly for a SaaS business, what drags it down, the benchmarks that matter, and five specific ways to improve it.

The Gross Margin Formula

Gross margin is straightforward:

Gross Margin = (Revenue - Cost of Goods Sold) / Revenue x 100

If your SaaS generates $100,000 in monthly revenue and your COGS is $25,000, your gross margin is 75%.

The formula is simple. The hard part is correctly defining what goes into COGS.

What Counts as COGS for SaaS

Cost of goods sold for SaaS is different from manufacturing. There is no raw material or physical product. But there are real costs directly tied to delivering the service to customers.

Hosting and Infrastructure

This is the most obvious COGS item. It includes:

  • Cloud computing costs (AWS, GCP, Azure) directly attributable to running the production application
  • Database hosting and storage costs
  • CDN and bandwidth costs
  • Monitoring and observability tools used for production systems

Important distinction: Development and staging infrastructure is not COGS -- it is an R&D expense. Only production infrastructure that directly serves customers counts.

Customer Support

Support costs that are directly tied to delivering the service:

  • Support team salaries (or the portion of team time spent on support)
  • Support tooling (helpdesk software, chat tools)
  • Customer success team salaries if their role is primarily reactive (responding to issues, onboarding)

Important distinction: Customer success focused on upselling or expansion is a sales expense, not COGS.

Payment Processing

  • Stripe, PayPal, or other payment processor fees (typically 2.9% + $0.30 per transaction)
  • Billing platform costs (Chargebee, Recurly, Stripe Billing)

Third-Party API and Service Costs

  • APIs you pay per-call (email delivery, SMS, AI/ML APIs, data enrichment)
  • Third-party services that are essential to your product's functionality
  • Licensed data or content that you deliver to customers

DevOps and Site Reliability

  • DevOps engineer salaries (or the portion focused on production reliability)
  • On-call and incident response costs

What is NOT COGS

These are operating expenses, not cost of goods sold:

  • R&D / engineering salaries (building new features)
  • Marketing and sales costs
  • General and administrative costs
  • Development tools and environments
  • Office space and equipment

Getting this classification right matters. Incorrectly including R&D costs in COGS will make your gross margin look worse than it is. Incorrectly excluding support costs will make it look better.

Use a profitability calculator to compute your gross margin and compare it against benchmarks for your industry.

Gross Margin Benchmarks

By Business Model

ModelTypical Gross MarginWhy
Pure SaaS (self-serve)80-85%Minimal support, automated everything
SaaS + Support70-75%Support team adds meaningful cost
SaaS + Services60-65%Implementation, consulting, or managed services
SaaS + Hardware50-60%Physical components in the product
Infrastructure SaaS55-70%High compute/storage costs passed through

By Stage

  • Seed / Early Stage: 65-75% -- COGS is often higher relative to revenue because infrastructure costs have a minimum floor regardless of customer count
  • Series A: 70-78% -- Efficiency improves as revenue grows against a relatively fixed infrastructure base
  • Series B+: 75-85% -- Scale advantages kick in; support per customer decreases, infrastructure cost per customer decreases

The 70% Threshold

Investors and analysts use 70% as the informal floor for "real SaaS." Below 70%, questions arise about whether the business has the unit economics to scale profitably. This does not mean sub-70% businesses are bad -- but they need a clear story about why margins are lower and how they will improve.

For context on how gross margins compare across different business types, check our profit margins by industry benchmarks.

Why Gross Margin Matters for Valuation

Gross margin is one of the top three metrics (alongside growth rate and net retention) that determine SaaS valuation multiples. Here is why:

Gross margin defines your spending capacity. A company with 80% gross margin has $0.80 of every revenue dollar available for R&D, sales, marketing, and profit. A company with 60% gross margin has only $0.60. Over time, the 80% company can invest more in growth while maintaining the same profitability.

Gross margin compounds with scale. High gross margin means that as revenue grows, a larger absolute amount flows to the bottom line. A $10M ARR company at 80% margin has $8M for operating expenses and profit. At 60%, it has only $6M -- a $2M difference that compounds every year.

Investors model long-term profitability from gross margin. At scale, SaaS operating expenses (sales, marketing, R&D, G&A) typically consume 60-70% of revenue. That means you need at least 70% gross margin to have any profit left over. Below that, the long-term profitability model breaks down.

KeyBanc data shows that SaaS companies with gross margins above 80% trade at a median 2x premium on revenue multiples compared to those with margins between 60-70%.

5 Ways to Improve SaaS Gross Margin

1. Optimize Hosting and Infrastructure Costs

Hosting is typically the largest COGS item, and it is often the most wasteful. Common savings opportunities:

Right-size your instances. Most startups over-provision by 30-50%. Review your CPU and memory utilization. If average utilization is below 30%, you can likely drop to a smaller instance type.

Use reserved/committed-use pricing. If your infrastructure is stable, reserved instances (AWS) or committed-use discounts (GCP) save 30-60% versus on-demand pricing. The commitment is 1-3 years, which makes sense once your architecture is stable.

Optimize database costs. Database hosting is often the second-largest infrastructure cost. Review query performance, add indexes, cache frequently-read data, and consider read replicas instead of scaling up the primary instance.

Implement auto-scaling properly. Auto-scaling should scale down aggressively, not just up. Many teams configure scale-up rules but forget scale-down, paying for peak capacity 24/7.

Audit third-party services. Are you paying for monitoring on your staging environment? Running a separate analytics database you never query? These costs add up.

Typical savings: 20-40% of infrastructure costs, or 2-5 points of gross margin.

2. Reduce Support Tickets Through Self-Service

Every support ticket has a cost: the support agent's time, the tooling, and the delay to the customer. The highest-leverage approach is not hiring more support staff -- it is reducing the number of tickets.

Build comprehensive documentation. The top 20 support questions should all have clear, findable answers in your help center. Track which topics generate the most tickets and document them first.

Add in-app guidance. Tooltips, onboarding checklists, and contextual help reduce "how do I do X?" tickets by 30-50%.

Create a community forum. Let customers answer each other's questions. This works especially well for technical products where users enjoy sharing knowledge.

Improve error messages. Vague error messages generate support tickets. Specific, actionable error messages solve the problem at the point of failure.

Typical savings: 20-40% reduction in support volume, or 1-3 points of gross margin.

3. Renegotiate API and Service Contracts

Third-party API costs often have significant room for negotiation, especially as your volume grows.

Request volume discounts. If you are sending 100,000+ API calls per month, you are past the "startup tier" for most providers. Ask for custom pricing.

Evaluate alternatives. The API provider you chose at launch may not be the most cost-effective at your current scale. Compare pricing across 2-3 alternatives annually.

Cache aggressively. If you are calling a third-party API for data that does not change frequently, cache the results. Reducing API calls by 50% directly reduces that cost by 50%.

Build in-house for high-volume APIs. If a single API represents more than 2-3% of your COGS, evaluate whether building an in-house alternative makes financial sense. The breakeven is typically 12-18 months of development cost versus API savings.

Use a markup and margin calculator to understand how API cost reductions flow through to your overall margin profile.

Typical savings: 15-30% of third-party API costs, or 1-2 points of gross margin.

4. Move Costly Features to Usage-Based Pricing

If a specific feature is expensive to deliver (AI processing, video transcoding, data storage beyond a threshold), consider pricing it on a usage basis rather than including it in a flat subscription.

Identify your highest-COGS features. Which features drive the most infrastructure or API cost per customer? These are candidates for usage-based pricing.

Set generous included limits. Include enough usage that 70-80% of customers never hit the limit. The goal is not to nickel-and-dime customers but to ensure that heavy users pay proportionally for the resources they consume.

Communicate the value, not the cost. Frame usage-based pricing around the value delivered ("you processed 10,000 documents this month") rather than the cost to you ("you used $47 of compute").

This approach improves gross margin because your highest-cost customers now pay proportionally more. It also aligns your revenue with your costs, creating natural margin stability as you scale.

Typical impact: 3-8 points of gross margin improvement for companies with high-variance usage patterns.

5. Separate Services Revenue

If your company offers implementation, consulting, or managed services alongside your SaaS product, separating these revenue streams clarifies your actual software gross margin.

Why this matters: Blended gross margin across software and services is misleading. If your software margin is 82% and your services margin is 30%, blending them at a 70/30 mix gives you 66% -- well below the SaaS threshold. But the software business is actually excellent.

Report software and services margins separately. Investors and analysts will evaluate them independently.

Price services to break even or slight profit. Services should not be a loss leader funded by software margins. Price implementation and consulting at rates that cover your fully-loaded cost plus 10-20% margin.

Reduce services dependency over time. The goal for most SaaS companies is to shrink services as a percentage of revenue. Self-serve onboarding, automated implementation, and partner-delivered services all reduce your direct services cost.

For a broader view of how SaaS pricing structures affect margins, our SaaS pricing strategy guide covers the tradeoffs between different models.

Tracking Gross Margin Over Time

Gross margin should be a monthly metric in your financial review. Here is what to watch for:

  • Gross margin increasing quarter-over-quarter: Indicates improving efficiency as you scale
  • COGS growing slower than revenue: The ideal pattern -- you are getting more leverage from your infrastructure
  • Support cost per customer declining: Self-serve investments are paying off

Warning Signs

  • Gross margin declining quarter-over-quarter: Investigate immediately. Is it a new cost (AI API), a scaling problem (infrastructure growing faster than revenue), or a mix shift (more services revenue)?
  • Infrastructure costs growing faster than revenue: You may need to optimize architecture or renegotiate contracts
  • Support headcount growing linearly with customers: Your support model is not scaling. Invest in self-serve before hiring more agents.

The Monthly Review

Each month, review:

  1. Total COGS -- absolute number and percentage of revenue
  2. COGS by category -- hosting, support, payment processing, APIs, other
  3. Gross margin -- current month and trailing 6-month trend
  4. Cost per customer -- total COGS divided by customer count; should be declining or stable

Compare your margin trajectory against profitability benchmarks by industry to ensure you are converging toward healthy levels for your sector.

Getting Started

If you have never formally calculated your SaaS gross margin, start here:

  1. List every COGS item using the categories above
  2. Pull the last 3 months of costs for each item from your accounting system and cloud provider dashboards
  3. Calculate gross margin for each of the last 3 months
  4. Identify your top 3 COGS items -- these are where optimization effort should focus
  5. Set a 6-month target -- if you are at 68%, aim for 73%. If you are at 75%, aim for 78%.

Gross margin improvement is not a one-time project. It is an ongoing discipline. The companies that reach 80%+ gross margin do so through dozens of small optimizations over years, not a single dramatic cost cut.


Sources

  • KeyBanc Capital Markets -- "2024 Private SaaS Company Survey: Gross Margin Analysis" (2024)
  • SaaS Capital -- "The Impact of Gross Margin on SaaS Valuations" (2025)
T

Written by Team culta

The culta.ai team helps businesses track revenue, manage cash flow, and make smarter financial decisions across multiple entities.

Ready to get started?

Take control of your finances

Start free and use culta.ai to track revenue and make smarter financial decisions.