Margin Calculator

Enter cost and selling price to see gross margin %, profit, and markup % — or enter cost and a target margin % to get the selling price you need. Margin is on selling price; markup is on cost.

  • Margin + profit
  • Price from target margin
  • Stays on your device
Calculation mode

Solve gross margin %, profit, and markup %.

Numbers stay on this device. Nothing is uploaded, and there is no account.

A margin calculator answers two pricing questions. First: at this cost and this price, what share of each sale is profit? Second: if I want a set margin, what do I need to charge? Pick a mode, enter cost, then enter either the selling price or the target margin %.

The formula is gross margin % = ((selling price − cost) / selling price) × 100. To solve price from a target margin, use selling price = cost / (1 − margin % / 100). Profit is the dollar difference between price and cost. Markup uses the same profit over cost instead of price, so a 20% margin is a 25% markup — not the same number.

Results are educational estimates, not tax or accounting advice. Everything runs in your browser. Numbers never leave the device, and there is no account.

If you price by adding a percent on top of cost, use the markup calculator. To see how many sales cover fixed costs, open the break even sales calculator. For discounts, try the percent off calculator. Browse more calculators on the Finance hub.

How to use the margin calculator

  1. Choose a mode: cost + selling price, or cost + target margin %.
  2. Enter your cost for the item or job.
  3. Enter the selling price, or the margin % you want (under 100%).
  4. Read gross margin %, selling price, profit dollars, and markup %.
  5. Remember margin is on price and markup is on cost — they will not match.

Frequently asked questions

How does a margin calculator work?

A margin calculator compares cost with selling price. Enter cost and selling price to get gross margin %, profit dollars, and markup %. Or enter cost and a target margin % to get the selling price that hits that margin, plus the profit and matching markup.

What is the gross margin formula?

Gross margin % = ((selling price − cost) / selling price) × 100. Profit = selling price − cost. Example: an $80 cost sold for $100 leaves $20 profit, and $20 / $100 is a 20% margin.

How do I find the selling price from a target margin?

Selling price = cost / (1 − margin % / 100). For a 30% margin on an $80 cost, divide $80 by 0.70 to get about $114.29. Do not multiply cost by 1.30 — that adds a 30% markup, which is only about a 23% margin.

What is the difference between margin and markup?

Margin is profit as a percent of selling price. Markup is profit as a percent of cost. The same $20 profit on an $80 cost and $100 price is a 20% margin and a 25% markup. A 50% margin is a 100% markup. Margin can never reach 100%, but markup can go above 100%.

How do I convert margin to markup?

Markup % = margin / (1 − margin / 100). A 20% margin is a 25% markup, a 25% margin is a 33.33% markup, and a 50% margin is a 100% markup. Going the other way, margin % = markup / (1 + markup / 100).

Why can't margin be 100% or more?

Margin divides profit by selling price, and profit is always price minus cost. Margin only reaches 100% when cost is 0. Any positive cost keeps margin below 100%, so the target margin mode needs a number under 100%.

Can margin be negative?

Yes. If the selling price is below cost, profit is negative and so is the margin. An $80 cost sold for $50 is a $30 loss and a −60% margin. The calculator shows that so you can see how far under cost a price is.

Does this margin calculator upload my numbers?

No. Cost, selling price, and target margin are calculated in your browser. Nothing is sent to a server or stored on our side. Results are an educational estimate, not tax or accounting advice.