Margin Calculator

Enter cost and selling price to see profit, the margin percent of the selling price, and the markup percent of cost.

How it works

Profit is selling price minus cost. Margin divides that profit by the selling price; markup divides it by cost. Selling at 100 with cost 80 yields profit 20, a 20% margin and a 25% markup. Margin is undefined if the selling price is 0. Markup is undefined if cost is 0 and profit is not (you cannot express “infinite markup” as a percent here).

Formula

Profit = selling price − cost
Margin % = (profit ÷ selling price) × 100
Markup % = (profit ÷ cost) × 100

Worked examples

  • cost 80, selling 100 profit 20, margin 20%, markup 25%
  • cost 50, selling 50 profit 0, margin 0%, markup 0%

Useful notes

  • A 20% margin is not a 20% markup. Convert with the other percent rather than treating them as synonyms.
  • This is a pricing identity, not a tax or accounting statement.

FAQ

How do I calculate profit margin?
Subtract cost from selling price, divide by selling price, multiply by 100. (100 − 80) ÷ 100 = 20%.
Why are margin and markup different?
They use different denominators. The same 20 profit is 20% of 100 but 25% of 80.
What if cost is zero?
Profit equals the selling price and margin is 100%. Markup is not shown, because dividing by zero cost is undefined unless profit is also zero.

Related tools

See all Math tools.