Margin and markup calculator

Find cost, selling price, profit, margin, and markup with clear denominators.

Margin = profit ÷ price. Markup = profit ÷ cost.

Assumptions & limits

Margin uses selling price as denominator; markup uses cost. In rate modes, margin ranges from −1,000,000% to below 100%; markup from −100% to 1,000,000% (−100% cannot recover cost from price). Computed prices round up to cents; computed costs round halfway up. Actual displayed percentages use the rounded amounts. Profit may be negative; cost and price cannot be. Zero denominators show Undefined.

Use one currency throughout. Monetary inputs: up to 999,999,999.99, two decimals, no commas. Rates: up to six decimals. Monetary results are limited to 999,999,999,999.99 in magnitude. Calculations stay on your device.

YOUR ANSWER

Profit / loss

$20.00

Cost
$80.00
Selling price
$100.00
Profit / loss
$20.00
Margin (profit / price)
20%
Markup (profit / cost)
25%
How it’s calculatedCalculated on your device

Profit = price − cost. Margin = profit / price × 100%; markup = profit / cost × 100%. Price from cost and margin: cost / (1 − margin). Price from markup: cost × (1 + markup). Computed selling prices round up to a cent; computed costs round to the nearest cent, halfway up. Displayed percentages are recalculated from those amounts.

Displayed values may be rounded. Calculations keep the underlying precision.

Cost and price must be nonnegative; profit/loss may be signed. Monetary inputs have two decimals and magnitude up to 999,999,999.99. In rate modes, margin is −1,000,000% to below 100%; markup is −100% to 1,000,000%, except that −100% cannot be used to recover cost from price. Rates have at most six decimals. Computed prices round upward to cents; computed costs round half up. All percentages are then recomputed from those amounts; zero denominators are Undefined. Monetary results are capped at 999,999,999,999.99.

The formula, made simple

Work with cost, selling price and profit using clearly separated margin and markup definitions. Choose the two values you know; the calculator shows the resulting amounts and actual percentages.

Profit = selling price − cost. Margin = profit / selling price × 100%. Markup = profit / cost × 100%. Price from margin = cost / (1 − margin); price from markup = cost × (1 + markup). Cost from price is price × (1 − margin), or price / (1 + markup).

A worked example

Cost 80 and price 100 give profit 20, a 20% margin, and a 25% markup. To target a 30% margin on cost 1, round the selling price up to 1.43; the actual margin is about 30.0699%.

A few useful answers

Why is markup higher than margin on the same profitable sale?

Both use the same profit, but markup divides by cost, while margin divides by the higher selling price.

Can a margin be negative or exactly 100%?

A below-cost sale has negative margin. A known positive price with zero cost has 100% margin and undefined markup. A target margin of 100% cannot uniquely determine price from cost, so that target mode rejects it.

Back to calculator ↑