Margin calculator
Enter cost and selling price to see 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.
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%.
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)
| Margin | equals markup | Multiplier |
|---|---|---|
| 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.
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
- OpenStax Contemporary Mathematics, 6.2 Discounts, Markups, and Sales Tax (Rice University)
- OpenStax Principles of Accounting, Vol. 1, 6.1 – gross margin (Rice University)
As of:
Related tools
- Selling price calculatorWork out the selling price of a product from cost, shipping, packaging, percentage selling fees and your target margin – fees are solved correctly.
- Break-even calculatorBreak-even point calculator for small businesses: units and sales dollars to break even from fixed costs, price and variable cost, plus a target profit.
- Discount calculatorPercent off calculator: sale price and savings for any discount, stacked discounts like 20% + 10%, the percent off between two prices and the original price.
- Percentage CalculatorFree percentage calculator: find X% of a number, what percent one number is of another, percentage change, increase and discount – with formula and steps.
- German VAT calculatorGerman VAT calculator: add VAT to a net price or remove it from a gross price at 19%, 7% or a custom rate – rounded to the cent, with formulas.
- Conversion rate calculatorCalculate your marketing conversion rate from visitors and conversions, plus average order value and revenue per visitor – or the traffic you need for a goal.