CCalcNest AI

Margin Calculator

Calculate profit margin percentage.

$0$10,000,000
$10$100,000
Enter values above — results appear instantly as you type.
AI Insight: Margin amplifies gains and losses equally — and a margin call can force you to sell at the worst possible moment. The leverage that looks brilliant in a bull market is exactly what wipes accounts out when it turns.
Reviewed by the CalcNest Editorial Team · Last reviewed: May 2026 · Methodology
Looking for a different calculator? Try our AI Finder — describe what you need in plain English. Try AI Finder →

Formula

Margin = (Revenue–Cost)/Revenue × 100

Example

Sell $80, cost $50 → 37.5% margin.

Embed this calculator on your site

Add this free calculator to your own website with one line of code. The embedded version is responsive, ad-free, and includes a small attribution link back to CalcNest AI.

<iframe src="https://calcnestai.com/embed/margin-calculator.html" width="100%" height="700" frameborder="0" style="border: 1px solid #e5e5e5; border-radius: 12px; max-width: 720px;" loading="lazy" title="Margin Calculator — Free Tool by CalcNest AI"></iframe>

Understanding the Margin

Profit margin is the percentage of revenue you actually keep after covering cost. It's the single clearest measure of whether a sale is worth making. The mistake that sinks small businesses is confusing margin with markup — they sound alike, use the same two numbers, and give very different answers.

How it actually works

Enter revenue and cost. Margin is profit as a percentage of revenue. Sell for $100 what cost you $60 and your profit is $40 — a 40% margin. That same deal is a 66.7% markup on cost. Margin looks at profit against the price you charged; markup looks at profit against what you paid. Both are correct; they answer different questions.

Margin vs markup on the same numbers
CostSell priceProfitMarginMarkup
$60$100$4040.0%66.7%
$60$120$6050.0%100.0%
$60$150$9060.0%150.0%
$60$80$2025.0%33.3%

The deeper context most people miss

The reason this matters is pricing. If you want a 40% margin and you calculate it as a 40% markup, you'll price the $60 item at $84 and end up with only a 28.6% margin — a shortfall that compounds across every unit you sell. Retailers that 'mark up by 50%' are quietly earning a 33% margin, not 50%. Getting the two straight is the difference between hitting your target profit and mysteriously missing it every quarter.

Gross, operating, and net — three different margins

The margin this calculator computes is gross margin: revenue minus the direct cost of goods, as a percentage of revenue. But businesses live and die by two more. Operating margin subtracts overhead — rent, salaries, marketing — revealing whether the core business is profitable before financing and taxes. Net margin subtracts everything, including interest and taxes, and is what actually flows to owners. A company can boast a 60% gross margin and still lose money if overhead devours it. When you see a 'margin' figure quoted, always ask which one: gross margins are naturally high, net margins for most industries land in the single digits. Confusing them is how businesses feel profitable while quietly running out of cash.

A third example: pricing a whole product line to a target

Apply margin thinking across a real catalog. You sell three products all costing $40 to make, and you need a 45% margin to be sustainably profitable after overhead. The instinct is to add 45% to cost — pricing at $58 — but that yields only a 31% margin, leaving you $5.60 short on every unit. To actually hit 45%, price at cost / (1 − 0.45) = $40 / 0.55 = $72.73. Now suppose your overhead runs 25% of revenue. At the correct $72.73 price, after the $40 cost and about $18.18 of overhead, you keep roughly $14.55 per unit — a healthy 20% net. At the wrong $58 price, after cost and overhead you keep only about $3.50, a 6% net that barely survives a bad month. Across 10,000 units a year, the mispricing is the difference between $145,500 and $35,000 in profit. This is why the margin-versus-markup distinction isn't pedantic — using markup math to hit a margin target undershoots every single unit, and the shortfall compounds silently across your entire volume until you wonder why a 'profitable' business has no cash.

Pricing a product line correctly

A maker sells candles that cost $8 to produce and wants a 45% margin. The instinct is to add 45% — pricing at $11.60 — but that yields only a 31% margin, leaving $4 short of target on every unit. To actually hit 45%, divide cost by (1 − 0.45): $8 / 0.55 = $14.55. Across 10,000 candles a year, the mispricing is a $40,000 profit gap that never shows up as a line item — it just quietly isn't there. This is the single most common pricing error in small product businesses, and it always runs the same direction: using markup math to hit a margin target undershoots every time. Set the price from the margin formula, and the profit you planned for actually materializes.

A pricing scenario across a product line

Imagine you sell three products, all costing $40. You price them at $60, $80, and $100 — markups of 50%, 100%, and 150%, giving margins of 33%, 50%, and 60%. Now suppose your overhead works out to 25% of revenue on every sale. The $60 product's 33% gross margin leaves only 8% after overhead; the $100 product's 60% leaves 35%. Same cost, radically different profitability, and the gross-margin figure alone wouldn't have told you which products actually carry the business. This is why margin analysis has to run product by product against real overhead — averaging masks the reality that a few high-margin items often subsidize the low-margin ones, and cutting the wrong 'low performer' can accidentally remove the volume that covers your fixed costs.

Variations: gross, contribution, operating, and net margin

The single word 'margin' hides a stack of increasingly complete measures, and confusing them causes real damage. Gross margin — what this calculator computes — is revenue minus the direct cost of goods, as a percentage of revenue; it tells you whether each sale covers its own production cost with room to spare. Contribution margin subtracts all variable costs (not just production) to show what each sale contributes toward fixed costs. Operating margin goes further, subtracting overhead like rent, salaries, and marketing, revealing whether the core business is profitable before financing and taxes. Net margin subtracts absolutely everything — interest, taxes, one-offs — and is what actually reaches the owners. A business can boast a 60% gross margin and still lose money if overhead devours it, which is why gross margin alone is a dangerous number to celebrate. When you see a margin quoted anywhere, always ask which one: gross margins are naturally high and easy to hit, while net margins for most industries land in the low single digits, and the gap between them is where businesses quietly succeed or fail.

Using margin to run a healthier business

Margin analysis becomes powerful when you apply it product by product rather than as a single blended figure. Compute the gross margin on each item you sell, then rank them — you'll almost always find that a minority of products carry a disproportionate share of the profit, while some 'popular' items barely break even after their true costs. This ranking guides real decisions: which products to promote, which to reprice, and which to drop. But resist cutting a low-margin item reflexively, because it may be driving the volume that covers your fixed overhead or drawing customers who then buy high-margin add-ons. Layer in your operating costs to move from gross margin to a truer picture: a 40% gross margin can evaporate to nothing once rent, staff, and marketing are counted, so know both numbers. When setting prices, always work from the margin formula (price = cost / (1 − target margin)), never by adding the target as a markup, which undershoots every time. Done consistently, margin analysis shifts a business from guessing at profitability to knowing exactly which sales build the business and which quietly drain it.

What people get wrong

  • Using markup and margin interchangeably — the same profit is a bigger markup percentage than margin percentage, always.
  • Pricing to a target margin using the markup formula, which undershoots the margin every time.
  • Reporting gross margin as if it were net — gross ignores overhead, salaries, and everything below the cost of goods.

Where the math comes from

Margin = (revenue − cost) / revenue × 100. Markup = (revenue − cost) / cost × 100. The two share the same numerator (profit) but different denominators — revenue for margin, cost for markup — which is why margin is always the smaller percentage of the two.

Questions and answers

What is a realistic long-term return rate?

US large-cap equities have returned ~10% nominal and ~7% real since 1928. For projections, 6-7% nominal is conservative; 8-9% is the historical average for US-tilted portfolios.

How does inflation affect long-term projections?

Use real returns (return minus inflation) for inflation-adjusted projections. A nominal $1M in 30 years has the purchasing power of about $412K today at 3% inflation.

Should I include dividends?

Yes - total return (price appreciation + dividends reinvested) is the right number. Using only price appreciation undercounts equity returns by ~1.5-2 percentage points annually.

How do fees affect the projection?

A 1% expense ratio compounds to roughly 25% less ending balance over 40 years. Low-cost index funds typically charge 0.03-0.20%; actively managed funds 0.5-1.5%.

What happens during bear markets?

Markets recover - historically every drawdown has eventually been followed by a higher peak. The math of compounding actually rewards consistent buying through downturns.

What's a good profit margin?

There is no universal answer, because healthy margins vary enormously by industry and by which margin you mean. Grocery stores famously operate on net margins of just 2-3%, making their money through enormous volume, while software companies can post net margins above 30% because their cost of serving each additional customer is tiny. Restaurants typically run thin net margins around 5-10%; professional services and luxury goods can run much higher. Comparing your margin to a universal benchmark is meaningless — the right comparison is to direct competitors in your specific sector and to your own trend over time. A 'good' margin is fundamentally one that covers all your costs, including overhead and taxes, and leaves sustainable profit to reinvest and reward owners. Also be clear about which margin you're judging: a 50% gross margin might be excellent or barely adequate depending on how heavy your overhead is. Track gross, operating, and net together, benchmark against peers, and watch the trend, rather than chasing a single number someone quoted as ideal.

How do I price an item to hit a target margin?

Divide your cost by (1 minus the target margin expressed as a decimal). For a 40% margin on an item that costs $60: $60 / (1 − 0.40) = $60 / 0.60 = $100. Pricing this way hits the intended margin exactly. The critical mistake to avoid is applying the target as a markup instead — adding 40% to the $60 cost gives $84, which is only a 28.6% margin, falling well short of your 40% goal. This error always runs the same direction, undershooting the target, and because it applies to every unit, the shortfall compounds across your whole sales volume into a significant profit gap that never appears as an obvious line item. Set the price from the margin formula, apply it consistently, and re-price whenever your costs change, since a supplier increase silently compresses your margin unless you adjust. Getting this one calculation right is the difference between a business that hits its planned profitability and one that mysteriously misses it quarter after quarter despite strong sales.

Sources & References

Authoritative references consulted in building this calculator and educational content. These are primary sources — check directly for the most current figures.

Related calculators

Cash Flow · Side Hustle ROI · Stock Return · Pricing Strategy · Dropshipping Margin