Margin is profit as a percentage of the selling price — the key metric for pricing and profitability.
How the Profit Margin Calculator works
Enter the selling price and the cost and the calculator returns the profit in dollars, the profit margin and the matching markup.
- Profit = price − cost.
- Margin = profit ÷ price × 100. Dividing by price is what makes it a margin.
- Markup = profit ÷ cost × 100, shown alongside so you can see both views of the same sale.
Percentages are shown to two decimal places. A cost higher than the price gives a negative margin (a loss); a zero cost gives the 100% ceiling. This is gross margin on one item or one sale; operating and net margin, which subtract overhead, interest and tax, are explained below. To set a price from a margin you want, divide the cost by (1 − margin): a $40 cost priced for a 40% margin is $40 ÷ 0.60 = $66.67.
Worked examples
Example 1 — a retail item. Price $120, cost $75. Profit $45. Margin = 45 ÷ 120 = 37.5%; markup = 45 ÷ 75 = 60%.
Example 2 — a digital product. Price $50, cost $20. Profit $30. Margin = 30 ÷ 50 = 60%; markup = 30 ÷ 20 = 150%. Markup can exceed 100%; margin cannot.
Example 3 — a thin grocery margin. Price $200, cost $185. Profit $15. Margin = 15 ÷ 200 = 7.5%; markup = 15 ÷ 185 = 8.1%. At small margins the two numbers almost match.
Example 4 — pricing from a target margin. Your cost is $40 and you want a 40% margin. Price = cost ÷ (1 − 0.40) = $40 ÷ 0.60 = $66.67, leaving $26.67 of profit. Adding 40% to cost instead gives $56.00 and only a 28.6% margin. For a 35% margin the price is $40 ÷ 0.65 = $61.54.
| Scenario | Price | Cost | Profit | Margin | Markup |
|---|---|---|---|---|---|
| Retail item | $120.00 | $75.00 | $45.00 | 37.5% | 60.0% |
| Digital product | $50.00 | $20.00 | $30.00 | 60.0% | 150.0% |
| Grocery item | $200.00 | $185.00 | $15.00 | 7.5% | 8.1% |
| Priced for a 40% margin | $66.67 | $40.00 | $26.67 | 40.0% | 66.7% |
Tips for using the Profit Margin Calculator
- Divide by price, not cost. If your margin comes out above 100%, you calculated markup.
- Put every direct cost in the cost field: shipping, payment processing, packaging and returns. Leaving them out overstates the margin.
- Price from the margin you want: price = cost ÷ (1 − margin). Adding a percentage to cost gives a smaller margin than the percentage suggests (a 40% markup is a 28.6% margin).
- Discounts hit margin harder than they look: a 15% discount on a $100 item that costs $70 takes the margin from 30% to 17.65%, because the whole cut comes out of profit.
Margin vs markup: same sale, two different numbers
Margin and markup describe the same dollar of profit measured against different bases. Margin divides profit by the selling price; markup divides the same profit by the cost. Because price is larger than cost on any profitable sale, margin is always the smaller percentage, and the gap widens as profit grows: $30 of profit on a $20 cost sold for $50 is a 60% margin but a 150% markup.
That is also why margin has a ceiling and markup does not. You cannot keep more than the price you charged, so margin tops out at 100% (zero cost); markup divides by cost, which can be tiny, so a $1 item sold for $10 is a 900% markup and a 90% margin. Convert between them with markup = margin ÷ (1 − margin) and margin = markup ÷ (1 + markup); the conversion table is in the quick reference below, and the markup calculator works from the cost side. See also why profit margin cannot exceed 100%.
Gross vs operating vs net margin: what each one subtracts
The three margins use the same divide-by-revenue formula but a bigger pile of costs at each level, so the percentage shrinks as you move down the income statement.
- Gross margin = (revenue - cost of goods sold) / revenue. It removes only the direct cost of producing what you sold. This is what the calculator above shows from a single price and cost.
- Operating margin = operating profit / revenue. It also subtracts overhead - rent, salaries, marketing, software - but not interest or tax.
- Net margin = net profit / revenue. It subtracts everything, including loan interest and income tax. This is the final cents of every sales dollar you actually keep.
A worked stack on $1,000,000 of revenue: if COGS is $600,000, gross profit is $400,000 (40% gross margin). Take out $250,000 of overhead and operating profit is $150,000 (15% operating margin). Take out $50,000 of interest and tax and net profit is $100,000 - a 10% net margin. Same revenue, three very different numbers, which is why you must always state which margin you mean before comparing two businesses.
Common mistakes that wreck a margin calculation
Most margin errors come from using the wrong denominator or mixing cost layers.
- Dividing profit by cost. This gives markup, which reads higher and makes you think you are more profitable than you are. Always divide by price.
- Pricing off markup but reporting margin. Adding a 40% markup to cost yields only a 28.6% margin, not 40% - an 11-point gap that quietly erodes the bottom line.
- Forgetting hidden direct costs. Shipping, payment-processing fees, returns, and packaging are part of cost. Leave them out and your margin is fiction.
- Comparing your gross margin to a competitor's net margin. Match like with like or the comparison is meaningless.
- Treating a discount as a margin point. A 15% discount on a $100 item (cost $70) does not shave 15 margin points - it drops margin from 30% to 17.65%, because the cut comes straight out of profit. Model price cuts in the discount calculator first.
- Averaging product margins without weighting by sales. A simple average overstates blended margin when your cheap, low-margin items move the most volume.
How to calculate profit margin in Excel or Google Sheets
You do not need a special function - margin is one subtraction and one division. Put the selling price in cell A2 and the cost in B2, then:
- Dollar profit:
=A2-B2 - Margin as a percent:
=(A2-B2)/A2- then format the cell as a percentage, or wrap it as=(A2-B2)/A2*100for a plain number. A $250 price and $175 cost returns 30% on a $75 profit. - Markup from the same cells:
=(A2-B2)/B2(note the denominator is cost).
To work backward and set a price from a target margin (say a 40% margin in cell C2 entered as 0.40): =B2/(1-C2). To convert a margin in C2 into its equivalent markup: =C2/(1-C2); to convert a markup into a margin: =C2/(1+C2). Guard against divide-by-zero on the margin formula with =IF(A2=0,"",(A2-B2)/A2) so a blank price row does not throw a #DIV/0! error. Google Sheets uses the identical formulas - a template built in one works in the other.
How to raise your profit margin
Because margin is profit over price, you can only raise it by increasing price, cutting cost, or shifting your sales mix toward higher-margin items. Each lever behaves differently:
- Raise price. The fastest lever - on a $100 item at a $70 cost, lifting price 5% to $105 raises margin from 30% to 33.33% because the extra $5 is pure profit, as long as you do not lose too much volume.
- Cut direct cost. A supplier dropping that same $70 cost by 10% to $63 raises margin from 30% to 37%, since the $7 saved is $7 of added profit.
- Reduce overhead. This lifts operating and net margin even when gross margin holds steady.
- Re-mix sales. Push the products with the fattest margins and de-emphasize the ones that barely clear cost.
- Add value instead of discounting. Bundling or upgrading raises the average price without an outright price hike.
Be careful with discounts - at low margin levels a small price cut takes a large bite out of profit. If you are deciding whether a margin improvement is worth a one-time investment, compare it as a return using the ROI calculator.
Margin vs markup conversion and margin layers: a quick reference
Margin and markup measure the same dollar of profit against different bases - margin divides by the selling price, markup divides by cost - so the two percentages never match. Margin is always below 100% because profit is always smaller than the price you charge; markup has no ceiling. The first table converts between the two (all values computed with margin = markup / (1 + markup) and markup = margin / (1 - margin)). The second shows how the three margin types shrink as more costs are subtracted from the same $100,000 of revenue.
| Markup | Equivalent margin | Margin | Equivalent markup |
|---|---|---|---|
| 20% | 16.7% | 20% | 25.0% |
| 25% | 20.0% | 25% | 33.33% |
| 50% | 33.33% | 30% | 42.86% |
| 60% | 37.5% | 40% | 66.67% |
| 100% | 50.0% | 50% | 100.0% |
| 200% | 66.7% | 60% | 150.0% |
The three margin types on a single business with $100,000 revenue, $60,000 cost of goods, $25,000 overhead, and $5,000 interest plus tax:
| Margin type | What it subtracts | Profit left | Margin |
|---|---|---|---|
| Gross margin | Cost of goods only | $40,000 | 40.0% |
| Operating margin | Cost of goods + overhead | $15,000 | 15.0% |
| Net margin | Cost + overhead + interest + tax | $10,000 | 10.0% |
Related on this site
markup calculator · convert markup to margin and back · cost-plus pricing · why margin cannot exceed 100% · break-even calculator
How we calculate this
This tool uses the standard formula shown above, runs entirely in your browser and stores nothing you type. Results are estimates for planning — not financial, tax or legal advice. Background reading: SBA — manage your finances. Found an error? Tell us and we will fix it.
Profit Margin Calculator — frequently asked questions
- How do I find both the margin and markup on a $200 item that costs $130?
- A $200 item costing $130 has a 35% profit margin and a 53.85% markup. The $70 profit (200 - 130) is divided two different ways: margin uses the selling price (70 / 200 = 35%), while markup uses the cost (70 / 130 = 53.85%). Same dollar profit, two different percentages. Margin is always the smaller number because the selling price is always larger than the cost.
- How do I convert a 50% markup into a margin?
- A 50% markup equals a 33.33% margin. Use the formula margin = markup / (1 + markup), so 0.50 / 1.50 = 0.3333. The number always shrinks because markup measures profit against the smaller cost and margin measures it against the larger price. Quick checks: a 25% markup is a 20% margin, 100% markup is a 50% margin, and 200% markup is a 66.67% margin.
- How do I convert a 40% margin into a markup?
- A 40% margin equals a 66.67% markup. Use markup = margin / (1 - margin), so 0.40 / 0.60 = 0.6667. The number always grows when going from margin to markup. Other common conversions: a 30% margin is a 42.86% markup, a 25% margin is a 33.33% markup, and a 50% margin is exactly a 100% markup. Confusing the two is the most expensive pricing mistake small businesses make.
- Can a profit margin ever be more than 100%?
- No, a profit margin can never exceed 100% when your cost is above zero. Margin is profit divided by the selling price, and profit (price - cost) is always smaller than the price itself, so the ratio stays below 100%. A 100% margin would require zero cost. This is the key difference from markup, which has no ceiling - markup can be 200%, 500%, or higher because it divides by cost, not price.
- How do I calculate profit margin in Excel?
- In Excel, enter your selling price in B2 and your cost in C2, then put =(B2-C2)/B2 in another cell and format it as a percentage. For a $250 price and a $175 cost, this returns 30% on a $75 profit. To convert margin to markup in the next cell, use =D2/(1-D2) where D2 holds the margin. Google Sheets uses the exact same formulas, so a template built in one works in the other.
- My cost is $40 and I want a 35% margin - what price should I charge?
- To earn a 35% margin on a $40 cost, charge $61.54. The formula is price = cost / (1 - margin), so 40 / 0.65 = 61.54, which leaves $21.54 of profit. Do not make the common error of adding 35% to cost - that produces only a 25.9% margin. Pricing from the margin you want, not from a markup percentage, is the only way to guarantee the bottom-line percentage you are targeting.
Guides & articles
- How to Convert Markup to Margin and Back: Formulas, a Reference Table, and Worked Examples
- Why Profit Margin Can Never Exceed 100% (and Markup Can)
Related calculators
Markup Calculator · Break-Even Calculator · ROI Calculator · CAGR Calculator · Sales Tax Calculator · VAT Calculator