Margin calculator

Find the profit margin from cost and price, or the price for a target margin.

Cost and price → margin?
Cost at a % margin: price?

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

Common mistakes

In Excel and Google Sheets

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

More calculators