How to use the Margin Calculator
- Choose what you know: cost and price, cost and margin, or cost and markup.
- Enter the numbers.
- Read the selling price, profit, margin and markup.
How it works
Margin and markup both describe profit, but against different bases. Gross margin is profit as a percentage of the selling price. Markup is profit as a percentage of the cost. Buy at $40 and sell at $60 and you make $20: a 33.3% margin but a 50% markup.
Mixing them up is a common pricing mistake. If you want a 30% margin and add 30% to the cost, you only get a 23% margin. To hit a target margin, divide the cost by (1 − margin). Margin can never reach 100%, but markup can be any size.
Formula
Profit = price − cost Margin = profit ÷ price × 100 Markup = profit ÷ cost × 100 Price for a target margin = cost ÷ (1 − margin)
Example
A product costs $40 and you want a 30% margin. Price = 40 ÷ (1 − 0.30) = $57.14. Profit is $17.14, which is a 42.9% markup.
Margin vs markup chart
| Markup | Equals margin | Margin | Needs markup |
|---|---|---|---|
| 10% | 9.1% | 10% | 11.1% |
| 20% | 16.7% | 20% | 25.0% |
| 25% | 20.0% | 25% | 33.3% |
| 30% | 23.1% | 30% | 42.9% |
| 40% | 28.6% | 35% | 53.8% |
| 50% | 33.3% | 40% | 66.7% |
| 75% | 42.9% | 50% | 100.0% |
| 100% | 50.0% | 60% | 150.0% |
| 150% | 60.0% | 70% | 233.3% |
| 200% | 66.7% | 75% | 300.0% |
Frequently asked questions
What's the difference between margin and markup?
Margin is profit divided by price; markup is profit divided by cost. The same sale always has a higher markup than margin.
How do I calculate selling price from cost and margin?
Divide the cost by (1 − margin as a decimal). For a $25 cost and a 40% margin: 25 ÷ 0.6 = $41.67.
What is a good profit margin?
It varies widely by industry. Grocery stores often run on gross margins of 25–30%, while software and jewellery can exceed 50%. Compare with businesses like yours.
Is this gross or net margin?
Gross margin: it only counts the cost of the product. Net margin also subtracts rent, wages, marketing and taxes, so it's lower.
Last reviewed December 3, 2026. Spotted an error? Tell us.
Add this calculator to your website
Free for blogs, schools and businesses. Copy the code and paste it into your page (in WordPress, use a Custom HTML block). Please keep the credit link.