Margin Calculator

Find your gross profit margin from cost and price — or work backward to the price a target margin requires.

$
$

Please enter valid values.

Gross margin
Gross profit
Margin
Equivalent markup

The margin formulas

Margin = (Price − Cost) ÷ Price × 100
Price for target margin = Cost ÷ (1 − target margin)
Worked example

Cost $40, price $60: margin = (60 − 40) ÷ 60 = 33.3%, profit $20.

Want a 40% margin on that $40 cost? Price = 40 ÷ 0.60 = $66.67.

Margin vs. markup — don't mix them

Both describe the same profit, divided by different denominators. Margin uses the selling price; markup uses the cost. A 50% markup equals a 33% margin. Businesses that price using markup but report using margin can badly misjudge profitability. Typical gross margins: software 60–80%, professional services 40–60%, retail 25–40%, grocery under 10%. Remember gross margin ignores overhead — rent, salaries, marketing — so net margin is always lower; find the sales volume that covers fixed costs with the break-even calculator, and price from cost-plus with the markup calculator.

Frequently asked questions

How do I calculate profit margin?

(Price − Cost) ÷ Price × 100. $40 cost, $60 price = 33.3%.

What is a good profit margin?

Industry-dependent: software 50–70%, retail 25–40%, grocery under 10%. Net margins are lower.

How do I price for a target margin?

Cost ÷ (1 − margin). 40% margin on $30 cost = $50.

Related calculators

Note: Gross margin only; excludes operating expenses and taxes. Not financial advice. Last reviewed: July 2026.