Everyday business math

Margin & Markup Calculator

Compare cost with selling price, or work backward from a percentage to a price. See why the same profit produces different margin and markup percentages.

Calculate margin, markup, and price

Compare existing prices, or calculate a price for a nonnegative target. Cost must be positive in the two target modes.

Use the same currency and one unit for both amounts. Enter nonnegative numbers without currency symbols. No tax, shipping, or fees are added automatically.

Grouped inputs such as 1,000.50 are accepted. Up to 15 integer digits and 10 decimal places per input; use a period for decimals.

Example: cost 80, price 100 → 20% margin and 25% markup.

Selling price per unit

Enter cost and a price or percentage, then select Calculate.

≈ marks display rounding. Calculations run in your browser. Press Enter in an input to calculate. Successful results appear in this tab's Recent calculations.

Formulas and worked examples

Compare a price

Cost 60, selling price 90

Profit = price − cost
Margin = profit ÷ price × 100
Markup = profit ÷ cost × 100

Profit is 30. Margin is 30 ÷ 90 × 100 = ≈ 33.33%; markup is 30 ÷ 60 × 100 = 50%.

Target margin

Cost 45, target margin 25%

Price = cost ÷ (1 − margin ÷ 100)

45 ÷ 0.75 = 60. Profit is 15. Dividing 15 by the price of 60 confirms the 25% margin.

Add a markup

Cost 45, markup 25%

Price = cost × (1 + markup ÷ 100)

45 × 1.25 = 56.25. Profit is 11.25, giving a 20% margin. The same target percentage has a different base.

Calculation rules and limits

Amounts and percentages use exact fractions internally. Only displayed values round, with halfway values rounded away from zero. Change decimal places to reveal more detail; this does not recalculate from rounded amounts or create a new history entry. The ≈ symbol identifies values changed by rounding.

The target modes solve for an unrounded price. Display rounding is not a rule for setting an actual selling price: a rounded-down price may miss the target. For example, a cost of 1 and a 30% target margin gives a price of 10/7, shown as ≈ 1.43 at two decimal places. Enter a proposed selling price in the first mode to check its resulting percentages.

Cost and selling price may be zero when comparing existing amounts. A zero selling price makes margin undefined; a zero cost makes markup undefined. Those percentages show “Not defined,” while any remaining results are still available. A price below cost produces a negative profit and, when their bases are positive, negative percentages.

Price-from-percentage modes require a positive cost. Target margin must be at least 0% and below 100%; markup must be from 0% to 1,000,000%. All fields accept at most 64 characters, 15 integer digits, and 10 decimal digits. For losses, use the cost-and-price comparison mode.

This is a per-unit arithmetic comparison of the amounts entered. It does not calculate net business profit, allocate overhead, convert currencies, or determine taxes. Expenses omitted from cost are not included in the result.

Definition reference: AccountingCoach — gross margin and markup, by Harold Averkamp, CPA, MBA.

Common questions

Can a margin be 100%?

With zero cost and a positive selling price, the comparison mode shows a 100% margin. With a positive cost, no finite selling price gives exactly 100%. A zero price and zero cost do not give a percentage margin because the denominator is zero.

Can I compare a sale made at a loss?

Yes. Choose cost and selling price. For cost 80 and price 50, gross profit is −30, margin is −60%, and markup is −37.5%. The calculator keeps these negative results instead of replacing them with zero.

Does changing decimal places change the answer?

It changes only the display. A very small nonzero result may appear as ≈ 0.00, accompanied by a notice. The underlying fraction remains available when you select more decimal places.

Which currency should I select?

No currency selection is needed because both monetary inputs must already use the same currency. All resulting amounts remain in that currency. Two decimal places is the initial display choice, not a claim about a currency's required pricing increment.