Gross Margin Calculator
Enter revenue and what it cost to deliver, as one total or line by line. You get gross profit, gross margin and markup, and the revenue or price that reaches the margin you want.
For one period, such as a month, or for one unit you sell.
To see the revenue or price that reaches it at this cost.
- Hosting: $4,000 (8%)
- Payment fees: $1,600 (3%)
- Support: $3,000 (6%)
- Software: $1,400 (3%)
- Gross profit: $40,000 (80%)
- $4,000 + $1,600 + $3,000 + $1,400= $10,000 cost
- $50,000 − $10,000= $40,000 gross profit
- $40,000 ÷ $50,000 × 100= 80.0% margin
- $40,000 ÷ $10,000 × 100= 400.0% markup
- $10,000 ÷ (1 − 85%)= $66,667 needed
Gross margin is gross profit divided by revenue.
gross profit = revenue − cost of revenue
gross margin = gross profit ÷ revenue × 100
The calculator starts with $50,000 of monthly revenue and $10,000 of cost: $4,000 of hosting, $1,600 of payment fees, $3,000 of support and $1,400 of software in the product. Gross profit is $40,000, and $40,000 divided by $50,000 is 80.0%.
The example's gross margin
The payment line is not made up: it is Stripe's standard 2.9% + 30¢ on 500 payments of $100, which is $1,600.
Markup divides the same profit by cost, so it is always the larger number.
markup = gross profit ÷ cost × 100
gross margin = markup ÷ (100% + markup)
The example's $40,000 of gross profit is 80.0% of revenue but 400% of cost. A price set at cost plus 100% gives a 50% margin, not 100%.
| Markup on cost | Gross margin |
|---|---|
| 25% | 20.0% |
| 50% | 33.3% |
| 100% | 50.0% |
| 200% | 66.7% |
| 300% | 75.0% |
| 400% | 80.0% |
To reach a target margin, divide the cost by one minus the margin.
price for a margin = cost ÷ (1 − target margin)
At the example's $10,000 of cost, an 85% margin needs $66,667 of revenue. For one unit that costs $20 to deliver, an 80% margin needs a $100 price and a 90% margin $200: the last 10 points double the price.
The price a $20 cost needs for each margin
For a SaaS business, cost of revenue is what it takes to deliver the product.
- Hosting and infrastructure. Servers, databases and bandwidth that run the product for paying customers.
- Payment processing fees. The fee taken from each subscription payment.
- Customer support. The people and tools that keep paying customers running.
- Software in the product. Third-party services the product calls or embeds for every customer.
Sales, marketing and building new features are costs too, but they sit below gross profit. Gross margin answers a narrower question: what is left from each dollar after delivering what the customer paid for.
Payment fees take a bigger share of a cheap plan than of an expensive one.
Stripe's standard US price is 2.9% + 30¢ per successful payment on a domestic card. The fixed 30 cents weighs more on a small payment, so a $10 plan loses 5.9% of its price to the fee and a $299 plan 3.0%.
Stripe's fee as a share of a monthly plan's price
Source: Stripe, stripe.com/pricing, read 16 October 2026.
The Stripe fee calculator works out the fee on any charge, and the customer lifetime value calculator uses gross margin to turn revenue per customer into lifetime value. 1Capture collects the first payment in the last 2 hours of a trial and retries it up to 10 times if it fails, as the payment capture page explains.
People also ask these questions about gross margin.
How do you calculate gross margin?
Subtract the cost of revenue from revenue to get gross profit, divide gross profit by revenue and multiply by 100. $50,000 of revenue with $10,000 of cost leaves $40,000, and $40,000 divided by $50,000 is a 80.0% gross margin.
What is the difference between gross margin and markup?
Both start from gross profit. Gross margin divides it by revenue and markup divides it by cost. $40,000 of gross profit on $10,000 of cost is a 400% markup and, on $50,000 of revenue, an 80.0% margin.
Is gross margin the same as gross profit?
No. Gross profit is an amount in dollars: revenue less the cost of revenue. Gross margin is that amount as a percentage of revenue.
How do you price a product for a 50% margin?
Divide the cost by 1 minus the margin. For 50%, that is the cost divided by 0.5, which doubles it: a $20 cost needs a $40 price.
What goes into cost of revenue for a SaaS company?
The costs of delivering the product to paying customers: hosting and infrastructure, payment processing fees, customer support, and third-party software built into the product. Sales, marketing and building new features sit below gross profit.
Can gross margin be negative?
Yes. When the cost of revenue is larger than revenue, gross profit is below zero and so is the margin: each sale costs more to deliver than it brings in.
These free calculators cover the rest of your subscription numbers.
- Trial conversion rate calculatorYour trial-to-paid rate, and what each extra point is worth in MRR.
- Churn rate calculatorCustomer churn, MRR churn and net revenue retention, by month and year.
- Customer lifetime value calculatorLTV from ARPA, margin and churn, with the LTV to CAC ratio.
- MRR and ARR calculatorNet new MRR, ending MRR and ARR, drawn as a waterfall.
- Failed payment recovery calculatorWhat failed payments cost a month and a year, and what recovery saves.
- Stripe fee calculatorThe Stripe fee on any charge, and what you keep.
- PayPal fee calculatorPayPal's fee by how the buyer pays, at its current US rates.
- Square fee calculatorSquare's fee on the Free, Plus or Premium plan, and what you keep.
- Price increase calculatorThe percentage change, the new MRR, and how many customers can leave.
- Proration calculatorProrate a price by the day, and price a mid-period plan change.