Margin Calculator
Enter any two values to calculate
Calculate to see step-by-step breakdown.
Margin is the percentage of revenue that is profit. Formula: (Revenue − Cost) / Revenue × 100.
Markup is the percentage of cost added to get the selling price. Formula: (Revenue − Cost) / Cost × 100.
They are related but not equal. A 50% markup results in a 33.3% margin. A 50% margin requires a 100% markup.
| Margin | Markup |
|---|---|
| 10% | 11.1% |
| 20% | 25.0% |
| 30% | 42.9% |
| 40% | 66.7% |
| 50% | 100.0% |
| 60% | 150.0% |
Margin Calculator – Pair Any Values
That’s the whole idea behind this margin calculator. You type any two values — cost and revenue, cost and margin, revenue and markup, whatever combination makes sense for what you already know — and the remaining fields fill themselves in. No dropdowns to select a “calculation mode.” No guessing which formula applies. The tool figures out what you’re solving for based on which two fields you touched last.
Most margin calculators ask you to pick a direction first: “I know cost and revenue, compute margin.” This one skips that step. Enter 76 in the cost field, type 10,000 in revenue, and you’ll immediately see the profit, margin percentage, and markup percentage update in real time. Switch to editing the margin field instead, and the tool recalculates around your new pair of inputs. It tracks the last two fields you changed and runs the right formula automatically.

What Does the Gauge Actually Tell You?
The semicircle at the top of the results panel isn’t decoration. It maps your margin percentage onto a gradient that runs from red on the left through yellow and green on the right. A needle points to where your current margin sits on that 0–100% scale. Below it, a label classifies the result: margins under 15% show as “Low,” 15–30% reads “Moderate,” 30–50% is “Good,” and anything above 50% gets a “High” tag in green.
Negative margins — where your cost exceeds your revenue — pin the needle at zero and flag the result in red. You’ll see the actual negative percentage displayed as text (something like −132.56%), so there’s no confusion about what happened. The gauge simply can’t rotate past its left boundary, which is the honest way to handle it: your margin is below zero, and the visual makes that obvious at a glance.
The bar chart underneath breaks revenue into its two components. One bar for cost, one for profit, scaled proportionally so you can see the split. When profit goes negative, that bar turns red. It’s a quick visual sanity check — if the profit bar is a sliver compared to cost, your pricing might need work.
Why Does Margin vs. Markup Confuse Everyone?
Because they use the same three numbers (cost, revenue, profit) but divide by different bases. Margin divides profit by revenue. Markup divides profit by cost. A product that costs $75 and sells for $100 has a 25% margin but a 33.33% markup. Same product, same profit, different percentages — and mixing them up in a pricing spreadsheet can quietly wreck your numbers.
This margin calculator shows both values side by side every time you run a calculation. There’s also a collapsible “Margin vs Markup Explained” section with a reference table mapping common markup percentages to their margin equivalents. If you’ve ever had a supplier quote you a 50% markup and you need to know what margin that translates to (it’s 33.33%), the table answers it without any math on your part.
The step-by-step panel — another collapsible section — spells out exactly which formula was used and walks through each arithmetic operation. Given Cost = 75.00 and Revenue = 100.00, Profit = Revenue − Cost = 25.00, Margin = (25 / 100) × 100 = 25.00%. It’s useful when you need to document how a number was derived or just want to double-check the logic yourself.
What Happens When You Apply a Discount?
The discount section sits in its own collapsible panel below the main results. Type a percentage — say 15% — and it recalculates your revenue, profit, and margin as if you’d dropped the selling price by that amount. The original calculation stays untouched above; the discount section just shows what the numbers would become.
This is handy for quick what-if scenarios. A customer asks for 10% off — you can see instantly whether that drops your margin from “Good” to “Low” or barely dents it. The discount panel gets its own health badge too, so the impact is visible without comparing raw numbers.
How Flexible Are the Settings?
There are eight currency symbols available — dollar, euro, pound, yen, rupee, ruble, franc, and krona — selectable from a dropdown on the left side. This changes the symbol displayed in all results, bar chart labels, and copied text. The quick-pick chips (20%, 30%, 40%, 50%) set the margin field with one tap, useful when you’re exploring pricing tiers and want to see what cost or revenue has to be to hit a target margin.
Decimal precision adjusts from 0 to 4 places through the settings gear icon. The default is two decimals, which suits most use cases. Your last calculation, currency choice, and decimal setting persist between visits, so if you come back to the page tomorrow, your numbers are still there.
One note on the calculation inputs: margin percentage caps at 99.99%. A 100% margin would require zero cost, which breaks the formula (you’d be dividing by zero). The tool catches this and shows a clear error message instead of producing garbage output. Markup has no upper cap — a 13,000% markup is unusual but mathematically valid, and the calculator handles it fine.
All calculations happen on the page itself. Your cost figures and revenue numbers aren’t transmitted anywhere — the math runs in your browser’s JavaScript, and the only storage used is your device’s local storage for remembering your last session.
FAQ
How does the calculator know which formula to use?
It tracks the last two fields you edited. If you typed into Cost and Revenue, it computes margin, markup, and profit from those. If you then change the Margin field, the new input pair becomes Cost + Margin, and Revenue is recalculated. There are six possible two-field combinations, and the tool switches between them automatically.
What is the difference between margin and markup?
Margin is profit divided by revenue, expressed as a percentage. Markup is profit divided by cost. A $25 profit on a $100 sale is a 25% margin but a 33.33% markup (since $25 / $75 cost = 33.33%). The calculator displays both values simultaneously so you can compare them directly.
Why can’t I set margin to 100%?
A 100% margin means your entire revenue is profit and cost is zero. The formula divides cost by (1 − margin/100), which becomes division by zero at 100%. The calculator caps margin input at 99.99% and shows an error if you enter 100 or higher.
Can I calculate margin if I only know markup and cost?
Yes. Enter values in the Cost and Markup fields, and the calculator derives revenue, profit, and margin automatically. Any combination of two fields works except Margin + Markup alone, since those two percentages need at least one dollar value to produce actual amounts.
How does the discount section work?
After a main calculation, open the discount panel and enter a percentage. It applies that discount to your selling price and shows the adjusted revenue, new profit, and recalculated margin. The original result stays unchanged above — the discount section is a what-if scenario, not a replacement.