SaaS Gross Margin Calculator
Enter your revenue and each cost of revenue line to get your true gross margin, gross profit, and a benchmark verdict against best-in-class SaaS. Built to surface the AI inference and support costs that quietly drag modern software margins down.
Inputs
Use a single consistent period, monthly or annual. Only include cost of revenue, not sales, marketing, or core product development.
Recurring revenue for the same period as your costs
Compute, storage, bandwidth, CDN
Inference cost that scales with active users
Stripe, card, and gateway fees
People keeping existing customers live
Tooling and data that scales with usage
Where your cost of revenue goes
Your largest COGS line is support & customer success at $7,000. Start there.
SaaS gross margin benchmarks
Gross margin sets the ceiling on payback period, the Rule of 40, and your revenue multiple. It is the most important number in SaaS unit economics, and AI inference cost is the thing most likely to erode it in 2026.
Related tools
Want this built for you? Week One Labs ships custom SaaS and mobile MVPs in fixed-price 14-day sprints.
Fixed price. You own the code from day one. Book a free scope call.
I know which AI tools are worth your time.
I build with AI every single day. I will send you what actually works, what is overhyped, and what you should be paying attention to next. No fluff, just signal.
Get the AI signal. Drop your email below.
No spam. Just useful AI intel for builders.
Frequently asked questions
What is a good gross margin for SaaS?+
Best in class B2B SaaS runs gross margins of 80 to 90 percent. Healthy is 75 to 80 percent. Anything below 70 percent usually means the business carries costs that look more like a service or infrastructure company than pure software, and investors will value it accordingly. The reason the bar is so high is that software has near-zero marginal cost to serve one more customer, so cost of revenue should be dominated by hosting, third-party APIs, payment processing, and the support and customer success needed to keep customers live, not by human delivery effort.
How do I calculate SaaS gross margin?+
Gross margin equals revenue minus cost of revenue, divided by revenue, expressed as a percentage. Cost of revenue, also called cost of goods sold or COGS, is everything required to deliver and support the product customers are already paying for. For SaaS that means hosting and cloud infrastructure, third-party and AI API costs, payment processing fees, data and storage, the support and customer success team, and the portion of engineering that keeps the service running. It does not include sales, marketing, general research and development, or back-office overhead. Those sit below the gross margin line in operating expenses.
What counts as cost of revenue (COGS) for SaaS?+
Include hosting and cloud compute, storage and bandwidth, third-party software and AI or LLM API usage that scales with customers, payment processing fees, the customer support and customer success teams, and the DevOps or site reliability work that keeps the product available. Exclude anything tied to winning new customers or building future product: sales salaries and commissions, marketing spend, core feature development, finance, HR, and office costs. The test is simple. If the cost rises when you add another paying customer to the product you already sell, it usually belongs in cost of revenue. If it is about growth or the future, it belongs in operating expenses.
Why does gross margin matter so much for SaaS valuations?+
Gross margin sets the ceiling on every other unit economic. It determines how many dollars each revenue dollar contributes toward covering sales, marketing, and product, which in turn drives payback period, the Rule of 40, and ultimately how efficiently the business can grow. A company at 85 percent gross margin keeps 85 cents of every new dollar to fund growth, while a company at 55 percent keeps only 55 cents and has to grow far more capital-efficiently to reach the same result. This is why investors treat sub-70 percent margins as a yellow flag and often value those businesses on lower revenue multiples.
How do AI and LLM costs affect SaaS gross margin?+
AI features are the biggest new threat to SaaS gross margin in 2026. Traditional software COGS is tiny because serving one more user costs almost nothing, but every AI inference call has a real, variable cost that scales directly with usage. A product that passes heavy LLM usage to every user can see gross margin fall from the high 80s into the 50s or 60s if pricing does not account for it. The fix is to model token cost per active user, price with that variable cost built in, cache and route to cheaper models where quality allows, and set usage limits on lower tiers so a few power users do not erase the margin on everyone else.
What is the difference between gross margin and net margin?+
Gross margin measures profitability of delivering the product: revenue minus the direct cost of serving customers, divided by revenue. Net margin measures profitability of the whole business after every cost, including sales, marketing, research and development, general and administrative expenses, interest, and tax. A SaaS company can have an excellent 85 percent gross margin and still post a deeply negative net margin because it is spending heavily on growth. That is normal and often healthy for an early-stage company. Gross margin tells you whether the underlying product economics work. Net margin tells you whether the company as currently run is profitable today.
Can a SaaS business have gross margin that is too high?+
Rarely a problem, but an unusually high reported gross margin, say above 90 percent, sometimes signals that real costs are misclassified rather than genuinely absent. If support, customer success, or significant infrastructure work is being buried in operating expenses or research and development instead of cost of revenue, the gross margin looks better than the true economics. When benchmarking, make sure your COGS definition is consistent and complete. An honest 82 percent is far more useful for decision making than a flattering 93 percent that quietly excludes the cost of keeping customers live.