Margin Calculator

Find gross margin and markup from cost and selling price, set a price that hits a target margin, and convert between margin and markup.

Cost
$40.00
Selling price
$65.00
Gross profit
$25.00
Gross margin
38.46%profit as % of price
Markup
62.5%profit as % of cost
Gross margin38.46%$25.00 profit on a $65.00 sale

Show the work

  1. Gross profit = $65.00 − $40.00 = $25.00
  2. Margin = profit ÷ price = $25.00 ÷ $65.00 = 38.46%
  3. Markup = profit ÷ cost = $25.00 ÷ $40.00 = 62.5% (check: m ÷ (1 − m) = 62.5%)
Margin to markup conversion
Gross marginMarkup on costPrice for a $100 cost
10%11.11%$111.11
15%17.65%$117.65
20%25%$125.00
25%33.33%$133.33
30%42.86%$142.86
33.33%50%$150.00
35%53.85%$153.85
40%66.67%$166.67
45%81.82%$181.82
50%100%$200.00
60%150%$250.00
70%233.33%$333.33
75%300%$400.00
80%400%$500.00

Margin is the share of the selling price you keep after paying for the product itself. It is the number most retailers, wholesalers and finance teams use to judge pricing, and it is very often confused with markup. This calculator works out gross margin from cost and price, sets a price that achieves a target margin, or finds the maximum cost you can pay to keep a margin — and it always shows the matching markup so the two are never mixed up.

How to use the margin calculator

  1. Pick what you know: cost and selling price, cost and a target margin, or selling price and a target margin.
  2. Enter the two values.
  3. Read the answer on the tape, along with gross profit, gross margin and markup. The conversion table below shows common margins and the markup each one requires.

Margin formulas

Gross profit = Selling price − Cost
Gross margin = Gross profit ÷ Selling price
Selling price = Cost ÷ (1 − Margin)  ·  Cost = Price × (1 − Margin)

Margin vs. markup: the precise difference

Margin and markup use the same profit but divide it by different bases:

Margin = Profit ÷ Price  ·  Markup = Profit ÷ Cost
Markup = Margin ÷ (1 − Margin)  ·  Margin = Markup ÷ (1 + Markup)

Because the price is always larger than the cost (when there is a profit), margin is always the smaller of the two percentages. Margin can never reach 100%; markup can be any size.

Gross margin Markup on cost Price for a $100 cost
10% 11.11% $111.11
20% 25% $125.00
25% 33.33% $133.33
30% 42.86% $142.86
33.33% 50% $150.00
40% 66.67% $166.67
50% 100% $200.00
60% 150% $250.00
75% 300% $400.00

Worked examples

Margin from cost and price. Cost $40, price $65: profit = $25; margin = 25 ÷ 65 = 38.46%; markup = 25 ÷ 40 = 62.5%.

Price for a target margin. Cost $40, target 40% margin: price = 40 ÷ 0.60 = $66.67; profit $26.67; markup 66.67%.

Maximum cost. Price $65, target 40% margin: cost = 65 × 0.60 = $39.00.

Why the distinction matters

A business that wants a 40% margin but tells staff to “add 40%” to cost ends up with a 28.6% margin — almost a third less gross profit than planned. On $1 million of sales that is roughly $114,000 of missing profit. Industry benchmarks, investor reports and income statements almost always quote margin, while many price lists and wholesale agreements are written as markup, so converting carefully is essential.

Margin on discounts

Discounts are taken from the price, so they hit margin directly. An item with a 40% margin that is discounted 20% keeps only 25% of the new price as margin (cost 60 against price 80). The markdown calculator shows this effect in detail.

To work from markup instead, use the markup calculator. For margins after overhead, interest and tax, see the profit margin calculator, and for prices that also cover marketplace or card fees, the selling price calculator.

Results are estimates for pricing decisions and assume a single unit cost; they are not accounting or financial advice.

Frequently asked questions

What is the difference between margin and markup?

Both compare profit with something else. Margin divides profit by the selling price; markup divides the same profit by the cost. An item that costs $40 and sells for $65 has $25 of profit, a 38.46% margin and a 62.5% markup.

How do I price a product for a 40% margin?

Divide the cost by 1 minus the margin. For a $40 cost: 40 ÷ (1 − 0.40) = 40 ÷ 0.60 = $66.67. A common mistake is adding 40% to cost, which gives $56 and only a 28.6% margin.

Can margin be more than 100%?

No. Margin is profit as a share of price, and profit can't exceed the price unless the cost is negative. Markup has no upper limit: selling a $10 item for $50 is a 400% markup but an 80% margin.

How do I convert margin to markup?

Markup = margin ÷ (1 − margin). A 25% margin is 0.25 ÷ 0.75 = 33.33% markup. To go the other way, margin = markup ÷ (1 + markup).

Is gross margin the same as net profit margin?

No. Gross margin only subtracts the cost of the product. Net profit margin also subtracts rent, wages, marketing, interest and taxes. Use the profit margin calculator for those levels.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.