Profit margin is profit as a percentage of the selling price. Subtract the cost from the price, divide by the price and multiply by 100: a cost of 60 and a price of 100 give a 40% margin. To hit a target margin, divide the cost by 1 minus the margin: 60 ÷ 0.6 = 100.
Formulas
margin % = (price − cost) ÷ price × 100price = cost ÷ (1 − margin % ÷ 100) Examples
- Cost 24, price 40: profit 16, margin 40%, markup 66.67%.
- Cost 75 at a 25% margin: 75 ÷ 0.75 = 100.
Common mistakes
- Confusing margin with markup. A 50% markup on cost is only a 33.33% margin.
- Adding the margin percentage to the cost: 60 + 40% = 84 gives a 28.57% margin, not 40%.
In Excel and Google Sheets
- Cost in A2, price in B2 (format as %)
=(B2-A2)/B2 - Price for the margin in C2
=A2/(1-C2)
FAQ
What is the difference between margin and markup?
Margin divides profit by the selling price; markup divides profit by the cost. The same sale always has a lower margin than markup.
Can a margin be 100%?
Only if the cost is 0. Any real cost keeps the margin below 100%.
Is gross margin calculated the same way?
Yes: gross margin is this formula applied to revenue and the cost of goods sold.
How we calculate: exact decimal math (no rounding errors), you choose the decimal places, and your numbers never leave your browser. Methodology →
Updated October 2026