SaaS Gross Margin Calculator

Enter revenue, hosting and support costs to find your SaaS gross margin.

How it is calculated

Enter revenue, hosting cost and support cost for the same period (a month, a quarter or a year). The tool treats cost of goods sold as just those two costs: COGS = hosting + support. Then gross profit = revenue − COGS and gross margin = gross profit / revenue × 100. The margin is shown as a percentage with two decimals and the two money values in dollars. Revenue must be above zero; hosting and support can be zero. Nothing stops the margin from going negative: if COGS exceeds revenue you get a negative profit and margin, for instance $1,000 revenue with $1,300 of costs gives −30.00%. Costs outside those two fields, such as payment-processing fees, third-party licences or onboarding staff, must be added into one of them by you.

Worked example

A SaaS product brings in $50,000 in a month. Hosting costs $7,500 and support costs $6,000. COGS: 7,500 + 6,000 = 13,500, shown as $13,500.00. Gross profit: 50,000 − 13,500 = 36,500, shown as $36,500.00. Gross margin: 36,500 / 50,000 × 100 = 73, displayed as 73.00%. Each dollar of revenue leaves 73 cents to cover sales, marketing and development.

Try this example →

Common mistakes

  • Mixing periods, such as monthly revenue with annual hosting bills. The margin is only meaningful when all three figures cover the same period.
  • Putting sales, marketing or R&D salaries into the support field. Gross margin is meant to exclude those operating expenses, so including them gives an artificially low margin.
  • Leaving out costs that really belong in COGS, such as payment-processing fees or paid third-party APIs. With only hosting and support counted, the margin looks better than it is unless you fold them in.
  • Using bookings or invoiced amounts instead of recognised revenue for the period, for example an annual contract paid up front in a single month.
  • Confusing margin with markup. A 73% margin means profit is 73% of revenue; it is not 73% on top of cost.

Sources

About this calculator

Gross margin for a SaaS company measures how much revenue is left after subtracting the cost of goods sold (COGS) — for software, this is primarily hosting/infrastructure costs and customer support costs, rather than the manufacturing costs a physical-goods business would have. It's expressed as a percentage of revenue and is one of the most closely watched metrics in software business models, because it reveals how efficiently the underlying product itself can be delivered at scale, before accounting for sales, marketing, and R&D spend.

This calculator computes SaaS gross margin and gross profit from revenue, hosting cost, and support cost. It's a standard metric for SaaS founders, finance teams, and investors — public SaaS companies often target gross margins of 70–80%+ — used to benchmark unit economics, evaluate infrastructure efficiency, and assess a company's health during fundraising or board reporting.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Use revenue recognised in the period, not cash billed. An annual plan paid up front would otherwise make one month look far better than the rest, while the costs stay spread out. Payment fees, third-party API charges and customer-success staff belong in the cost boxes too, because the tool only subtracts hosting and support. Negative margins are shown as they are. Which costs do you count toward your cost of revenue?

Popular calculators

All Calculators