HomeFinance › Margin and Markup Calculator

Margin and Markup Calculator

Computes profit, gross margin percentage and markup percentage from a unit cost and a selling price, or derives the selling price from cost plus a target margin or markup.

When to use

You are pricing a product or service and need to convert between cost, price, margin (profit as % of price) and markup (profit as % of cost).

Do not use when: You need the sales volume that covers fixed costs (use break-even) or the tax on the price (use sales-tax / vat).

Formula

profit = price − cost; margin_percent = profit / price × 100; markup_percent = profit / cost × 100; price from margin = cost / (1 − margin_percent/100); price from markup = cost × (1 + markup_percent/100)

Margin and markup describe the same profit relative to different bases (price vs cost), so markup is always the larger number: margin = markup / (1 + markup) and markup = margin / (1 − margin) in fractional form.

Inputs

ParameterTypeUnitRequiredDescription
costnumberyesCost of goods or unit cost. Range: > 0, ≤ 1000000000000
pricenumbernoSelling price. Give price, margin_percent or markup_percent (in that order of precedence). Range: ≥ 0, ≤ 1000000000000
margin_percentnumber%noDesired gross margin as percent of price; used when price is omitted. Range: ≥ -1000
markup_percentnumber%noDesired markup as percent of cost; used when price and margin_percent are omitted. Range: ≥ -100, ≤ 100000

Outputs

OutputTypeUnitDescription
pricenumberGiven or derived selling price.
profitnumberprice − cost.
margin_percentnumber%profit / price × 100.
markup_percentnumber%profit / cost × 100.
solved_fromstringWhich input determined the price: price, margin_percent or markup_percent.

Example

Cost 50, price 80: {"cost":50,"price":80}{"price":80,"profit":30,"margin_percent":37.5,"markup_percent":60,"solved_from":"price"}

Cost 40, target margin 25 %: {"cost":40,"margin_percent":25}{"price":53.33,"profit":13.33,"margin_percent":25,"markup_percent":33.33,"solved_from":"margin_percent"}

GET https://tttkmbb.com/api/v1/calculate/margin-markup?cost=50&price=80

Machine access

Sources

FAQ

Why is a 50 % markup only a 33.3 % margin?

Markup is measured on cost, margin on price. Cost 100 with 50 % markup sells for 150; the 50 profit is 33.3 % of the 150 price.

Can margin be 100 %?

No: a 100 % margin would require zero cost, so margin_percent must be below 100. Markup has no upper limit.

Related calculators