HomeBusiness & Money Math › Profit Margin Calculator

Profit Margin Calculator

Free profit margin calculator. Find profit and profit margin percentage from price and cost.

Margin is profit as a percentage of the selling price — the key metric for pricing and profitability.

How the Profit Margin Calculator works

Profit margin is your profit expressed as a percentage of the selling price, so the calculator divides profit by price - not by cost. This single choice of denominator is what separates margin from markup, and it is why a margin can never reach 100% while the cost is above zero.

The formula has three variables:

  • Price = the selling price (revenue) for one unit.
  • Cost = the cost of goods, or the cost figure you are measuring against.
  • Profit = price - cost.

The margin percentage is then profit / price x 100.

Internally the tool runs these steps:

  1. Read your price and cost inputs and treat them as dollars.
  2. Subtract cost from price to get profit in dollars.
  3. Divide that profit by the price (the revenue), not the cost - this is the step that makes the result a margin and not a markup.
  4. Multiply by 100 and round to one decimal place for the margin percentage.
  5. Report the dollar profit and the margin % side by side so you see both the absolute and the relative result.

Edge cases the engine handles cleanly:

  • Cost greater than price returns a negative profit and a negative margin - you are selling at a loss. Selling for $90 something that cost $100 gives a margin of (90 - 100) / 90 = -11.11%.
  • Zero cost gives a 100% margin, the mathematical ceiling: when cost is $0, all revenue is profit.
  • Price of $0 would divide by zero, so the tool blocks it - margin is undefined when there is no revenue.
  • Because the denominator is price, and profit can never be larger than price (you cannot keep more than you charged), the result is always capped below 100% on any sale with a real cost. If you ever see a margin above 100%, you have accidentally divided by cost and computed markup instead.

Example calculation

Here are three worked examples that show how the same cost can produce very different margins depending on the price you set - and how margin always reads lower than the matching markup.

Example 1 - a typical retail item. You sell a product for $120 that costs you $75. Profit = $120 - $75 = $45. Margin = $45 / $120 x 100 = 37.5%. Watch the denominator: divide by the $120 price, not the $75 cost. (Dividing by cost would give 60% - that is markup, a different number for the same sale.)

Example 2 - a high-margin service or digital product. You charge $50 for something that costs $20 to deliver. Profit = $50 - $20 = $30. Margin = $30 / $50 x 100 = 60.0%. The matching markup is $30 / $20 = 150%, which proves the point: markup can exceed 100%, margin never can.

Example 3 - a thin-margin grocery-style sale. You sell an item for $200 that costs $185. Profit = $200 - $185 = $15. Margin = $15 / $200 x 100 = 7.5%. The equivalent markup is $15 / $185 = 8.1% - nearly identical to the margin here only because the margin is so small.

Put the three side by side and the relationship becomes obvious:

ScenarioPriceCostProfitMargin %Equivalent markup %
Retail item$120.00$75.00$45.0037.5%60.0%
Digital/service$50.00$20.00$30.0060.0%150.0%
Grocery-style$200.00$185.00$15.007.5%8.1%

The takeaway: the bigger the margin, the wider the gap between margin and markup. At a tiny 7.5% margin the two figures nearly match; at a fat 60% margin the markup (150%) is more than double the margin. Always confirm which one a supplier or spreadsheet means before you compare quotes - a "60%" from one source and a "60%" from another can describe completely different profitability.

Tips for using the Profit Margin Calculator

  • <strong>Divide by price, not cost.</strong> The single most common error is using cost as the denominator - that produces markup. If your margin answer is above 100%, you used the wrong number on the bottom.
  • <strong>Lock in which margin you mean.</strong> Gross margin subtracts only direct cost; operating margin also subtracts overhead like rent and salaries; net margin subtracts everything including interest and tax. A 40% gross margin can become a 10% net margin once the full stack is removed.
  • <strong>Raise margin by trimming cost OR raising price - they are not equal in risk.</strong> A $1 price increase adds $1 to profit; a $1 cost cut also adds $1, but cost cuts often risk quality while price increases risk volume. Model both before choosing.
  • <strong>Small price moves swing margin hard at low margins.</strong> At a 30% margin, a 15% discount on a $100 item drops your margin all the way to 17.65%, because the cut comes straight out of profit while cost stays put.
  • <strong>Use the conversion formulas instead of guessing.</strong> To turn margin into markup: markup = margin / (1 - margin). To go the other way: margin = markup / (1 + markup). A 50% markup is only a 33.33% margin.
  • <strong>Price from a target margin, not a target markup.</strong> For a 40% margin, price = cost / (1 - 0.40) = cost / 0.60. On a $40 cost that is $61.54; simply adding 35% to cost gives only a 25.9% margin, short of target.
  • <strong>Blend your margins by revenue, not by simple average.</strong> A high-margin product that sells little can be dragged down by a low-margin product that sells a lot. Weight each product's margin by its share of total sales.
  • <strong>Watch the margin trend, not just the level.</strong> A margin sliding from 38% to 34% over three quarters signals rising costs or creeping discounting before it ever shows up as a cash problem.
  • <strong>Put every direct cost into the cost figure.</strong> For ecommerce especially, shipping, payment-processing fees, returns, and packaging belong in cost - leave them out and a $45 sale that looks 56% margin is really closer to 36%.
  • <strong>Don't confuse a high margin with high profit.</strong> A 70% margin on a $10 item earns less per sale than a 15% margin on a $500 item. Pair margin % with dollar profit and unit volume before deciding what to push.

Margin vs markup: same sale, two different numbers

Margin and markup describe the exact same dollar of profit but measure it against different bases, so they are never the same percentage on a profitable sale. Margin divides profit by the selling price; markup divides the same profit by the cost. Because price is always larger than cost on a profitable sale, the margin percentage is always the smaller of the two.

Here is one sale - $30 profit on a $20-cost item sold for $50 - viewed both ways, plus a few common conversions:

CostPriceProfitMarkup (/ cost)Margin (/ price)
$20.00$50.00$30.00150.0%60.0%
$100.00$150.00$50.0050.0%33.3%
$100.00$125.00$25.0025.0%20.0%
$100.00$200.00$100.00100.0%50.0%

Convert between them with: markup = margin / (1 - margin) and margin = markup / (1 + markup). The gap widens as profit grows, which is exactly why markup can pass 100% while margin physically cannot. Run the cost-side view in the markup calculator to see the same sale from the supplier's angle.

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*100 for 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.

Is your margin good? Typical margins by industry

There is no universal "good" margin - a healthy number for software would be a disaster for a grocery store. Margin is driven by how much value you add versus how much you spend on goods. Use these rough US reference bands as a sanity check, not a rule:

Industry typeTypical gross marginTypical net margin
Software / SaaS70% and up15% - 30%+
Professional services / consulting40% - 60%10% - 20%
Restaurants60% - 70% (food cost ~30%)3% - 9%
General retail25% - 50%2% - 8%
Grocery15% - 25%1% - 3%

Software hits the top of the range because copying a product costs almost nothing; grocery sits at the bottom because food is bought, stocked, and spoils at high cost. Low-margin models survive on volume and turnover; high-margin models survive on smaller numbers of high-value sales. Before judging a business overall, check whether the price even clears costs at your sales level with the break-even calculator, and see the SBA's guidance on managing business finances for context on overhead and cash flow.

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.

Why margin is capped at 100% and markup is not

Margin can never reach or exceed 100% because profit can never be larger than the price you charged. The most you can possibly keep from a $50 sale is $50 - and that happens only if the item cost you nothing, which is a 100% margin. There is no way to keep more than the full selling price, so 100% is a hard ceiling.

Markup has no such ceiling because its denominator is cost, which can be tiny relative to profit. Buy something for $1 and sell it for $10 and the markup is 900% ($9 profit / $1 cost), while the margin is just 90% ($9 / $10). This is the core reason the two metrics must never be used interchangeably: a number like "300% markup" is ordinary, but "300% margin" is impossible and signals a calculation error. When a result looks too good, check whether profit was divided by cost (markup) or by price (margin).

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.

MarkupEquivalent marginMarginEquivalent 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 typeWhat it subtractsProfit leftMargin
Gross marginCost of goods only$40,00040.0%
Operating marginCost of goods + overhead$15,00015.0%
Net marginCost + overhead + interest + tax$10,00010.0%

Related on this site

Markup Calculator · Break-Even Calculator · ROI Calculator · Discount Calculator · Sales Tax Calculator · Profit Margin Calculator

For a related deep dive, see SBA managing business finances.

Profit Margin Calculator — frequently asked questions

Good margin?
Depends on industry: software can exceed 70%, grocery is single digits.
Gross vs net margin?
This is gross margin (price − direct cost). Net margin also subtracts overhead and tax.
What's a good profit margin?
Highly industry-dependent — software can exceed 70%, grocery is single digits.
Gross vs net margin?
Gross uses direct cost; net also subtracts overhead, tax and interest.
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 <a href="/markup-calculator/">markup</a> 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 <a href="/markup-calculator/">markup</a>, which has no ceiling - markup can be 200%, 500%, or higher because it divides by cost, not price.
What is the difference between gross, operating, and net margin on the same business?
Gross, operating, and net margin subtract progressively more costs from the same revenue. On $100,000 revenue: gross margin subtracts only $60,000 cost of goods sold, leaving 40%. Operating margin also subtracts $25,000 of overhead like rent and salaries, leaving 15%. Net margin then subtracts $5,000 of interest and tax, leaving 10%. Each layer is smaller than the last, which is why a healthy gross margin can still end in a thin net margin.
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.
A 5% price increase did what to my 30% margin?
Raising a $100 price by 5% to $105, with cost held at $70, lifts your margin from 30% to 33.33%. The extra $5 of revenue is pure profit because the cost did not move, so profit jumps from $30 to $35. This is why margin is so sensitive to price: a small price bump flows almost entirely to the bottom line, while the same gain through volume requires selling more units at the old thin margin.
My supplier cut my cost 10% - how much did my margin rise?
Cutting your cost 10%, from $70 to $63 on a $100 selling price, raises your margin from 30% to 37%. The $7 saving becomes $7 of added profit, lifting profit from $30 to $37. Cost cuts and price increases both improve margin, but cost cuts are often easier to negotiate than price hikes customers will notice. Combine both for the biggest effect on your <a href="/profit-margin-calculator/">profit margin</a>.
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.
Why does software have a 70% margin while groceries have a 2% margin?
Software hits 70%+ margins because copying a product costs almost nothing, while groceries run 1-3% because food is bought, stocked, and spoils at high cost. On a $99 software sale at a 70% margin, $69.30 is profit and only $29.70 is cost. On $500,000 of grocery revenue at a 2% net margin, just $10,000 is profit. Margin is mostly set by your cost structure, not by how hard you work.
What net profit do I keep on $1,000,000 in revenue at an 8% net margin?
An 8% net margin on $1,000,000 in revenue leaves $80,000 in actual take-home profit. Net margin is profit after every expense - cost of goods, overhead, interest, and tax - divided by revenue. The other $920,000 went to running the business. This is why revenue alone is misleading: a million-dollar company on an 8% net margin keeps far less than a smaller firm earning $300,000 at a 30% margin ($90,000).

Guides & articles

Related calculators

Markup Calculator · Break-Even Calculator · ROI Calculator · CAGR Calculator · Sales Tax Calculator · VAT Calculator

📋 Embed this calculator on your site

Free for any blog or website — just copy the code below and paste it into your page. The credit link helps support free tools.

Tip: adjust the iframe height if needed (try 600–800).