Margin & Markup Calculator
Calculate profit margin, markup percentage, and profit from cost and revenue.
100% in your browser — nothing uploadedCalculate profit margin and markup from cost and selling price
Decimals: use a period or a comma — 99.5 or 99,5.
Margin vs. markup — what the difference is and why it matters
Margin and markup both measure the gap between what you pay and what you charge, but they divide the same profit by different bases — and confusing the two is one of the most expensive arithmetic mistakes a business can make. Margin divides profit by revenue (the selling price): a $60 cost and a $100 price is a 40% margin. Markup divides profit by cost: the same numbers give a 66.7% markup. This calculator shows both, side by side, so you always know which number you are looking at.
The distinction matters at every scale. A retailer who sets prices at "50% above cost" has a 50% markup but only a 33.3% margin — and if the business plan assumed a 50% margin, every sale falls short. Restaurants often target a 30% food cost, which is a 70% margin or a 233% markup on the ingredient bill. In SaaS and e-commerce, investors and lenders ask for margin, not markup, and they mean gross margin: revenue minus cost of goods sold, divided by revenue.
The formulas are symmetric and convertible. Given margin, markup is margin / (1 − margin). Given markup, margin is markup / (1 + markup). A 20% margin is always a 25% markup; a 100% markup is always a 50% margin. There is no upper limit on markup (selling at 10× cost is a 900% markup), but margin can never reach 100% — it would require zero cost, which means there is nothing to sell.
Everything runs in your browser. No prices, costs, or margins are sent anywhere — which matters when you are pricing a proposal, checking a supplier quote, or verifying that a store is charging what it should. The guide below includes the same formulas for Excel and SQL, so you can apply the same logic to a spreadsheet column or a database query.
Margin and markup formulas, side by side
Profit = Revenue − Cost
Margin % = (Profit / Revenue) × 100
Markup % = (Profit / Cost) × 100
Convert margin → markup: Markup = Margin / (1 − Margin)
Convert markup → margin: Margin = Markup / (1 + Markup)| Margin | Markup | Cost multiplier |
|---|---|---|
| 10% | 11.1% | ×1.111 |
| 20% | 25% | ×1.25 |
| 25% | 33.3% | ×1.333 |
| 30% | 42.9% | ×1.429 |
| 33.3% | 50% | ×1.5 |
| 40% | 66.7% | ×1.667 |
| 50% | 100% | ×2 |
| 60% | 150% | ×2.5 |
| 75% | 300% | ×4 |
The cost multiplier is 1 / (1 − margin) — the number you multiply cost by to get the selling price. A 50% margin means you sell at 2× cost; a 75% margin means 4× cost. The multiplier rises steeply as margin approaches 100%, which is why margins above 80% are almost exclusive to software and digital goods.
Calculating margin and markup in Excel or Google Sheets
A = cost, B = revenue
Profit: =B2-A2
Margin %: =(B2-A2)/B2*100
Markup %: =(B2-A2)/A2*100
Revenue from cost + target margin:
=A2/(1-0.40) (40% margin → sell at cost ÷ 0.60)
Cost from revenue + known margin:
=B2*(1-0.40) (40% margin → cost is 60% of revenue)Margin and markup in SQL
-- Margin and markup for every product
SELECT
product,
cost,
revenue,
revenue - cost AS profit,
ROUND((revenue - cost) / NULLIF(revenue, 0) * 100, 2) AS margin_pct,
ROUND((revenue - cost) / NULLIF(cost, 0) * 100, 2) AS markup_pct
FROM products;NULLIF(x, 0) returns NULL when x is zero, turning the division into NULL instead of an error. This is the standard SQL pattern for safe division — it works on MySQL, PostgreSQL, SQL Server, and SQLite.
Reference tables
FAQ
What is the difference between margin and markup?
Both measure the same profit, but divide it by a different base. Margin = profit / revenue (selling price). Markup = profit / cost. A $40 profit on a $100 sale is a 40% margin and a 66.7% markup ($40 / $60 cost). Margin is always smaller than markup for the same transaction.
How do I convert margin to markup?
Markup = margin / (1 − margin). A 25% margin is 0.25 / (1 − 0.25) = 33.3% markup. In the other direction: margin = markup / (1 + markup). A 50% markup is 0.50 / 1.50 = 33.3% margin.
Is my data sent anywhere?
No. The calculation runs entirely in your browser with JavaScript. No costs, prices, or margins are ever transmitted — safe for real business numbers.