Margin Calculator

Enter your cost and selling price. Get gross margin %, markup %, and profit per sale instantly. The clearest margin calculator on the web — with a side-by-side margin vs markup table so you never confuse them again.

Quick answerGross margin = (selling price − cost) ÷ selling price. Example: a $30 item that costs you $20 has a $10 profit and a 33.3% gross margin (which is a 50% markup on cost).

Your numbers

Edit any field — results update as you type.

$
$
Gross margin
33.3%
$10.00 profit on every sale.
Profit per sale
$10.00
Markup
50.0%
Quick check: margin and markup look similar but mean different things. A 50% markup is only a 33% margin. If your margin is unexpectedly low, check whether you've been thinking in markup instead.
Share or embed this calculator
Free for any site — includes a small credit link back to us.

How to calculate margin

Subtract cost from selling price to get profit. Divide profit by selling price. Multiply by 100 for a percentage. ($30 − $20) ÷ $30 × 100 = 33.3% gross margin.

Margin vs markup, side by side

MarkupMargin$20 cost → price
20%16.7%$24.00
25%20%$25.00
50%33.3%$30.00
75%42.9%$35.00
100%50%$40.00
150%60%$50.00
200%66.7%$60.00

Frequently asked

Related calculators

Methodology
Formula

margin = (price − cost) ÷ price

Assumptions
  • Cost is fully loaded (materials, labor, overhead, packaging).
  • Price excludes sales tax and platform fees.
  • Margin is gross — operating expenses are not subtracted.

Last reviewed: 2026-08-24

Last updated: 2026-08-24