Gross margin is the metric that separates software companies from everything else. A well-run SaaS business should generate 70% to 85% gross margins, compared to 30% to 50% for a typical manufacturing or retail company. This margin advantage is why software companies command premium valuations—but only when the margins are real and accurately calculated.
The challenge is that there is no universally agreed-upon standard for what belongs in SaaS cost of goods sold. This ambiguity leads to inconsistent calculations, both across companies and sometimes within the same company over time. Finance teams that get gross margin right build a more credible financial story and make better operating decisions.
What Gross Margin Measures
Gross margin represents the percentage of revenue remaining after subtracting the direct costs of delivering your product or service to customers.
Gross Margin % = (Revenue - Cost of Goods Sold) / Revenue x 100
For a SaaS company generating $10M in ARR with $2.2M in COGS, the gross margin is 78%. That $7.8M in gross profit is what funds everything else: sales, marketing, R&D, G&A, and eventually profit.
Defining COGS for SaaS Companies
The most important and most debated question in SaaS gross margin analysis is what belongs in COGS. The goal is to capture every cost that scales directly with delivering the service to customers.
Hosting and Infrastructure
This is the most obvious COGS component. It includes cloud computing costs (AWS, Azure, GCP), content delivery networks, data storage, and any co-located infrastructure. Include both the direct compute and storage costs and the associated data transfer and networking costs.
As companies scale, hosting costs should grow more slowly than revenue due to economies of scale and architectural optimization. If hosting costs are growing proportionally with revenue, the engineering team should investigate efficiency opportunities.
Customer Support
The cost of providing technical support to customers is a direct cost of service delivery. Include support team salaries and benefits, support tooling costs, and any outsourced support expenses. Some companies split support between a COGS component (technical support for product issues) and an operating expense component (customer success focused on adoption and expansion).
DevOps and Site Reliability
The engineers responsible for keeping the production environment running—site reliability engineers, DevOps teams, and production operations staff—are directly involved in service delivery. Their fully loaded compensation belongs in COGS.
Third-Party Software and Data Costs
Any software licenses, API costs, or data feeds required to deliver your product to customers are COGS. If you embed a third-party mapping service, a payment processing engine, or a data enrichment API into your product, those costs scale with usage and belong in cost of revenue.
Payment Processing Fees
Credit card processing fees, payment gateway charges, and billing platform costs are direct costs of collecting revenue. For companies with significant transaction volumes, these can be material.
Professional Services (Direct)
If your company provides implementation, training, or customization services as part of the customer engagement, the direct costs of delivering those services (consultants, project managers, tools) belong in COGS. Note that professional services typically carry much lower margins than subscription revenue, and blending them dilutes the overall gross margin. Many companies report subscription gross margin separately for this reason.
What Does Not Belong in COGS
Understanding what to exclude is just as important:
- Research and development: Building new features and products is an operating expense, not a cost of delivering the current product.
- Sales and marketing: Customer acquisition costs are operating expenses, not delivery costs.
- General and administrative: Corporate overhead (finance, legal, HR, office costs) is not a direct delivery cost.
- Customer success focused on upsell: If customer success resources are primarily driving expansion revenue, that cost is more appropriately categorized as a sales expense.
The Gray Areas
Some costs genuinely straddle the line. Security and compliance infrastructure protects the product but also serves corporate needs. Data center lease costs may support both production and development environments. In these cases, allocate based on actual usage or a reasonable estimate, document your methodology, and be consistent.
Subscription Gross Margin vs. Total Gross Margin
For companies with multiple revenue streams, separate your gross margin analysis:
Subscription Gross Margin
This isolates the margin on your core recurring revenue. It should be the highest-margin component of your business and is the number most investors focus on.
Subscription Gross Margin = (Subscription Revenue - Subscription COGS) / Subscription Revenue x 100
Target: 75-85% for most SaaS companies.
Professional Services Gross Margin
Implementation and consulting services typically run at much lower margins—often 10% to 30%. Some companies deliberately offer these services at or below cost to accelerate customer onboarding and drive higher subscription retention.
Total Gross Margin
The blended margin across all revenue streams. This is the number that flows into your GAAP financials.
A company with 82% subscription margins and 15% services margins might show a 72% total gross margin if services represent 20% of revenue. Understanding the composition prevents misinterpretation.
Benchmarking Your Gross Margins
By Company Stage
- Early stage (under $5M ARR): 60-70% is common as infrastructure is not yet optimized for scale.
- Growth stage ($5M-$50M ARR): 70-80% as economies of scale improve and architecture matures.
- Scale stage (over $50M ARR): 75-85% with well-optimized infrastructure and processes.
By Business Model
- Pure SaaS (no services): 78-85%
- SaaS with significant services: 65-75% blended
- Usage-based SaaS: 65-80% depending on infrastructure intensity
- Marketplace or platform: Varies widely based on take rate structure
Red Flags
- Subscription gross margins below 65% suggest structural cost issues
- Gross margins declining quarter over quarter signal infrastructure or support cost challenges
- Margins significantly above 85% may indicate underinvestment in support or infrastructure reliability
Improving Gross Margins: A Practical Framework
Step 1: Detailed Cost Attribution
Map every COGS line item to the specific revenue stream it supports. Many companies discover costs hiding in COGS that should be operating expenses, or operating expenses that should be in COGS. Getting the attribution right is the prerequisite for improvement.
Step 2: Infrastructure Optimization
Work with your engineering team to identify efficiency gains in cloud infrastructure. Common opportunities include reserved instance purchasing, right-sizing compute resources, implementing auto-scaling, optimizing database queries, and evaluating multi-cloud or hybrid strategies.
Step 3: Support Efficiency
Measure cost per support ticket and track trends over time. Invest in self-service resources (knowledge base, in-app guidance, community forums) to deflect tickets without degrading customer satisfaction. Monitor the ratio of support headcount to customer count and benchmark against peers.
Step 4: Vendor Negotiation
As your company grows, you gain leverage with cloud providers, payment processors, and third-party software vendors. Renegotiate contracts annually and evaluate competitive alternatives. Even small percentage improvements on large cost categories create meaningful margin expansion.
Step 5: Architecture Investment
Sometimes margin improvement requires upfront investment. Migrating to a more efficient architecture, adopting containerization, or implementing a multi-tenant data layer may require significant engineering effort but can dramatically reduce ongoing hosting costs per customer.
Communicating Gross Margin to Stakeholders
When presenting gross margin analysis to your board or investors, always provide context. Show the trend over time, break out subscription versus total margins, explain any methodology changes, and benchmark against relevant peers. A well-presented gross margin analysis builds confidence that the finance team understands the cost structure deeply and is actively working to optimize it.