Profit Margin Calculator

Calculate gross margin and markup from cost and revenue — or find the right selling price from a target margin or markup. Results update as you type, and both figures are always shown together so you can see how they relate.

Results Live
Revenue
Cost (COGS)
Gross profit
Gross margin Profit ÷ Revenue
Markup Profit ÷ Cost

Margin vs markup — what is the difference?

Both margin and markup measure profit on the same transaction. The only difference is the denominator — what you divide by to get the percentage.

  • Gross margin divides profit by revenue. It answers: "what share of each dollar I collect is profit?"
  • Markup divides profit by cost. It answers: "how much did I add on top of what it cost me?"

This single difference produces two completely different numbers from the same transaction — and confusing them is one of the most common pricing mistakes in small business.

The formulas
Gross profit = Revenue − Cost Gross margin = Gross profit ÷ Revenue × 100 Markup      = Gross profit ÷ Cost × 100   Example: Cost $30, Revenue $50 Gross profit = $50 − $30 = $20 Gross margin = $20 ÷ $50 = 40% Markup      = $20 ÷ $30 = 66.7%

Why the same profit gives two different percentages

On that $30 cost / $50 revenue example, the profit is $20 either way. But 40% ≠ 66.7%. The numbers describe the same reality from different vantage points:

  • The seller collected $50 and kept $20 — that is 40% of revenue as profit
  • The seller spent $30 and earned $20 on top — that is 66.7% above cost

Neither is wrong. But using margin language when you mean markup — or quoting a client a "markup" when you're calculating a "margin" — will result in underpricing every time.

Converting between margin and markup

Conversion formulas
Margin from Markup = Markup ÷ (1 + Markup) Markup from Margin = Margin ÷ (1 − Margin)   40% markup → 40 ÷ 140 = 28.6% margin 40% margin → 40 ÷ 60  = 66.7% markup

Finding the right selling price

Use the Find selling price tab when you know your cost and want to hit a target. The formulas are different depending on whether your target is a margin or a markup:

From a target margin
Revenue = Cost ÷ (1 − Margin%) Example: Cost $30, target 40% margin → $30 ÷ 0.60 = $50.00
From a target markup
Revenue = Cost × (1 + Markup%) Example: Cost $30, target 40% markup → $30 × 1.40 = $42.00

Same cost, same 40% target — but $50 vs $42. This is why the distinction matters in practice.

Margin and markup reference table

MarkupGross marginOn $100 costRevenue
10%9.1%$100$110.00
20%16.7%$100$120.00
25%20.0%$100$125.00
33.3%25.0%$100$133.33
50%33.3%$100$150.00
66.7%40.0%$100$166.67
100%50.0%$100$200.00
200%66.7%$100$300.00

Frequently asked questions

Is a 40% margin the same as a 40% markup?

No — and this is the most common source of pricing errors. A 40% margin means profit is 40% of revenue, which requires a 66.7% markup on cost. A 40% markup means you added 40% to your cost, giving you a 28.6% margin. Same words, very different numbers.

What is a good profit margin?

It depends entirely on the industry. Grocery retail typically operates at 1–3% net margin. Software companies can exceed 70%. As a rough reference: gross margins below 20% are thin for most product businesses; 40–60% is common in e-commerce; services businesses often run 50–70%. Compare to industry benchmarks rather than a universal standard.

Can margin exceed 100%?

No. Gross margin is profit divided by revenue, and profit can never exceed revenue (that would require negative costs). Margin is bounded at 0–100%. Markup, however, has no ceiling — a 200% markup simply means you charged three times your cost.

What happens when revenue is below cost?

Both margin and markup become negative, indicating a loss. This is mathematically valid — many businesses sell below cost during promotions or when clearing inventory. The calculator handles this correctly and flags it as a loss.

Does this calculator store my data?

No. All calculations run in your browser. Nothing is sent to a server or saved anywhere.

Disclaimer: For educational and planning purposes only. Gross margin does not account for operating expenses, taxes, or other costs. Consult an accountant for business financial decisions.