How to calculate profit margin (and why it isn’t the same as markup)
Profit margin is profit divided by selling price. Markup is profit divided by cost. Here are both formulas, how to price for a target margin, and the mistake that costs sellers money.
By Sharjil Hameed · Published November 13, 2026 · 2 min read · How we fact-check

Short answer: profit margin = (selling price − cost) ÷ selling price × 100. If something costs $30 and sells for $50, the profit is $20 and the margin is $20 ÷ $50 = 40%. Check yours with the profit margin calculator.

The profit margin formula
- Work out the profit: selling price − total cost.
- Divide the profit by the selling price.
- Multiply by 100 to get a percentage.
Total cost should include everything it takes to make the sale: the product, shipping, packaging, and platform and payment fees. Leaving out fees is the most common reason sellers overestimate their margin. Our marketplace calculators, such as the Etsy fee calculator and the eBay fee calculator, include those fees for you.
Margin vs markup
Markup uses the cost as the base, not the price:
Markup = (selling price − cost) ÷ cost × 100
| Cost $30, price $50 | |
|---|---|
| Profit | $20 |
| Profit margin | $20 ÷ $50 = 40% |
| Markup | $20 ÷ $30 = 66.7% |
The same sale gives a 40% margin and a 66.7% markup. Mixing them up is expensive: if you want a 40% margin but add 40% markup to a $30 cost, you charge $42 and earn only a 28.6% margin. The markup calculator converts between the two.
How to price for a target margin
Price = cost ÷ (1 − target margin)
For a 40% margin on a $30 cost: $30 ÷ (1 − 0.40) = $50.
For a 60% margin: $30 ÷ 0.40 = $75.
Gross margin vs net margin
- Gross margin counts only the direct cost of what you sold.
- Net margin subtracts every business expense too: rent, software, ads, and wages.
A product can have a healthy gross margin while the business has a thin net margin. Use the gross profit calculator for the first and the net profit calculator for the second.
What is a good profit margin?
It depends on the business. Handmade and digital products often run high gross margins because materials are cheap, while resellers of branded goods usually run lower ones. The useful question is whether your margin covers your overheads and pays you for your time; the break-even calculator shows how many sales that takes.
Related guides
- How to calculate your break-even point: the sales you need before you make any profit.
- How to price handmade products: turning costs and a target margin into a price.
- Etsy fees explained: the fees to subtract before you calculate margin on Etsy.
Frequently asked questions
Can profit margin be over 100%? No. Margin is a share of the price, so it can’t exceed 100%. Markup can, because it is measured against cost.
Is a 50% markup the same as a 50% margin? No. A 50% markup is a 33.3% margin. A 50% margin needs a 100% markup.
How do I calculate profit margin in Excel? Put the price in A1 and cost in B1, then use =(A1-B1)/A1 and format the cell as a percentage.
Run the numbers yourself
Free calculators with every fee and formula shown.