Margin Calculator
Type what an item costs you and what you sell it for to get the margin and the…
Type what an item costs you and what you sell it for to get the margin and the markup side by side, or switch to finding the price for the margin you want.
Bought for $, sold for $. What’s the margin?
More optionsAmounts in US dollar
Currency
Only the symbol changes: the maths is the same in any currency.
Margin
37.5%
You keep $24 of every $64 sale. On the $40 cost that is a 60% markup.
The same $24 profit, divided two ways:
Margin 37.5% = $24 ÷ $64 price
Markup 60% = $24 ÷ $40 cost
Drag the handle, or use the arrow keys, to try another price.
How this works: 2 sources,
How this works
Method
Margin is the share of the selling price you keep after paying for the item. Subtract the cost from the price to get the profit, divide the profit by the price, and multiply by 100. A candle that costs $18 to make and sells for $30 leaves $12 of profit, and 12 ÷ 30 = 0.4, a 40% margin. Full method
How it’s tested
3 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.
Privacy
On your device. Nothing you enter or open leaves this browser. Without AI, everything stays on this device. If you added your own AI key, Ask sends your question (or, for Explain my result, the figures) to that provider. Built-in browser AI keeps it here. Until you add your own AI key, nothing can be sent. About privacy labels
Changes
- Added six pages for prices and profit: margin, profit margin, gross margin, markup, stacked discounts and commission, with a price bar you can drag and margins by industry.
- Added eight pages for common questions, from percent of a number to percent error and reverse percentages, each with its own method, examples and table.
- Added key facts with a worked example of each formula.
- Redesigned: type the numbers straight into a sentence, with bars on one scale that picture the answer.
- Results now update as you type, with no Calculate button.
- First published.
How to calculate margin from cost and price
Margin is the share of the selling price you keep after paying for the item. Subtract the cost from the price to get the profit, divide the profit by the price, and multiply by 100. A candle that costs $18 to make and sells for $30 leaves $12 of profit, and 12 ÷ 30 = 0.4, a 40% margin.
To set a price that hits a target margin, divide the cost by what the margin leaves: price = cost ÷ (1 − margin ÷ 100). For a 40% margin on an $18 cost that is 18 ÷ 0.6 = $30. The tempting shortcut, adding 40% to the cost, gives $25.20, which is only a 28.6% margin, because the 40% was taken from the cost, not the price.
Margin can never reach 100% unless the item costs nothing, and it turns negative the moment the price drops below cost. That is why retailers think in margin: a price cut of 10% on a 40% margin item takes a quarter of the profit, and the table below shows the price each margin needs.
margin = (price − cost) ÷ price × 100 · price = cost ÷ (1 − margin ÷ 100)
- Profit margin is profit divided by revenue, which is why it can never pass 100%, while markup is profit divided by cost and has no upper limit. Source: Wikipedia, Profit margin.
- Across 5,994 US listed companies, the average gross margin was 37.8% and the average net margin 9.7% (January 2026). Source: Aswath Damodaran, NYU Stern, Margins by Sector (US), January 2026.
The price for each target margin
The markup each margin needs and the price it gives on a $25 and a $40 cost, worked out exactly and rounded to the cent.
| Margin | Markup needed | Price on $25 | Price on $40 |
|---|---|---|---|
| 5% | 5.26% | $26.32 | $42.11 |
| 10% | 11.11% | $27.78 | $44.44 |
| 15% | 17.65% | $29.41 | $47.06 |
| 20% | 25% | $31.25 | $50 |
| 25% | 33.33% | $33.33 | $53.33 |
| 30% | 42.86% | $35.71 | $57.14 |
| 33% | 49.25% | $37.31 | $59.70 |
| 35% | 53.85% | $38.46 | $61.54 |
| 40% | 66.67% | $41.67 | $66.67 |
| 45% | 81.82% | $45.45 | $72.73 |
Show all 18 rowsShow fewer
| 50% | 100% | $50 | $80 |
| 55% | 122.22% | $55.56 | $88.89 |
| 60% | 150% | $62.50 | $100 |
| 65% | 185.71% | $71.43 | $114.29 |
| 70% | 233.33% | $83.33 | $133.33 |
| 75% | 300% | $100 | $160 |
| 80% | 400% | $125 | $200 |
| 90% | 900% | $250 | $400 |
Common questions
What is the difference between margin and markup?
Both start from the same profit. Margin divides it by the selling price, markup divides it by the cost. Buying at $40 and selling at $64 is a $24 profit: 24 ÷ 64 is a 37.5% margin and 24 ÷ 40 is a 60% markup. Margin is always the smaller number.
How do I price something for a 50% margin?
Divide the cost by 0.5, which doubles it. A $12 cost needs a $24 price for a 50% margin. That is the same as a 100% markup.
Is a 30% margin good?
It depends on the trade. US apparel companies averaged a 56.9% gross margin and grocery retailers 26.3% in Damodaran’s January 2026 data. Compare yourself with your own industry, and remember that a gross margin still has rent, wages and other running costs to pay.
Can a margin be negative?
Yes. Selling below cost gives a negative margin: buying at $50 and selling at $40 is a $10 loss, a −25% margin and a −20% markup.