What gross margin measures
Gross margin tells you how much of each dollar of revenue is left after paying for the thing you sold, before marketing, salaries outside delivery, rent and other operating costs. It is the first line of profitability on an income statement and a quick test of whether the product itself makes money.
Gross profit is the same idea in dollars: revenue − COGS. Gross margin is gross profit as a share of revenue, which makes businesses of different sizes comparable.
For marketers, gross margin sets the ceiling on what you can pay to win a customer. Every dollar of ad spend comes out of gross profit, so a 30% margin business and an 80% margin business need very different ROAS targets.
Gross margin formula
Gross profit = revenue − cost of goods sold
Gross margin = gross profit ÷ revenue × 100
What belongs in COGS depends on the business:
- Physical products: materials, manufacturing, inbound freight, packaging.
- SaaS: hosting and infrastructure, third-party APIs your product calls, customer support and onboarding staff, and often payment processing fees.
- Services: the time of the people who deliver the work.
Payment fees are sometimes booked as operating expenses instead. Either way, decide once and say which definition you use, because moving a 3% fee changes the margin by 3 points.
Worked example
A SaaS company has $40,000 of monthly revenue. Its COGS for the month:
| Cost | Amount |
|---|---|
| Hosting and databases | $4,200 |
| Email and AI APIs used by the product | $1,800 |
| Support staff (share of salary) | $3,000 |
| Payment fees (about 3.5%) | $1,400 |
| Total COGS | $10,400 |
Gross margin = ($40,000 − $10,400) ÷ $40,000 = 74%
An online store with the same $40,000 of revenue and $24,000 of product, shipping and fee costs has a gross margin of 40%. Both are healthy for their kind of business, but they can afford very different ad budgets.
How gross margin sets your break-even ROAS
If an ad brings $1 of revenue, you keep $1 × gross margin before paying for the ad. So the ad pays for itself when revenue × margin ≥ spend:
Break-even ROAS = 1 ÷ gross margin
At 74% margin, the SaaS breaks even at a ROAS of 1 ÷ 0.74 ≈ 1.35. At 40%, the store needs 1 ÷ 0.40 = 2.5. A campaign with a ROAS of 2 makes money for the first and loses it for the second. See break-even ROAS. For a stricter version that includes every variable cost, use contribution margin instead of gross margin.
Gross margin vs contribution margin
Gross margin follows accounting rules: it subtracts only COGS. Contribution margin subtracts every cost that rises with each sale, which often adds shipping to customers, sales commissions and marketplace fees. Contribution margin is usually lower, and it is the better input for pricing, discounts and channel decisions. Gross margin is the better number for comparing your business with others and for investors.
How to measure gross margin
- Use net revenue, after refunds, discounts and lost chargebacks. Gross revenue overstates the margin.
- Match costs to the same period as revenue. An annual hosting bill paid in January belongs spread over twelve months.
- Calculate it monthly and by product or plan. A free tier that costs hosting but brings no revenue drags SaaS margin down; it should show up somewhere.
- Know your exact payment fees per sale; the payment processor fee comparison helps when you compare providers.
Common gross margin mistakes
- Confusing margin with markup. Markup divides profit by cost; margin divides it by price. A product that costs $50 and sells for $100 has a 100% markup and a 50% margin.
- Leaving support and hosting out of SaaS COGS. It flatters the margin and makes comparisons with other SaaS companies wrong.
- Using gross margin to set ad targets when other variable costs are large. Shipping and returns can turn a 'profitable' ROAS into a loss.
- Comparing across industries. Software, retail and services have very different normal margins. Compare with your own history and with similar businesses.
How MetricRaven fits in
MetricRaven doesn't calculate gross margin: it doesn't see your hosting bill or product costs. It gives you the revenue side, split by where customers came from. Revenue is what customers paid (for Stripe, captured amounts before Stripe's fees), with refunds and lost disputes deducted. Processor fees are not subtracted, so apply your margin to it yourself.
With Meta Ads or Google Ads connected, the Revenue tab shows ROAS for each campaign. Compare it with 1 ÷ your gross margin to see which campaigns pay. See the Revenue dashboard docs and the break-even ROAS calculator.
Questions
- How do you calculate gross margin?
- Subtract the cost of goods sold from revenue, divide by revenue and multiply by 100. $200,000 of revenue with $60,000 of COGS is a gross margin of ($200,000 − $60,000) ÷ $200,000 = 70%.
- What is the difference between gross margin and gross profit?
- Gross profit is a dollar amount: revenue minus COGS. Gross margin is gross profit as a percentage of revenue. $70,000 of gross profit on $100,000 of revenue is a 70% gross margin.
- What is a good gross margin for SaaS?
- Software usually keeps most of its revenue after hosting and support, so margins well above those of physical goods are normal. Compare yours with your own trend and with SaaS companies of a similar model rather than with a single benchmark.
- How does gross margin affect ad spend?
- Break-even ROAS is 1 divided by your margin. At a 60% gross margin, every $1 of ads must bring at least $1.67 of revenue to pay for itself.