Blucalculator Open Tool

Margin Calculator

Calculate your gross margin, profit, and markup based on cost and revenue.

$

The amount it costs you to produce or buy the item.

$

The amount you sell the item for.

Embed This Calculator

Copy the code and paste it into any webpage to embed this calculator.

WordPress users: add a Custom HTML block (not the Embed block) and paste the code there.

More embed options

Free to use. A small "Powered by Blucalculator" credit is appreciated but not required.

How to use this calculator

The margin calculator takes 2 numbers and returns 3. Here’s exactly what each one is.

Revenue / Sale Price ($) — What the customer pays. Not your list price, not your MSRP. The actual amount that hits your bank account per unit sold, before any deductions.

Cost ($) — What it costs you to produce or acquire one unit. For a physical product, that’s materials plus direct labor plus any manufacturing overhead directly tied to production. For a service, it’s the direct cost of delivering that service — contractor hours, software licenses tied to delivery. Not your office rent. Not your marketing budget. Direct cost only.

The calculator returns three outputs:

Gross Profit ($) — Revenue minus cost. The raw dollar amount left over after covering the direct cost of the item. This is what you have to pay for everything else: salaries, rent, marketing, taxes, and profit.

Gross Margin (%) — Gross profit expressed as a percentage of revenue. This is the primary output. It tells you what fraction of every dollar of revenue is gross profit. A 40% margin means 40 cents of every dollar stays after covering direct costs.

Markup (%) — How much you’ve added on top of cost, expressed as a percentage of cost. A 67% markup on a $150 cost gives you a $250 selling price. Same transaction as the 40% margin example — different way of expressing it.

Quick example — $150 cost, $250 sale price

Cost: $150.00 / Revenue: $250.00

Gross Profit = $250 − $150 = $100.00

Gross Margin = $100 ÷ $250 = 40.00%

Markup = $100 ÷ $150 = 66.67%

Same numbers. Three different lenses on the same transaction.

If you’re working backwards from a target margin to find the right selling price, rearrange the formula: Revenue = Cost ÷ (1 − Margin%). For a 40% target margin on a $150 cost: $150 ÷ (1 − 0.40) = $250. Most pricing decisions start here, not from an arbitrary price point.


What problem this actually solves

Margin is where most pricing conversations break down, and the reason is almost always the same: someone is confusing margin with markup.

A retailer buying goods at $60 and selling at $100 has a $40 gross profit. Their markup is 67%. Their margin is 40%. If someone in that business says “we price at 40% above cost,” the actual margin is only 28.6% — not 40%. If they say “we target a 40% margin,” the markup needs to be 66.7%, not 40%. These aren’t rounding errors. They’re completely different calculations that produce meaningfully different prices and profitability outcomes.

The calculator eliminates that confusion. Enter the two numbers you know and it computes all three outputs simultaneously so you can see the relationship directly.


The concept in plain English

Margin and markup both describe the relationship between cost and price, but they use different denominators.

Margin divides profit by revenue. It tells you how much of each sale you keep. Markup divides profit by cost. It tells you how much you’ve added onto what you paid.

Margin answers: "What percentage of my revenue is profit?" Markup answers: "What percentage above my cost did I charge?" Same profit. Same price. Completely different percentages.

This is why a 50% markup doesn’t give you a 50% margin. A $100 cost with a 50% markup gives a $150 price. The profit is $50. The margin is $50 ÷ $150 = 33.3%. If someone budgets expecting a 50% margin and only gets 33.3%, that’s a significant shortfall — especially at scale.


The formulas

Three calculations from two inputs.

Gross Profit ($) = Revenue − Cost
Gross Margin (%) = (Revenue − Cost) ÷ Revenue × 100
Markup (%) = (Revenue − Cost) ÷ Cost × 100

And the two most useful rearrangements for pricing decisions:

Revenue from target margin = Cost ÷ (1 − Margin%)
Revenue from target markup = Cost × (1 + Markup%)

The only difference between the margin and markup formulas is the denominator. Margin uses revenue. Markup uses cost. That single change is what produces two completely different percentages from the same transaction.

Never apply a markup percentage to find a margin, or vice versa. A 50% markup is not a 50% margin. A 30% margin requires a 42.9% markup. Treating them as interchangeable overstates profitability in your forecasts and underprices your products in practice.


Margin vs markup — the full conversion table

Target Gross MarginRequired Markup
10%11.1%
20%25.0%
25%33.3%
30%42.9%
40%66.7%
50%100.0%
60%150.0%
70%233.3%
75%300.0%

A 50% margin requires a 100% markup — doubling the cost. A 75% margin requires a 300% markup. These numbers surprise people who’ve been using markup and margin interchangeably. They’re not even close at higher percentages.


Real-world examples

Physical product — retail

A clothing retailer buys a jacket from a supplier at $85 and sells it for $160.

Cost: $85.00 / Revenue: $160.00

Gross Profit = $160 − $85 = $75.00

Gross Margin = $75 ÷ $160 = 46.9%

Markup = $75 ÷ $85 = 88.2%

A nearly 90% markup sounds generous until you factor in that the retailer still needs to cover rent, staff, shrinkage, returns, and marketing from that 46.9% margin. For a typical fashion retailer, 45–55% gross margin is the minimum viable range to support those operating costs.

Service business — freelance

A freelance designer quotes a project at $3,500. The direct cost (their time at an internal rate, plus software and stock assets used) is $1,200.

Cost: $1,200 / Revenue: $3,500

Gross Profit = $3,500 − $1,200 = $2,300

Gross Margin = $2,300 ÷ $3,500 = 65.7%

Markup = $2,300 ÷ $1,200 = 191.7%

A 65.7% gross margin sounds healthy — and it needs to be. That $2,300 covers self-employment taxes (roughly 15%), business expenses not tied to the project (software subscriptions, equipment, insurance), unpaid hours spent on admin and sales, and actual profit. After those deductions, the net margin on a service business is often 20–35% of revenue.

SaaS product — subscription

A software company sells a subscription at $99/month. The direct cost to serve one customer (cloud hosting, support time, payment processing) is $18/month.

Cost: $18.00 / Revenue: $99.00

Gross Profit = $99 − $18 = $81.00

Gross Margin = $81 ÷ $99 = 81.8%

Markup = $81 ÷ $18 = 450.0%

SaaS businesses typically target 70–85% gross margins because the remaining margin must fund sales, marketing, and R&D — all of which are high costs in software. An 81.8% gross margin sits in a healthy range, but only if customer acquisition costs don’t eat the entire margin contribution per customer.

Wholesale to retail

A food manufacturer sells a product to a grocery distributor at $4.20 per unit. The production cost is $1.75 per unit.

Cost: $1.75 / Revenue: $4.20

Gross Profit = $4.20 − $1.75 = $2.45

Gross Margin = $2.45 ÷ $4.20 = 58.3%

Markup = $2.45 ÷ $1.75 = 140.0%

At 58.3% gross margin, this looks strong. But food manufacturing has high fixed costs — equipment, compliance, cold chain logistics — that come out of that margin before any net profit appears. Gross margin in food manufacturing often needs to be 50%+ just to reach modest net margins of 5–10%.


Common mistakes in margin calculations

Including operating expenses in the cost field. Gross margin only uses direct costs — the costs that exist because you made or sold this specific unit. Rent, salaries of non-production staff, software subscriptions, and marketing all come out of gross margin later. If you include them in the cost field, you’re calculating net margin, not gross margin — and comparing your result to industry gross margin benchmarks becomes meaningless.

Using revenue before discounts. If a customer pays $200 for a product listed at $250 after a 20% discount, your revenue is $200, not $250. Calculating margin on the list price overstates your actual profitability. Use the net revenue that actually hits your accounts.

Applying the same markup percentage across different products. A 40% markup on a $10 item adds $4. A 40% markup on a $500 item adds $200. The dollar profit is vastly different. More importantly, price sensitivity varies by product — a commodity item might not support a 40% markup at all, while a specialty product might support 200%. Blanket markup rules ignore this entirely.

Confusing gross margin with net margin. Gross margin is profit after direct costs only. Net margin is profit after everything — direct costs, operating expenses, interest, and taxes. A business with a 60% gross margin and 40% operating expense ratio has a 20% net margin. Reporting gross margin as your “profit margin” without clarifying which one can mislead investors, partners, and your own planning.

Forgetting returns and refunds. In e-commerce, return rates of 15–30% are common. If 20% of your units come back, your effective revenue per unit is 80% of the sale price — but you’ve already paid the cost. Calculating margin without factoring in your return rate overstates profitability significantly.

The most expensive margin mistake in retail is pricing by markup when your entire financial model is built on margin targets. A buyer who needs 50% gross margin and prices at 50% markup will consistently underperform that target by 16–17 percentage points. At scale, this gap is the difference between a profitable business and one that perpetually runs short on operating cash.


Hidden factors most people ignore

Volume changes your effective cost. Unit cost at 100 units is not the same as unit cost at 10,000 units. Manufacturing, printing, and wholesale all have tiered pricing structures. Your margin at current volume may look fine, but if your growth plan requires higher volume to hit margin targets (because costs need to fall), you’re pricing today based on tomorrow’s cost structure — which may never arrive.

Payment terms affect real margin. A 2% early payment discount offered to customers costs 2 percentage points of margin per invoice. A 60-day payment term effectively ties up cash and has an implicit cost of capital. Neither shows up in a simple margin calculation, but both affect the actual return per transaction.

Currency and FX exposure. For businesses buying in one currency and selling in another, a 10% FX movement can wipe out the entire margin on a transaction that looked profitable at the time of quoting. Margin calculations that don’t account for FX hedging costs or risk are incomplete for international businesses.

Shrinkage, waste, and yield. In food, manufacturing, and retail, not every unit you buy becomes a unit you sell. A bakery that loses 8% of flour to waste has a higher effective cost per finished unit than the purchase price suggests. A retailer with 3% shrinkage (theft, damage, admin errors) is losing margin that never appeared in any margin calculation.

Gross margin is the ceiling. Every operational inefficiency, return, discount, FX movement, and wastage event eats into it on the way down to net profit. Calculate the gross margin accurately, then build in realistic assumptions about what actually happens between the top line and the bottom line.

What to do with the result

For pricing decisions — if your calculated margin is below your target, you have two levers: raise the price or reduce the cost. The margin formula tells you exactly how much each lever needs to move. To hit a 50% margin on a $120 cost: Revenue = $120 ÷ (1 − 0.50) = $240. If $240 isn’t market-viable, the cost needs to come down.

For benchmarking — compare your gross margin to industry averages. Grocery retail typically runs 25–30%. Software companies run 70–85%. Manufacturing runs 30–50%. If your margin is significantly below your industry average, either your costs are too high or your pricing is too low — and you now have a specific percentage gap to close.

For investor conversations — gross margin is one of the first metrics sophisticated investors check. A high gross margin signals scalability: the business can grow revenue without proportionally growing direct costs. A low gross margin signals that growth requires proportional cost increases, which limits profitability at scale.

For product mix decisions — run the calculation for each product line separately. A business with three products and an “average” 40% margin might have one product at 65%, one at 40%, and one at 15%. The low-margin product might be consuming resources that would be more profitable applied to the high-margin one.

Your margin calculation is most useful when the cost figure includes every direct cost — materials, direct labor, transaction fees, packaging, and delivery if it’s included in the sale price. A margin number that understates cost looks healthy until the cash runs out. Build the cost figure carefully, then trust the output.


The bottom line

Margin and markup are not synonyms. Gross profit is not net profit. Revenue before discounts is not the same as revenue after discounts. These distinctions matter every time a pricing decision is made, a product line is evaluated, or a financial result is reported.

The calculator gives you all three outputs — gross profit, gross margin, and markup — from two inputs. Use it to price correctly, benchmark accurately, and have precise conversations about what your numbers actually mean.

Know which metric your audience is using before you quote a percentage. Margin to a finance team means one thing. Markup to a buyer means another. The underlying transaction is the same. The number is not.

Frequently Asked Questions

What's a good gross margin?

It depends heavily on the industry. Software companies often see 70–90%. Retail averages 25–50%. Restaurants typically run 5–15%. The key is benchmarking against businesses similar to yours.

Is margin the same as profit?

No. Profit is a dollar amount (e.g., $100). Margin is a percentage that expresses profit relative to revenue (e.g., 40%). Margin lets you compare profitability across products, time periods, or businesses of different sizes.

How do I increase my gross margin?

Two levers: raise prices (without losing too many customers), or lower your cost of goods sold (negotiate with suppliers, reduce waste, increase efficiency). Most businesses work both levers in tandem.

Why is my markup higher than my margin?

Markup is always higher than margin because it uses the smaller number (cost) as its base, not revenue. A $50 profit on a $50 cost is 100% markup but 50% margin (since revenue would be $100).

What is the difference between gross margin and operating margin?

Gross margin = (Revenue − Cost of Goods Sold) / Revenue. It covers only direct production costs. Operating margin also subtracts operating expenses (salaries, rent, marketing, R&D): Operating Margin = Operating Income / Revenue. Net margin deducts interest and taxes on top of that. Gross margin is the starting point; operating and net margins show how efficiently overhead is managed.

How do I calculate the selling price from cost and a target margin?

Selling Price = Cost / (1 − Margin). Example: cost = $40, target gross margin = 60% → Price = $40 / (1 − 0.60) = $40 / 0.40 = $100. This is why margin math is different from markup: a 60% margin is NOT the same as adding 60% to the cost (that would be 37.5% margin).

What is a healthy gross margin for a retail business?

Retail margins vary widely: luxury goods 60–70%, clothing/apparel 40–60%, electronics 15–25%, grocery 20–30%, automotive parts 30–45%. As a general rule, a gross margin below 20% in retail leaves very little room to cover operating costs and still be profitable. Compare against industry benchmarks, not universal standards.

What is contribution margin and why does it matter?

Contribution margin = Revenue − Variable Costs. It shows how much each unit sold contributes toward covering fixed costs and profit. Unlike gross margin (which may include some fixed overhead in COGS), contribution margin strips out only truly variable costs. It is the foundation of break-even analysis: Break-even units = Fixed Costs / Contribution Margin per unit.

How does margin affect pricing strategy?

Target margin drives minimum price. If your cost is $50 and you need 40% margin, you cannot price below $83.33. Pricing above that generates profit; below it means losing money on each sale regardless of volume. Many businesses use tiered margins — high margins on premium products subsidise lower margins on entry-level products that drive customer acquisition.

What is EBITDA margin and when is it used?

EBITDA Margin = EBITDA / Revenue, where EBITDA = Earnings Before Interest, Taxes, Depreciation, and Amortisation. It measures core operating profitability before non-cash charges and capital structure effects. Investors use it to compare companies across different tax regimes and capital structures. A 20%+ EBITDA margin is generally considered healthy for most industries.

Related Calculators