How to Calculate SaaS Gross Margin
Use this interactive calculator to estimate your software company’s gross profit and gross margin based on recurring revenue and direct cost of service. Enter your revenue, direct delivery costs, and allocation assumptions to see whether your unit economics support efficient growth.
Formula Overview
- Gross Profit = Revenue – Cost of Goods Sold
- Gross Margin % = Gross Profit / Revenue × 100
- For SaaS, include only direct service delivery costs in COGS
SaaS Gross Margin Calculator
Results
Enter your figures and click Calculate gross margin to see gross profit, gross margin percentage, total COGS, and benchmark comparison.
Revenue vs COGS vs Gross Profit
Expert Guide: How to Calculate SaaS Gross Margin Correctly
Understanding how to calculate SaaS gross margin is one of the most important financial skills for founders, finance teams, and operators. Gross margin shows how much of your subscription revenue remains after paying the direct costs required to deliver your software service. It is one of the clearest ways to evaluate whether your business model is healthy, scalable, and attractive to investors.
In simple terms, the formula is straightforward: gross profit equals revenue minus cost of goods sold, and gross margin equals gross profit divided by revenue. The nuance comes from deciding which costs truly belong in cost of goods sold for a software company. If you classify expenses inconsistently, your reported margin can appear artificially high or misleadingly low. That is why an accurate SaaS gross margin calculation depends not only on arithmetic, but on disciplined cost classification.
What SaaS gross margin measures
SaaS gross margin measures the percentage of revenue left after covering the direct cost of delivering your service to customers. For a software company, this usually includes cloud infrastructure, third-party hosting, customer support or customer success labor that is treated as direct service delivery, implementation or onboarding costs when they are directly tied to serving customers, and payment processing fees associated with collecting subscription revenue.
Gross margin does not usually include sales commissions, brand marketing, executive salaries, rent, general administration, or most research and development costs. Those are normally operating expenses rather than cost of goods sold. This distinction matters because gross margin is intended to answer a specific question: how efficiently can the company serve one more dollar of customer revenue before broader overhead is considered?
The core formula
- Calculate total revenue: Add all subscription, recurring, and direct usage-based revenue for the period.
- Calculate total SaaS COGS: Sum direct infrastructure, direct service labor, support tools, third-party delivery costs, merchant fees, and other direct service expenses.
- Calculate gross profit: Revenue minus total COGS.
- Calculate gross margin percentage: Gross profit divided by revenue, then multiply by 100.
Example: If your SaaS company generates $250,000 in monthly revenue and incurs $55,000 of direct service delivery costs, your gross profit is $195,000. Your gross margin is $195,000 divided by $250,000, which equals 78%.
Which costs should count in SaaS COGS
One of the most common mistakes in SaaS finance is placing too many costs below the gross margin line or too few. To calculate a useful gross margin, include only the costs directly required to serve customers.
- Include: cloud hosting, storage, data transfer, direct DevOps tied to production uptime, customer support tied to service delivery, onboarding that is part of standard implementation, third-party data providers, payment processing, direct license royalties, and direct security costs that scale with service delivery.
- Usually exclude: sales and marketing payroll, lead generation, corporate management, legal, HR, finance, office rent, most product R&D, and long-term platform innovation expenses.
- Policy-dependent items: customer success, implementation, and support engineering may be included or excluded depending on your accounting policy and business model. Consistency matters more than perfection if you are comparing trends over time.
Investors often prefer to see not just the top-line gross margin number, but also the company’s cost policy. Two SaaS businesses can report different gross margins because one includes customer success in COGS while the other records that team as operating expense. For internal planning, document the rule and keep it stable across periods.
Why SaaS gross margin matters so much
Gross margin is more than an accounting metric. It affects capital efficiency, payback periods, cash flow potential, valuation, and your ability to invest in growth. A higher gross margin means more revenue dollars are available to fund product development, sales expansion, and retained earnings. A lower gross margin usually means your delivery model is expensive, your pricing is weak, or your support burden is too high.
In software businesses, gross margin is often structurally stronger than in physical goods businesses because the incremental cost of serving one additional customer can be relatively low once the platform is built. That is one reason investors are attracted to SaaS models. However, not all SaaS companies have elite margins. Heavy implementation, expensive human support, large data processing loads, and third-party usage fees can reduce gross margin significantly.
Typical SaaS gross margin ranges
The “right” gross margin depends on your company’s market, pricing model, customer profile, and service intensity. Enterprise SaaS with significant implementation or managed service components can run lower than pure self-serve software. Infrastructure-heavy businesses may also have lower margins than workflow or collaboration software.
| SaaS profile | Typical gross margin range | What often drives the result |
|---|---|---|
| Early-stage SaaS with manual onboarding | 60% to 70% | Higher support burden, onboarding labor, smaller scale on cloud costs |
| Growth-stage B2B SaaS | 70% to 80% | Better pricing discipline, stronger scale economics, more stable infrastructure base |
| High-efficiency software platform | 80% to 90% | Low variable support load, strong automation, high price realization |
| Usage-intensive or services-heavy SaaS | 50% to 70% | API costs, hosting intensity, implementation, and service-heavy delivery |
Public software companies often report gross margins around the mid-70% to low-80% range, though this varies meaningfully by business model. A cloud data platform or communications platform may have structurally lower margins than a pure workflow automation or vertical software company. The key is not chasing a generic benchmark blindly, but understanding the cost structure of your own category.
Real statistics and benchmarking context
To benchmark effectively, it helps to compare software economics to broader business sectors and to public-market expectations. The table below combines widely cited market patterns and representative operating realities that finance teams use when evaluating SaaS quality.
| Metric or benchmark point | Representative figure | Interpretation |
|---|---|---|
| Common target for attractive B2B SaaS gross margin | 75%+ | Often viewed as a healthy threshold for scalable software economics |
| High-performing pure software businesses | 80% to 85% | Usually reflect strong pricing, low support intensity, and efficient cloud spend |
| Typical payment processing cost on SaaS subscriptions | 2% to 4% of billed volume | Small but meaningful direct cost that should not be ignored |
| Cloud and infrastructure burden for many SaaS platforms | 5% to 15% of revenue | Can vary sharply for AI, data, video, or communications products |
| Support and service delivery burden in efficient self-serve models | 3% to 8% of revenue | Lower service dependency supports stronger gross margin |
These figures are not accounting rules, but practical planning benchmarks. If your margin falls below the expected range for your type of software company, review pricing, infrastructure architecture, vendor contracts, support staffing model, and onboarding complexity. If your margin is substantially above peers, confirm that you are not excluding costs that should be classified as COGS.
Step-by-step example
Suppose your SaaS company reports the following monthly numbers:
- Revenue: $400,000
- Cloud hosting and data services: $38,000
- Customer support payroll allocated to COGS: $24,000
- Third-party API licensing: $11,000
- Payment processing fees: $8,000
- Other direct customer delivery costs: $4,000
Total COGS equals $85,000. Gross profit equals $400,000 minus $85,000, or $315,000. Gross margin equals $315,000 divided by $400,000, which is 78.75%. That is a strong result for many SaaS businesses because it suggests the company keeps nearly $0.79 of every revenue dollar after paying direct delivery costs.
Now imagine the company discovers that another $20,000 of implementation labor should also be classified in COGS. Revised COGS become $105,000, gross profit becomes $295,000, and gross margin falls to 73.75%. The business may still be healthy, but the revised result gives a more accurate view of the true cost to serve customers.
Common mistakes when calculating SaaS gross margin
- Using ARR with monthly COGS: Match the time period exactly. Monthly revenue must be paired with monthly direct costs.
- Ignoring payment processing fees: These can materially affect margin, especially for SMB or self-serve billing models.
- Excluding direct customer support: If support is required to deliver the service, it often belongs in COGS.
- Including all engineering payroll in COGS: Most product development is an operating expense, not cost of service delivery.
- Changing accounting policy midstream: That makes trend analysis unreliable.
- Not separating services from software: If implementation or consulting is a major revenue stream, analyze software gross margin and services gross margin separately.
How to improve SaaS gross margin
If your SaaS gross margin is lower than target, there are several operational levers you can pull. First, review your cloud architecture. Reserved capacity, storage tier optimization, code efficiency, and data egress management can materially improve infrastructure economics. Second, evaluate whether support requests are being reduced through product design, better onboarding, and self-service education. Third, revisit pricing. Many SaaS companies underprice compute-heavy features or fail to pass on third-party API costs to customers.
You should also assess account segmentation. Some customers create far more support burden, usage intensity, or custom requests than others. A company with a good headline gross margin can still destroy value on certain customer cohorts if those accounts are expensive to serve. Segment margin by customer size, plan tier, product line, and delivery model whenever possible.
Gross margin vs contribution margin vs EBITDA
Gross margin is only one layer of profitability. Contribution margin goes a step further by subtracting additional variable or semi-variable costs that scale with acquiring and retaining customers, depending on your internal definition. EBITDA is much lower in the income statement and includes many operating expenses excluded from gross margin. A company can have excellent gross margins but poor EBITDA if it overspends on sales, marketing, or corporate overhead. That is why strong SaaS analysis looks at all three metrics together.
Final takeaway
To calculate SaaS gross margin correctly, start with revenue for a specific period, subtract only the direct costs required to deliver the service, and divide gross profit by revenue. Then pressure-test your accounting policy for consistency. The best SaaS operators do not treat gross margin as a vanity number. They use it to make decisions about pricing, cloud efficiency, support staffing, onboarding design, and customer segmentation.
If your margin is trending upward over time, that usually signals improving scale economics and better operational discipline. If it is trending downward, investigate infrastructure creep, underpricing, over-servicing, or misclassification of costs. When tracked consistently, SaaS gross margin becomes one of the most useful indicators of software business quality.