Profit Margin Calculator

Calculate gross profit, profit margin %, and markup % from your cost and selling price — or solve for the price you need to hit a target margin.

Everything runs in your browser — nothing you type is sent anywhere.

Required Selling Price

Gross Profit

Profit Margin

Markup

A profit margin of 100% or more is mathematically impossible — margin can approach 100% but never reach it, because profit can never exceed the full selling price. Try a target below 100%.

What is profit margin?

Profit margin tells you what share of each sale you actually keep after covering the cost of the item. It is expressed as a percentage of the selling price. If you sell a product for $100 that cost you $40, your gross profit is $60 and your profit margin is 60% — sixty cents of every dollar of revenue is profit before other business expenses.

Margin is often confused with markup, but they answer different questions. Margin is profit as a percentage of the price; markup is profit as a percentage of the cost. The same $60 profit on a $40 cost is a 60% margin but a 150% markup. Mixing the two up is one of the most common — and most expensive — pricing mistakes small businesses make.

The formulas

This calculator uses three simple, exact arithmetic relationships:

  • Gross Profit = Selling Price − Cost
  • Profit Margin % = (Selling Price − Cost) ÷ Selling Price × 100
  • Markup % = (Selling Price − Cost) ÷ Cost × 100

To work backwards from a target margin to the price you need to charge, rearrange the margin formula: Selling Price = Cost ÷ (1 − Margin ÷ 100). Notice that as the target margin approaches 100%, the denominator approaches zero and the required price shoots toward infinity — which is why a margin of 100% or more is impossible: your profit can never exceed the entire selling price.

How to use this calculator

Choose a mode at the top. In “I know my cost & price”, enter what a unit costs you and what you sell it for, and the calculator instantly returns your gross profit per unit, your profit margin, and your markup. In “Find the price for a target margin”, enter your cost and the margin you want to hit, and it solves for the exact selling price that achieves it, along with the resulting profit and markup.

All values update as you type, and the tool guards against divide-by-zero cases — a $0 price or $0 cost simply shows a dash rather than a misleading number.

Worked example

Suppose a unit costs you $40 and you plan to sell it for $100. Your gross profit is $100 − $40 = $60. Your profit margin is $60 ÷ $100 = 60%, and your markup is $60 ÷ $40 = 150%.

Now flip the question: that same $40 item, and you want a 60% margin. Using Price = 40 ÷ (1 − 0.60) = 40 ÷ 0.40 = $100 — the same price, confirming the two calculations are consistent. If you instead wanted a 75% margin, you'd need to charge 40 ÷ 0.25 = $160.

Gross margin covers only the direct cost of the goods. It does not account for shipping, payment-processing fees, marketing, overhead, or taxes — subtract those separately to find your true net profit.

References

✏️ Edit this page on GitHub