Margin calculator

Enter cost and selling price and this margin calculator shows gross profit, margin (as a share of the price), markup (as a share of the cost) and the price multiplier. You can also work out the selling price for a target margin or markup, or the highest cost you can pay for a given price. Use prices before sales tax or VAT.

Source: OpenStax Contemporary Mathematics, 6.2 Discounts, Markups, and Sales Tax (Rice University). Updated: .

before sales tax
For the totals: revenue, cost of goods and gross profit at this quantity. 1 = per-unit figures only.
One tier per line: quantity and selling price per unit. Each tier is measured against the cost above.
My ToolboxYour inputs are saved in this browser only.

Result

Gross profit per unit
200.00
Margin
20%
Markup
25%
Price multiplier (price ÷ cost)
1.25

How it is calculated

Profit margin formula

Margin % = (price − cost) ÷ price × 100. The difference between selling price and cost is the gross profit (accountants call net sales minus cost of goods sold the gross margin). As a percentage, margin is always measured against the selling price. Example: you buy for 800 and sell for 1,000 – gross profit 200, margin 200 ÷ 1,000 = 20%.

How to calculate profit margin

  1. Under “What do you want to calculate?”, choose the task, e.g. margin from cost and selling price, or selling price from a target margin.
  2. Enter the prices, or the target margin or markup.
  3. Read profit, margin, markup and multiplier.

Margin vs. markup

Markup measures the same profit against the cost: Markup % = (price − cost) ÷ cost × 100, so retail price = cost × (1 + markup). In the example that is 200 ÷ 800 = 25%. A 20% margin and a 25% markup describe exactly the same sale; markup is always the larger number because the cost is smaller than the price.

Converting with m = margin and a = markup (as decimals):

m = a ÷ (1 + a) and a = m ÷ (1 − m)

Marginequals markupMultiplier
20%25%1.25
25%33.33%1.33
30%42.86%1.43
50%100%2.00

The classic mistake: using the margin as a markup

If you want a 40% margin and simply add 40% to a 60 cost, you get 84 – which is only 24 ÷ 84 = 28.57% margin. The correct formula is price = cost ÷ (1 − margin): 60 ÷ 0.6 = 100. The other way round: to hit a 30% margin at a 49.90 price point, the item may cost at most 49.90 × 0.7 = 34.93.

Leave sales tax out

Sales tax (or VAT outside the US) is collected for the government and is not revenue. Calculate margin with prices before tax. To build a price that also covers shipping, packaging and marketplace fees, use the selling price calculator.

More pricing calculators: set prices including fees and tax with the selling price calculator, find your break-even point with the break-even calculator, and plan bulk pricing with the volume discount calculator.

Enter any two values – plus quantity and price breaks

Under “What do you want to calculate?” you choose which two figures you know: cost and selling price, one price with a margin or markup, or one price with the profit per unit. The calculator fills in the rest – profit, margin, markup, price multiplier and the missing price. With a quantity above 1 you also get the totals: revenue, cost of goods and gross profit for the whole order. In quantity price breaks, enter one quantity per line with the unit price you charge from that quantity on; the table shows margin, markup, profit per unit and total gross profit for every tier – so you see at once where a volume discount makes the margin too thin.

Frequently asked questions

How do I calculate profit margin?

Subtract cost from price, divide by price and multiply by 100: cost 800, price 1,000 → 200 ÷ 1,000 = 20%.

What is the difference between margin and markup?

Margin divides profit by the selling price, markup divides it by the cost. The same sale (800 → 1,000) has a 20% margin but a 25% markup.

How do I convert margin to markup?

Markup = margin ÷ (1 − margin). A 30% margin is 0.3 ÷ 0.7 = 42.86% markup. Back again: margin = markup ÷ (1 + markup).

How do I find the selling price from cost and margin?

Price = cost ÷ (1 − margin). For a 40% margin on a 60 cost: 60 ÷ 0.6 = 100. Adding 40% (84) would only give a 28.57% margin.

What is the margin formula in Excel?

With cost in A2 and price in B2: margin =(B2-A2)/B2, markup =(B2-A2)/A2, price for a target margin in C2 =A2/(1-C2). Format the results as percentages.

Sources and legal basis

As of: · Editorial policy

Related tools