Gross Margin Calculator
See what percentage of your revenue is left after the direct cost of delivering your product — the number that determines how much room you have to invest in growth.
Your revenue & cost
Gross Margin
75.0%
= (Revenue − COGS) ÷ Revenue
Benchmark
- CCopy result
- DDownload PDF
- SSave this calculation
- HToggle history
- ?Show this panel
- EscClose open panel
Disabled while typing in a field.
Last updated: August 5, 2026 · Reviewed by the DoCalc team
What Is Gross Margin?
Gross margin is the percentage of revenue left over after subtracting the direct cost of delivering your product — before any spending on sales, marketing, R&D, or administration. It's the first and most fundamental profitability checkpoint in a business's finances: if a company can't retain a healthy share of revenue after just the direct cost of service, no amount of efficiency elsewhere in the business can fully compensate.
For SaaS companies specifically, gross margin has become a defining characteristic of the business model — software has structurally low marginal cost to serve an additional customer compared to physical goods or heavily serviced businesses, which is exactly why healthy SaaS companies post gross margins in the 75-85% range, well above most other industries.
The Formula
Where COGS (Cost of Goods Sold) is the direct cost of delivering the product or service — for a SaaS business, that typically means cloud hosting and infrastructure, third-party API costs baked into the product, customer support that's part of service delivery, and payment processing fees. It explicitly excludes sales, marketing, R&D, and general administrative costs, which are operating expenses, not cost of service.
How Gross Margin Works
The line between COGS and operating expenses is where most gross margin calculations go wrong, and it matters because misclassifying costs distorts the number in either direction. Support staff who help customers use the existing product belong in COGS; a sales team closing new deals does not, even though both are "customer-facing" in a loose sense. The test is whether the cost is required to deliver the product to customers who already have it, versus costs required to grow the business.
Gross margin tends to improve as a SaaS company scales, since infrastructure costs often grow more slowly than revenue once fixed costs are covered — a pattern sometimes called operating leverage. This is one reason investors watch the trend in gross margin over time, not just a single snapshot.
Worked Example
A company with $100,000 in revenue and $25,000 in cost of goods sold for the period:
This company retains 75 cents of every revenue dollar after the direct cost of delivering its product — right at the lower end of the typical healthy SaaS range, with room to improve toward the 80-85% companies often reach at scale.
SaaS Gross Margin Benchmarks
| Gross margin | What it typically signals |
|---|---|
| Below 60% | Heavy infrastructure, services, or hardware costs bundled in |
| 60-75% | Workable, but below typical pure-software benchmarks |
| 75-85% | Healthy SaaS range |
| 85%+ | Very lean cost of service — common for pure self-serve software |
Pros and Cons
Pros: a simple, universally comparable profitability metric; the clearest single indicator of how much room a business has to fund growth from its own revenue; directly comparable across companies regardless of size.
Cons: doesn't account for operating expenses, so a business can have excellent gross margin and still lose money overall; the COGS vs. operating-expense line is a judgment call that varies somewhat between companies, which can make cross-company comparisons imperfect.
Who Should — and Shouldn't — Use This Calculator
Use it if you want to understand what share of revenue survives the direct cost of delivering your product — a foundational input for pricing decisions, investor reporting, and unit economics analysis.
Skip or adjust for it if you need the full profitability picture including all operating expenses — that's Net Margin, a broader (and typically much lower) number.
Common Mistakes to Avoid
The most common mistake is including sales, marketing, or R&D costs in COGS, which understates gross margin and conflates two genuinely different questions (cost to serve vs. cost to grow). A second mistake is excluding real costs of service — like the portion of customer support time spent on product usage help, or payment processing fees — which overstates margin. A third is comparing gross margin across companies without checking whether they define COGS consistently, since the boundary isn't perfectly standardized industry-wide.
Expert Recommendation
Track gross margin as a trend over time, not just a snapshot — a single quarter's number matters less than whether it's improving as the business scales. A flat or declining gross margin trend, even at a currently healthy level, is often an earlier warning sign than the absolute number itself.
Frequently Asked Questions
What is gross margin?
Gross margin is the percentage of revenue left over after subtracting the direct cost of delivering a product or service (cost of goods sold), before any operating expenses like sales, marketing, or R&D.
What counts as COGS for a SaaS business?
Cloud hosting and infrastructure costs, third-party API and data costs directly tied to the product, customer support that's part of delivering the service, and payment processing fees.
What's a good gross margin for a SaaS company?
Most mature SaaS companies target 75-85% gross margin. Lower margins (50-70%) are common for businesses with heavy infrastructure costs, managed services, or hardware components bundled in.
What's the difference between gross margin and net margin?
Gross margin only subtracts direct cost of service (COGS). Net margin subtracts every expense — COGS, operating expenses, interest, and taxes — to arrive at the percentage of revenue that's actual bottom-line profit.
Should R&D or sales salaries be included in COGS?
No — R&D, sales, marketing, and general administrative costs are operating expenses, not COGS. Only costs directly tied to delivering the product or service to existing customers belong in COGS.
Why does gross margin matter so much for SaaS valuations?
Because it indicates how much of each revenue dollar is available to fund growth, sales, and profit — a business with structurally low gross margin has less room to invest in growth without raising more capital or cutting elsewhere.
Can gross margin be negative?
Yes, if cost of goods sold exceeds revenue — meaning it costs more to deliver the product than customers are paying for it, which is unsustainable without a clear path to improving unit costs or pricing.
How is gross margin different from gross profit?
Gross profit is a dollar amount (revenue minus COGS); gross margin is that same figure expressed as a percentage of revenue, which makes it comparable across companies of different sizes.
Does gross margin improve as a SaaS company scales?
Often yes, since infrastructure and support costs typically grow more slowly than revenue once fixed costs are covered — this is sometimes called operating leverage on the cost-of-service line.
Conclusion
Gross margin is the first checkpoint in understanding whether a business model is fundamentally sound — it answers whether there's enough left over after just delivering the product to eventually fund everything else. For SaaS specifically, it's also a key differentiator from other business models, and one worth tracking as a trend, not just a single number.