HubGov

Free tool · Pricing

Margin and markup calculator

Margin is calculated on the selling price, markup on cost: a 20% margin is a 25% markup. Enter two known values; the tool calculates the rest and converts one into the other.

Updated November 26, 2026 · HubGov team

What you know

Fictitious example — replace with your figures

$
$

Convert a margin to a markup (or back)

%

Equivalent markup: 25%

Result

Cost
$80.00
Selling price
$100.00
Profit
$20.00
MarginProfit ÷ price
20%
MarkupProfit ÷ cost
25%

The calculation runs in your browser: nothing is sent or stored. The copied link does not contain your figures.

Margin vs markup: the difference

Both measure the same profit, against a different base. Margin is profit divided by the selling price; markup is profit divided by cost.

Fictitious example: an $80 cost and a $100 price give a $20 profit, i.e. a 20% margin and a 25% markup. Mixing them up underprices: adding 20% to cost ($96) only yields a 16.7% margin.

The formulas

  • Margin = (price − cost) ÷ price
  • Markup = (price − cost) ÷ cost
  • Price from a margin = cost ÷ (1 − margin)
  • Price from a markup = cost × (1 + markup)
  • Markup = margin ÷ (1 − margin); margin = markup ÷ (1 + markup)

Edge cases

With a zero cost, margin is 100% and markup is undefined. With a zero price, margin is undefined. A margin of 100% or more cannot be reached with a positive cost: it would need an infinite price. The tool says so instead of showing a misleading result.

Frequently asked questions

What markup is a 20% margin?

25%. The formula is markup = margin ÷ (1 − margin), so 0.20 ÷ 0.80 = 0.25.

Which measure should I use in a bid?

The one your company tracks, as long as you do not mix them. Margin on price is the most common for managing profitability; markup is handy for building a price from costs.

Are my figures sent to HubGov?

No. The calculation runs in your browser and nothing is stored.

Move on to your bid price