one-line definition
Gross Margin is a core operating metric that helps small teams make better product and growth decisions.
formula: Gross margin = (Revenue − Cost of goods sold) ÷ Revenue × 100
tl;dr
Gross margin is the percentage of revenue left after paying the direct costs to deliver your product. SaaS should target 80%+. If you're below 70%, your cost structure needs work.
Simple definition
Gross Margin is the percentage of revenue remaining after you subtract the direct costs of delivering your product or service. These are called "cost of goods sold" (COGS). For a SaaS product, COGS includes hosting, third-party API costs, payment processing fees, and customer support directly tied to serving users. It does not include your salary, marketing spend, or office rent -- those are operating expenses.
Gross margin tells you how efficiently you deliver value. A SaaS with 85% gross margin keeps $0.85 of every dollar to spend on growth, product, and profit. A marketplace with 25% gross margin keeps $0.25. Same revenue, very different economics.
How to calculate it
Gross margin = (Revenue - Cost of goods sold) / Revenue x 100
Say your MRR is $6,000. Your direct delivery costs:
- Vercel hosting: $40
- Database (PlanetScale): $39
- OpenAI API calls: $320
- Stripe fees (2.9% + $0.30): ~$204
- Customer support tool: $50
- Total COGS: $653
Gross margin = ($6,000 - $653) / $6,000 x 100 = 89.1%
That's strong. Most SaaS businesses aim for 80-90%. If you're relying heavily on expensive APIs (like AI inference), watch this number carefully as you scale. A $320 API bill at $6K MRR is fine. A $32,000 API bill at $60K MRR might compress your margins to 60%.
Example
You run a SaaS that generates AI-powered reports. At 50 customers, your OpenAI costs are $400/month and MRR is $3,500. Gross margin = 82%. You 5x to 250 customers. MRR is $17,500 but OpenAI costs jumped to $3,800 because heavy users generate 10x more reports than light users. Gross margin drops to 71%. You add usage caps on the lower tier and charge $0.10 per extra report. API costs stabilize at $2,200 for the same customer count. Gross margin recovers to 81%. The fix wasn't cutting a feature -- it was aligning your pricing with your cost structure.
Related reading
Related terms
- MRR
- CAC
- LTV
FAQ
Why does Gross Margin matter?+
It gives a fast signal about whether your product and distribution system is improving or regressing.