Margin calculator

Enter cost and selling price to see gross profit, margin (as a share of the price), markup (as a share of the cost) and the price multiplier. You can also work out the selling price for a target margin or markup, or the highest cost you can pay for a given price. Use prices before sales tax or VAT.

$
$
before sales tax
Your inputs are saved in this browser only.

Result

Gross profit per unit
US$200.00
Margin
20%
Markup
25%
Price multiplier (price ÷ cost)
1.25

How it is calculated

Profit margin formula

Margin % = (price − cost) ÷ price × 100. The difference between selling price and cost is the gross profit (accountants call net sales minus cost of goods sold the gross margin). As a percentage, margin is always measured against the selling price. Example: you buy for $800 and sell for $1,000 – gross profit $200, margin 200 ÷ 1,000 = 20%.

Margin vs. markup

Markup measures the same profit against the cost: Markup % = (price − cost) ÷ cost × 100, so retail price = cost × (1 + markup). In the example that is 200 ÷ 800 = 25%. A 20% margin and a 25% markup describe exactly the same sale; markup is always the larger number because the cost is smaller than the price.

Converting with m = margin and a = markup (as decimals):

m = a ÷ (1 + a) and a = m ÷ (1 − m)

Marginequals markupMultiplier
20%25%1.25
25%33.33%1.33
30%42.86%1.43
50%100%2.00

The classic mistake: using the margin as a markup

If you want a 40% margin and simply add 40% to a $60 cost, you get $84 – which is only 24 ÷ 84 = 28.57% margin. The correct formula is price = cost ÷ (1 − margin): 60 ÷ 0.6 = $100. The other way round: to hit a 30% margin at a $49.90 price point, the item may cost at most 49.90 × 0.7 = $34.93.

Leave sales tax out

Sales tax (or VAT outside the US) is collected for the government and is not revenue. Calculate margin with prices before tax. To build a price that also covers shipping, packaging and marketplace fees, use the selling price calculator.

Frequently asked questions

How do I calculate profit margin?

Subtract cost from price, divide by price and multiply by 100: cost $800, price $1,000 → 200 ÷ 1,000 = 20%.

What is the difference between margin and markup?

Margin divides profit by the selling price, markup divides it by the cost. The same sale ($800 → $1,000) has a 20% margin but a 25% markup.

How do I convert margin to markup?

Markup = margin ÷ (1 − margin). A 30% margin is 0.3 ÷ 0.7 = 42.86% markup. Back again: margin = markup ÷ (1 + markup).

How do I find the selling price from cost and margin?

Price = cost ÷ (1 − margin). For a 40% margin on a $60 cost: 60 ÷ 0.6 = $100. Adding 40% ($84) would only give a 28.57% margin.

What is the margin formula in Excel?

With cost in A2 and price in B2: margin =(B2-A2)/B2, markup =(B2-A2)/A2, price for a target margin in C2 =A2/(1-C2). Format the results as percentages.

Sources and legal basis

As of:

Related tools