Margin Calculator

Calculate profit margin, markup, and selling price.

Money Margin & markup Any 2 of 3 inputs
Rate this calculator · 4.8 (4)

Profit margin from cost and revenue

Flexible input · margin & markup · 7 currencies

Instructions — Margin Calculator

1

Fill any two fields

Enter any two of cost, revenue (selling price), or margin percent. The third value is computed automatically — along with the profit and markup percent.

2

Read the profit and markup

Profit is the dollar amount you earn per sale. Markup is profit divided by cost — almost always higher than margin, and the source of most pricing mistakes.

3

Set currency and precision

Pick the currency symbol you prefer ($, €, £, zł, etc.) and choose 0 to 4 decimal places. Numbers reformat instantly — symbol is display-only, math is unchanged.

Reverse-engineer a price: enter your cost and target margin to see the selling price you need to charge.
Margin caps at 100%: a 100% margin would mean zero cost. Values must stay below that.

Formulas

Margin uses revenue as the denominator. Markup uses cost. That single difference creates most pricing errors in small business.

Margin Percent
$$ \text{Margin \%} = \frac{\text{Revenue} - \text{Cost}}{\text{Revenue}} \times 100 $$
Profit as a share of selling price. Capped at 100% because cost cannot be negative.
Markup Percent
$$ \text{Markup \%} = \frac{\text{Revenue} - \text{Cost}}{\text{Cost}} \times 100 $$
Profit as a share of cost. Unbounded — a 100% markup means the price is double the cost.
Revenue from Cost + Margin
$$ \text{Revenue} = \frac{\text{Cost}}{1 - \frac{\text{Margin \%}}{100}} $$
The selling price needed to hit a target margin. Divide cost by (1 minus margin as a decimal).
Cost from Revenue + Margin
$$ \text{Cost} = \text{Revenue} \times \left(1 - \frac{\text{Margin \%}}{100}\right) $$
The cost ceiling that produces a given margin at a given price.
Margin ↔ Markup Conversion
$$ \text{Margin} = \frac{\text{Markup}}{1 + \text{Markup}} \;\;\;\; \text{Markup} = \frac{\text{Margin}}{1 - \text{Margin}} $$
50% markup → 33.3% margin. 50% margin → 100% markup. The asymmetry is the source of most pricing mistakes.
Profit
$$ \text{Profit} = \text{Revenue} - \text{Cost} $$
The dollar amount per sale. Margin and markup are the same profit expressed against different denominators.

Reference

Margin ↔ Markup conversion
MarginMarkupCost ratio
10%11.1%90% of price
15%17.6%85% of price
20%25.0%80% of price
25%33.3%75% of price
30%42.9%70% of price
33.3%50.0%66.7% of price
40%66.7%60% of price
50%100%50% of price
60%150%40% of price
75%300%25% of price

Average margins by industry

US-listed companies, NYU Stern dataset. Gross margin is revenue minus cost of goods. Net margin is what is left after all expenses, taxes, and interest.

Gross margin
IndustryGross %
Software / SaaS70 – 90%
Pharmaceuticals65 – 80%
Restaurants (full service)~65%
E-commerce (general)40 – 60%
Apparel / retail40 – 55%
Auto manufacturing15 – 20%
Grocery stores25 – 30%
Construction15 – 25%
Net margin
IndustryNet %
Software / SaaS15 – 25%
Banks / financial15 – 25%
Pharmaceuticals15 – 25%
Retail (general)5 – 10%
Restaurants (full service)3 – 5%
Grocery stores2 – 3%
Auto manufacturing3 – 7%
Construction3 – 6%

Note: a 5% net margin is great in grocery and disastrous in software. Always compare against your own industry, not the cross-industry average.

Article — Margin Calculator

Margin calculator: profit margin, markup, and pricing

Profit margin is profit divided by revenue, expressed as a percent. If you sell a product for $100 that cost you $70 to make, your margin is $30 ÷ $100 = 30%. That ratio is the single most useful number in pricing, and it gets confused with markup more often than any other figure in small business.

The calculator above accepts any two of cost, revenue, or target margin and computes the rest. The article below explains what the numbers mean and where they get used in practice.

What is profit margin?

Profit margin is the share of each dollar of revenue that ends up as profit. A 30% margin means $0.30 of every $1.00 in sales is profit, and $0.70 covers cost. The figure is always between zero and 100% (or negative, if you are selling at a loss).

Margin is the standard pricing metric in retail, restaurants, SaaS, and almost every consumer category. Wall Street uses it to compare companies. Operators use it to decide whether to take on a new product line. Investors use it to spot businesses with pricing power.

Did you know

NVIDIA posted a net profit margin of roughly 54% in 2024 — meaning more than half of every dollar of revenue ended up as net income after every cost was paid. That is one of the highest margins ever recorded by a large-cap company, and the result of near-monopoly pricing power in AI chips. For comparison, Walmart runs at about 2.4%.

Margin vs. markup: why they are different

Margin and markup describe the same profit but divide by different denominators. Margin uses revenue. Markup uses cost. The two numbers are never equal except at zero.

The two formulas, side by side
Margin % = Profit ÷ Revenue × 100
Markup % = Profit ÷ Cost × 100

The classic example: a product costs $60 and sells for $100. Profit is $40. Margin is $40 ÷ $100 = 40%. Markup is $40 ÷ $60 = 66.7%. Same dollar of profit, two very different percentages.

Margin
40.0%
$40 ÷ $100 revenue
Markup
66.7%
$40 ÷ $60 cost

Retailers usually price by markup (because cost is what they pay the supplier), and report margin (because that is what investors and accountants track). Confusion happens when someone says "I want 50% profit" and applies a 50% markup, expecting a 50% margin. That actually gives a 33.3% margin — about a third less than what they thought they were getting.

The pricing mistake that costs the most

If you want a 50% margin and you add 50% to cost, you have undershot by a third. For a true 50% margin you need a 100% markup — double the cost. The shop owner who applies "50% markup" while talking about "50% margin" leaves real money on the table every transaction. At 500 sales a month, the gap is easily four figures.

How to calculate profit margin

Margin needs two numbers: cost and revenue. Subtract cost from revenue to get profit. Divide profit by revenue. Multiply by 100. That is the margin percent.

Worked example. A coffee shop buys beans, milk, and a paper cup for a total cost of $1.20 per latte. The latte sells for $5.00. Profit is $3.80. Margin is $3.80 ÷ $5.00 = 76%. That is the gross margin on the drink itself, before rent, labor, and equipment depreciation.

The same calculation works at company scale. Total revenue minus total cost of goods sold, divided by total revenue, multiplied by 100. Public companies report this number on every quarterly earnings statement.

How to set a selling price from a target margin

This is the reverse calculation, and it is where most small-business pricing errors happen. To find the selling price needed to hit a target margin:

Price = Cost ÷ (1 − Margin ÷ 100)

If a wholesale cost is $14 and you want a 40% margin, divide by (1 − 0.40) = 0.60: $14 ÷ 0.60 = $23.33. Check: ($23.33 − $14) ÷ $23.33 = 40%. The trap is that adding 40% to $14 only gets you to $19.60, which produces a 28.6% margin — not 40%.

Tip

Use the calculator above for a one-step answer. Enter cost and target margin, and it returns the exact selling price plus the markup percent that gets you there. The "any two of three" interface saves you from the divide-by-(1−margin) gymnastics.

Average margins by industry

"Is 5% a good margin?" is unanswerable without context. The same 5% net margin is excellent for a grocery store, fine for a restaurant, and worrying for a SaaS company. Rough benchmarks from NYU Stern's Damodaran dataset of US-listed companies:

  • Software / SaaS: 70–90% gross, 15–25% net
  • Pharmaceuticals: 65–80% gross, 15–25% net
  • Banks and financials: 15–25% net
  • Apparel and general retail: 40–55% gross, 5–10% net
  • Restaurants (full service): 60–70% gross, 3–5% net
  • Auto manufacturing: 15–20% gross, 3–7% net
  • Grocery stores: 25–30% gross, 2–3% net
  • Construction: 15–25% gross, 3–6% net

Two patterns repeat in this table. First, gross margins are highest in industries with low marginal cost (software and pharma). Second, net margins compress toward 3–10% in industries with heavy labor, real estate, or capital costs. The difference between gross and net is overhead, and overhead is harder to compress than cost of goods.

Did you know

Walmart's net margin is roughly 2.4%. On $650 billion of annual revenue, that produces around $15 billion in net income. The model is volume, not markup. A grocery business hitting Walmart's gross margin (around 25%) and Walmart's net margin (2.4%) is a sign of operational excellence, not weakness.

Gross vs. net margin

Gross margin counts only the direct cost of goods. For a t-shirt company, that is the fabric, the printing, the shipping inbound from the supplier, and nothing else. Gross margin tells you whether the product itself is profitable.

Net margin counts everything: payroll, rent, marketing, software, depreciation, interest on debt, and taxes. Net margin tells you whether the business is profitable. Restaurants are the textbook case: 65% gross margin (food itself is profitable) collapses to 4% net margin (after labor and rent eat almost everything).

Operating margin sits between the two. It uses cost of goods plus operating expenses, but excludes interest and taxes. Operating margin is the cleanest comparison across companies because it strips out capital structure and tax jurisdiction.

How discounts and price changes affect margin

Discounts hurt margin disproportionately. A 10% price cut on a product with a 30% margin does not knock margin down to 20%. It knocks it down to about 22.2%, which is a 26% relative drop in margin. Cost stays the same; only revenue moves.

Worked example. Cost is $70, price is $100, margin is 30%. Cut the price by 10% to $90. New margin is ($90 − $70) ÷ $90 = 22.2%. To make up the lost profit at the new price, you need to sell about 35% more units. That is the math behind why volume sales rarely break even.

Price increases work the same way in reverse and are surprisingly forgiving. A 10% price hike on the same product takes margin from 30% to 36.4% — a 21% relative gain. Even if you lose some customers, the math usually wins, which is why incumbent businesses raise prices every year.

Discounts are not free

Marketing tools default to "10% off" coupons because they feel small. In margin terms, they almost never are. Before approving a discount, run the math: a 10% price cut on a 30% margin requires 50% more volume to break even on profit. On a 20% margin it requires 100% more volume.

Common margin mistakes

Four mistakes account for most pricing errors:

1. Margin vs. markup confusion. Adding 30% to cost is markup, not margin. To get a 30% margin, divide by 0.70 instead of multiplying by 1.30. The error always favors the customer, never the business.

2. Mistaking gross margin for net margin. A 60% gross margin sounds great until you back out 30% labor, 12% rent, 8% marketing, and 5% other overhead. The number that matters at year-end is net, not gross.

3. Comparing margins across industries. SaaS at 15% net is in trouble. Grocery at 15% net is doing the impossible. Industry benchmarks are the only fair comparison.

4. Ignoring volume sensitivity. Two businesses can have identical 30% margins. The one selling 10,000 units a year is robust. The one selling 100 is a single bad month from bankruptcy. Margin tells you per-unit health; volume tells you survival.

FAQ

Margin is profit divided by revenue; markup is profit divided by cost. At the same profit, markup is always higher than margin. Example: you buy for $60 and sell for $100. Margin is 40 ÷ 100 = 40%. Markup is 40 ÷ 60 = 66.7%.
Depends entirely on industry. 5% net margin is normal in grocery and great in restaurants, but a disaster in software. Software and SaaS companies typically run 15–25% net margins. Restaurants and full-service retail typically run 3–10%. Always benchmark against your own industry, not across them.
Divide cost by (1 minus margin expressed as a decimal). Formula: Price = Cost ÷ (1 − Margin/100). For a 30% target margin on a $70 cost: $70 ÷ 0.70 = $100. Check: ($100 − $70) ÷ $100 = 30%.
Because adding 30% to cost is a 30% markup, not a 30% margin. Adding 30% to $100 gives $130. The margin on $130 is $30 ÷ $130 = 23.1%, not 30%. To get a true 30% margin from $100 cost, you must sell at $142.86 (= $100 ÷ 0.70).
Gross margin uses only the direct cost of goods sold. Net margin uses every expense — payroll, rent, marketing, interest, taxes. Restaurants often run 65% gross margin and 4% net margin. The gap between the two is your real overhead.
Yes — a negative margin means you are selling below cost. Sometimes this is intentional (loss leaders to bring customers in for higher-margin items), sometimes it is a sign of trouble. The calculator above flags negative profit explicitly.
Worse than most people think. A 10% discount off a $100 price (so $90 sold) on a $70 cost item drops margin from 30% to 22.2% — a 26% relative reduction. Price increases work the other direction, with the same disproportionate effect. Discounting is dangerous; price increases are surprisingly forgiving.
Full-service restaurants average 3–5% net margin; fast-food and counter-service formats average 6–10%. Restaurants combine high gross margin (60–70%) with brutally high overhead — labor at 30–35% of revenue, rent at 10–15%, food waste, and utilities.