Gross Margin Calculator

Added

Calculate gross margin %, gross profit, and markup from revenue and COGS — plus the revenue needed to hit any target margin.

Gross Margin
Gross Profit
Markup %
Revenue for Target
Found this useful?

~7 min read

Gross margin is the percentage of revenue that remains after deducting the direct costs of delivering your product or service. It's the most fundamental profitability metric — before operating expenses, sales, marketing, or overhead.

Gross Margin % = (Revenue − COGS) ÷ Revenue × 100

Gross Profit = Revenue − COGS

Margin vs markup — the common confusion

Gross margin and markup are both derived from revenue and COGS, but they're calculated differently and tell you different things:

Metric Formula What it measures
Gross margin (Revenue − COGS) ÷ Revenue % of revenue retained after direct costs
Markup (Revenue − COGS) ÷ COGS % added to cost to set price

A 50% gross margin means you keep 50 cents of every dollar earned. A 50% markup means you added 50% to cost to set your price — which is only a 33% margin.

At a 50% margin: sell for $100, COGS = $50, markup = $50/$50 = 100% At a 50% markup: sell for $150, COGS = $100, margin = $50/$150 = 33%

Gross margin benchmarks by industry

Industry Typical gross margin
SaaS / software 70–85%
Professional services 50–70%
E-commerce (branded) 40–60%
E-commerce (reseller) 20–40%
Physical product (DTC) 40–65%
Restaurants / food 60–70% (on food cost only)
Wholesale / distribution 10–30%

Why gross margin is the most important metric at early stage

Gross margin determines whether your business model works. Operating expenses — headcount, rent, marketing — are variable costs you control. Gross margin is structural. A business with 20% gross margin can't reach 20% net margin even at infinite scale.

What is COGS for a SaaS business?

For SaaS, COGS includes: - Cloud infrastructure (AWS/GCP/Azure costs that scale with customers) - Third-party API costs (Twilio, Stripe, etc.) - Customer support headcount (fully loaded) - Customer success management (partially) - Data storage and CDN costs

COGS does NOT include: R&D, engineering salaries, sales, marketing, G&A, or any overhead. Those are operating expenses below the gross margin line.

Frequently asked questions

What is a good gross margin for SaaS? 70–80% is the benchmark for most SaaS businesses. Below 60%, you may have a managed service or implementation cost issue. Above 85% is possible for pure-software PLG (product-led growth) companies with low support costs. Public SaaS companies at IPO typically show 70–80%.

What does this calculator do? Calculate gross margin %, gross profit, markup %, and the revenue needed at current COGS to hit any target margin.

↑ Back to calculator

Gross Margin vs Markup: What's the Difference?

A clear explanation of gross margin vs markup with formulas, examples, and a conversion table — so you never confuse them again.

Gross margin and markup are two different ways to express the same relationship between price and cost. Confusing them is one of the most common financial mistakes in small business — it can cause you to underprice by 30–50%.

The formulas

Gross Margin % = (Price − Cost) ÷ Price × 100

Markup % = (Price − Cost) ÷ Cost × 100

Both use the same gross profit number ($Price − $Cost). The difference is the denominator.

The critical distinction

If your margin is 50%: you keep 50 cents of every dollar earned. If your markup is 50%: you added 50 cents to every dollar of cost — which is only a 33% margin.

This is where founders get into trouble. If you target "50% margin" but accidentally use the markup formula, your actual margin is only 33%.

Conversion table: margin to markup

Gross Margin Equivalent Markup
10% 11.1%
20% 25.0%
30% 42.9%
40% 66.7%
50% 100.0%
60% 150.0%
70% 233.3%
80% 400.0%

Conversion formulas

Margin to Markup: Markup = Margin ÷ (1 − Margin)

Markup to Margin: Margin = Markup ÷ (1 + Markup)

Which to use when

Use gross margin when: reporting to investors, modeling unit economics, comparing to industry benchmarks, calculating LTV, or thinking about profitability as a percentage of revenue.

Use markup when: setting wholesale prices (common in retail), calculating the price from a known cost target, or communicating pricing to distributors.

SaaS companies almost always use gross margin. Physical product and retail businesses often use both. Use the Gross Margin Calculator to see both simultaneously for any revenue/COGS combination.

↑ Back to calculator

SaaS Gross Margin Benchmarks: What's Typical at Each Stage?

Industry benchmarks for SaaS gross margin by ARR stage, business model, and segment — with what goes into COGS and how to improve it.

Gross margin in SaaS is more nuanced than in physical product businesses. Unlike manufacturing, there's no per-unit material cost — but there are hosting costs, support costs, and third-party API fees that scale with customers and must be included in COGS.

SaaS gross margin by ARR stage

ARR Typical range Notes
< $1M 55–75% Often high support COGS early on
$1M–$5M 65–80% Improving with product maturity
$5M–$20M 70–82% Economies of scale in infrastructure
$20M–$100M 72–85% Optimized infrastructure + support automation
$100M+ 75–87% Fully optimized, often offshored support

Why gross margin improves with scale

  1. Infrastructure costs have natural step-function scaling. You over-provision early, then use capacity without proportional cost increases.

  2. Support costs spread over more customers. A support rep who handles 50 tickets/day serves more customers as the user base grows and the product matures.

  3. Third-party API costs often have volume discounts at scale.

Public SaaS gross margin benchmarks

Most public SaaS companies report 70–80% gross margin. Notable exceptions:

  • High-margin PLG companies (e.g., Figma, Notion): 80–87%. Low support, high self-service, no COGS from customer success.
  • Managed service / implementation-heavy SaaS: 55–70%. High human labor in COGS.
  • Usage-based / infrastructure companies: 60–75%. Significant cloud COGS.

How to improve SaaS gross margin

  1. Reduce per-customer infrastructure cost: right-size instances, use reserved pricing, implement usage-based resource allocation.
  2. Reduce support-to-customer ratio: invest in self-serve documentation, in-app help, automated onboarding. Every support ticket avoided improves margin.
  3. Audit third-party API costs: Twilio, Sendgrid, and similar costs often have usage that can be reduced with caching or batching.
  4. Shift toward self-serve: sales-assisted onboarding is expensive. PLG reduces human COGS per customer dramatically.

Use the Gross Margin Calculator to model the impact of COGS reduction on your gross margin at your current revenue.

↑ Back to calculator

What Is COGS for a SaaS Company? (With Examples)

A practical guide to what counts as Cost of Goods Sold in SaaS — what to include, what to exclude, and how to calculate COGS for your gross margin.

COGS (Cost of Goods Sold) for SaaS is the set of direct costs incurred to deliver your software service to customers. Unlike physical products, there's no per-unit material cost — but COGS still exists and significantly affects gross margin.

Getting COGS right matters because it determines your gross margin, which is how investors, acquirers, and benchmarks evaluate your business model quality.

What to include in SaaS COGS

Cloud infrastructure: AWS, GCP, or Azure compute, storage, and network costs that scale with your customer base or usage. This is the largest COGS item for most SaaS companies.

Third-party APIs: Twilio (SMS, voice), Stripe (payment processing fees that you pay but don't charge back), SendGrid, Cloudflare, and similar per-use costs.

Customer support: fully loaded cost of support engineers and tier-1 support agents. This includes salary, benefits, equipment, and management overhead.

Customer success management: a portion (typically 50–75%) of customer success salaries, depending on whether they're primarily onboarding (COGS) or upselling (sales).

Data and content costs: licensed data, third-party datasets, or content that's integral to your product delivery.

What NOT to include in SaaS COGS

  • Engineering / R&D (building new features is R&D, not delivery)
  • Sales team salaries (below the gross margin line as sales expense)
  • Marketing spend (operating expense)
  • G&A / corporate overhead (rent, legal, finance, HR)
  • Executive salaries (unless directly allocable to service delivery)

Example: calculating SaaS COGS

Company with $500k MRR, 200 customers:

Cost item Monthly amount
AWS infrastructure $35,000
Twilio API costs $8,000
Support team (3 reps, fully loaded) $30,000
50% of CS team cost $15,000
Total COGS $88,000

Gross profit = $500,000 − $88,000 = $412,000 Gross margin = 82.4%

Use the Gross Margin Calculator to calculate your gross margin once you've categorized your own COGS correctly.

↑ Back to calculator

Recommended tools

Tools our audience uses alongside this calculator.

Baremetrics SaaS Analytics

Tracks gross margin, MRR, COGS, and 30+ SaaS metrics automatically from Stripe. See gross margin trends by cohort, plan, and geography without building spreadsheets.

Track your gross margin with Baremetrics →
Mosaic Financial planning

Strategic finance platform for SaaS. Connects to your accounting system, CRM, and billing to model gross margin by product line, customer segment, and scenario.

Model gross margin scenarios with Mosaic →