Definition
Gross margin is the percentage of revenue left after subtracting the direct costs of delivering your product or service, often called cost of goods sold (COGS) or cost of revenue.
Formula
Gross margin = (revenue − cost of revenue) ÷ revenue
What counts as cost of revenue for SaaS
- Hosting and infrastructure
- Third-party services used per customer (APIs, AI model costs, email sending)
- Payment processing fees
- Customer support and onboarding staff
Not included: product development, sales, marketing, and general admin. Those are operating expenses.
Example
Monthly revenue is $30,000. Hosting costs $2,500, API costs $1,500, payment fees $900 and support $1,600.
Cost of revenue = $6,500. Gross margin = ($30,000 − $6,500) ÷ $30,000 ≈ 78%
Benchmarks
Software businesses commonly run gross margins of roughly 70–85%. Products with heavy per-customer costs (for example, large AI or data processing costs, or lots of human service) often run lower.
Why it matters
Gross margin is what's actually available to pay for growth and fixed costs. It feeds directly into LTV, CAC payback and your break-even point.