Profit Margin Formula: How to Calculate Margin and Markup
Learn the profit margin formula, how it differs from markup, and how to set a price for the margin you want. Clear examples and a comparison table.

Profit margin shows how much of each sale you keep as profit. Knowing your margin helps you price jobs, judge discounts and understand whether your business is healthy.
Profit margin = (price − cost) ÷ price × 100
Need more? Open the full free Profit Margin Calculator. No signup needed.
How do you calculate profit margin?
Example: you sell a service for 100 and it costs you 60 to deliver.
- Profit: 100 − 60 = 40
- Divide by the price: 40 ÷ 100 = 0.40
- Multiply by 100: 40% margin
Want to try it right away? Profit Margin Calculator is free and needs no signup.
What is markup and how is it different?
Markup is profit compared with cost, not with price.
Markup = (price − cost) ÷ cost × 100
Using the same numbers: 40 ÷ 60 = 0.667, so the markup is 66.7% while the margin is 40%. They are different measurements of the same profit.
| Markup | Margin |
|---|---|
| 25% | 20% |
| 50% | 33.3% |
| 100% | 50% |
| 200% | 66.7% |
A 50% markup does not give a 50% margin. This is one of the most common pricing mistakes. See also markup vs discount.
How do you set a price for a target margin?
Formula: price = cost ÷ (1 − margin)
Example: your cost is 70 and you want a 30% margin. 70 ÷ (1 − 0.30) = 70 ÷ 0.70 = 100.
How do you set a price with a markup?
Formula: price = cost × (1 + markup)
Example: cost 80 with a 50% markup gives 80 × 1.50 = 120. The margin on that sale is 40 ÷ 120 = 33.3%.
Why margin matters when you give discounts
A discount comes straight out of profit. On a price of 100 with a cost of 70, a 10% discount reduces profit from 30 to 20. Check your margin before you agree to a discount, and read bulk discount pricing.
Gross margin and net margin
- Gross margin counts only direct costs of the product or service.
- Net margin also subtracts overheads such as software, rent and tax.
Calculate margin and price
Use the profit margin calculator to find margin, markup or the price you need, without doing the formulas by hand.
Price for a target margin
If your cost is $42 and you want a 35% margin, divide the cost by 1 minus the margin:
42 ÷ (1 − 0.35) = 42 ÷ 0.65 = $64.62
Check it: profit is $22.62, and 22.62 ÷ 64.62 is 35%.
Gross margin and net margin in numbers
| Item | Amount |
|---|---|
| Revenue | $10,000 |
| Cost of goods sold | $6,000 |
| Gross profit | $4,000 |
| Operating expenses | $2,500 |
| Net profit | $1,500 |
Gross margin is 4,000 ÷ 10,000 = 40%. Net margin is 1,500 ÷ 10,000 = 15%. Gross margin shows how much each sale leaves after direct costs. Net margin shows what is left after all costs.
Use margin to set a discount limit
If your margin is 40%, a 20% discount leaves you with a much smaller profit. See markup vs discount for the effect.
Check your numbers regularly
Costs change. Review your margins each quarter, and raise prices when your costs go up. A small increase protects your profit more than you expect.
In a spreadsheet
With the price in A2 and the cost in B2:
- Profit:
=A2-B2 - Margin:
=(A2-B2)/A2 - Markup:
=(A2-B2)/B2
FAQ
What is a good profit margin?
It depends on the industry. Services often have higher margins than retail. Compare yourself with others in your field.
Is margin or markup bigger?
For the same profit, markup is always larger than margin, because cost is smaller than price.
How do I turn margin into markup?
Markup = margin ÷ (1 − margin). A 40% margin is 0.40 ÷ 0.60 = 66.7% markup.
Is this financial advice?
No. It explains the calculations. For decisions about your business, talk to an accountant.
What is a good profit margin?
It depends on the industry. Compare with similar businesses, and make sure your margin covers your overheads.
How do I raise my margin?
Raise prices, lower costs, or sell more of the products with higher margins.