SaaS gross margin calculator
Enter a month of revenue and the costs of serving customers. Everything is calculated in your browser — nothing is sent anywhere.
Gross margin
73.6%
70–80% — in line with typical SaaS.
Where each $1 of revenue goes
- AI / LLM APIs 13.0¢
- Cloud & hosting 9.0¢
- Payment fees 3.2¢
- Email, monitoring, other 1.3¢
- Revenue
- $20,000
- Cost of goods sold
- $5,290
- Gross profit
- $14,710
Want this from real data, every day? Connect Stripe and get it automatically →
How the calculation works
Revenue should be what you actually earned in the month — charges minus refunds and disputes, excluding sales tax. Cost of goods sold (COGS) is the cost of delivering your product to existing customers: AI and third-party APIs, production hosting, payment fees and services embedded in the product.
Worked example
With $20,000 revenue and $5,290 of COGS ($2,600 AI, $1,800 hosting, $640 payment fees, $250 other), gross profit is $14,710 and gross margin is 73.6%. Of every dollar, 13¢ goes to AI, 9¢ to hosting and 3¢ to payment fees.
What's a good gross margin?
Classic SaaS is commonly described as running at 70–80% or more. AI-heavy products often sit lower because inference is paid per request. The trend matters as much as the level: a margin that slips a point every month needs attention even if it starts high. Read the guide on AI SaaS margins.
Common mistakes
- Using MRR instead of revenue for the month.
- Leaving out payment fees, which are often 3% or more of revenue.
- Counting cloud credits as savings — they expire.
- Including staging environments or internal tools in COGS.
See how to calculate SaaS gross margin and what counts as COGS.
Frequently asked questions
Is this calculator free?
Yes. It runs entirely in your browser and nothing you type is sent to a server. Share results with the link — inputs are stored in the URL fragment.
Should I include salaries in COGS?
Only for people who serve existing customers, such as support. Engineering, sales and marketing salaries are operating expenses.
Why is margin blank?
Gross margin is undefined when revenue is zero or negative, so the calculator shows a dash instead of a misleading number.
Related tools
See your real margin in five minutes.
Connect Stripe and your cost providers with read-only access. Free for two connections — no card required.