Skip to content
Verify InstituteA little more certainty.No account required
Methods and assumptions documented

Margin & Markup Calculator

Analyze cost and selling price, or calculate a price for your own margin or markup target. See both percentages and the effect of rounding the target price upward.

Your cost, price & target

See the method ↓

Enter amounts in the selected currency. Percentages use 20 for 20%. Quantities must be whole numbers. Grouped thousands and fractions are accepted.

Loading calculator… If this message remains, reload the page.

Margin uses selling price as its base; markup uses cost. Changing mode clears the target percentage.

Price rounding & totals

Calculations run on your device. Input values are not placed in the URL or sent to analytics.

HOW THE CALCULATION WORKS

The same gross profit, measured against two different bases

  1. Gross profit per unit = selling price − entered cost. Gross margin (%) = profit ÷ selling price × 100. Markup (%) = profit ÷ cost × 100. A zero denominator is undefined.
  2. Price for target margin m = cost ÷ (1 − m/100), with positive cost and 0 ≤ m < 100%. Price for target markup u = cost × (1 + u/100), with positive cost and nonnegative markup up to 1,000,000%.
  3. When a price increment is selected, resulting unit price = ceiling(exact target price ÷ increment) × increment. This rounds UP to preserve the target, rather than rounding to the nearest price.
  4. Recalculate actual margin and markup from the resulting unit price. Multiply unit selling price, cost and profit by the whole-unit quantity for totals.

Worked example

For cost $20, target gross margin 30%, quantity 10 and a $0.01 increment: exact target price is 200/7, about $28.571429. Rounding UP gives $28.58 per unit. Actual gross margin is about 30.020994%, and markup is 42.9%. Revenue is $285.80, entered cost $200, and gross profit $85.80.

Defaults and assumptions

Limitations

Precision and rounding

Inputs and calculations use exact rational arithmetic (fractions). Target-price increments round upward; discount billing rounds half-up to cents according to the chosen policy. An exact halfway amount such as 1.005 rounds to 1.01. Standard money displays use two decimals. Unrounded estimates, intermediate values and billing adjustments use six decimals with ≈ only when that rendering differs from the exact value. Displays use integer arithmetic, including large totals; negative display ties round away from zero. Displayed percentages are rounded and marked approximately when needed. Exact fractions remain in calculation steps and review downloads. Currency labels do not convert exchange rates.

Sources

Use the assumptions, worked example and sources to interpret your result. Estimates do not replace professional advice.

How to use this calculator

  1. Choose analysis, target margin or target markup. Enter cost and the values required by that mode.
  2. For a target, choose a price increment or an exact unrounded estimate. Enter the whole-unit quantity and currency label.
  3. Calculate and compare the actual margin, markup and gross-profit totals. Review the different percentage bases before using the result.

Common questions

Why are margin and markup different?

Margin divides gross profit by selling price. Markup divides the same profit by cost. A 50% markup is not a 50% margin.

Why round target prices upward?

Rounding down can miss the selected target. The tool first finds the exact target price, then rounds upward to your chosen increment and reports the actual resulting rates.

Does gross profit include every business expense?

No. It subtracts only the cost you entered. Unentered overhead, taxes and other expenses are excluded.

Report a problem or suggest a calculator

Found a confusing result, a missing option, or an idea for a new calculator? Send it privately to the site owner.

Opening the form loads Cloudflare Turnstile, a spam check that processes connection and device information. Privacy details.

Related tools