Margin Calculator
Pick the two numbers you already have, such as cost and margin, and the calculator fills in the rest: revenue, cost, profit, gross margin and markup.
Last updated November 3, 2026
Result
Gross margin = 25%
| Measure | Value |
|---|---|
| Revenue | $80.00 |
| Cost | $60.00 |
| Profit | $20.00 |
| Margin | 25% |
| Markup | 33.33% |
Margin is profit as a share of revenue; markup is profit as a share of cost.
Show the work
Formula: revenue = cost ÷ (1 − margin ÷ 100); profit = revenue − cost
- You entered cost $60.00 and margin 25%.
- Revenue: $60.00 ÷ (1 − 25% ÷ 100) = $80.00.
- Profit: $80.00 − $60.00 = $20.00.
- Margin: $20.00 ÷ $80.00 × 100 = 25%.
- Markup: $20.00 ÷ $60.00 × 100 = 33.33%.
Result: Gross margin = 25%
How margin is calculated
profit = revenue − cost
margin = profit ÷ revenue × 100
markup = profit ÷ cost × 100
Gross margin is the part of the selling price that is profit. Markup is the profit measured against the cost. They share the same profit but use different denominators, so a margin is always smaller than the matching markup.
Because any two of the five figures fix the other three, you can start from whichever pair you have. For example, with a cost and a margin the revenue is cost ÷ (1 − margin), and with a profit and a margin the revenue is profit ÷ margin.
See how we calculate for the formulas, sources and review schedule behind every calculator.
Also useful alongside this calculator: Percentage Calculator.
Which pair should you enter?
Use cost and margin to set a price: you know what an item costs and what share of the price you want to keep. Use revenue and margin to find the most you can spend: you know the price and the margin you need. Use cost and markup when a supplier or a rule of thumb quotes a markup. Use profit and margin to work back from a profit target to the sales you need.
Use cost and revenue to check an existing price. If you only need that case, the Profit Margin Calculator gives the same result with a few extra pricing tips.
Margin versus markup
A 50% markup on a $100 cost gives a $150 price and a profit of $50, which is 33.33% of the price. The relation is margin = markup ÷ (1 + markup) and markup = margin ÷ (1 − margin), with percentages written as decimals.
Confusing the two is a common pricing error. If you want a 40% margin but add a 40% markup, you end up with about 28.6%, and your profit is lower than planned.
Pricing for a target margin
With a cost of $60, a 10% margin means a price of $66.67, 20% means $75, 30% means $85.71, 40% means $100 and 50% means $120. Each extra 10 points of margin raises the price by more than the last, because the margin comes out of the price itself.
Margin has to stay below 100%. Even with a cost of almost zero, the price can never be all profit on a real cost, and the calculator asks for a margin between 0 and 100.
Gross margin and what it leaves out
The result is a gross margin: it only counts the cost you enter. Rent, wages, advertising, payment fees and taxes are not in it. Add shipping, packaging and transaction fees to the cost to get a margin closer to what you really keep, and compare it with the overhead you need to cover.
Margins differ widely by trade. A restaurant, a retailer and a software company can all be healthy at very different gross margins, so compare your result with similar businesses rather than with a single number.
How to use the Margin Calculator
- Choose the two values you already know.
- Enter them. The other fields adapt to your choice.
- Read revenue, cost, profit, margin and markup.
- Open Show the work to see each formula, then Copy, Print or Share.
Worked example
An item costs $60 and you want a 25% margin. Revenue is $60 ÷ (1 − 0.25) = $80. Profit is $80 − $60 = $20. Margin is $20 ÷ $80 = 25%. Markup is $20 ÷ $60 = 33.33%.
| Margin | Price | Profit |
|---|---|---|
| 10% | $66.67 | $6.67 |
| 20% | $75.00 | $15.00 |
| 30% | $85.71 | $25.71 |
| 40% | $100.00 | $40.00 |
| 50% | $120.00 | $60.00 |
Frequently asked questions
What is the margin formula?
Margin is profit divided by revenue, times 100, where profit is revenue minus cost.
How do I find the price from cost and margin?
Divide the cost by 1 minus the margin as a decimal. For a cost of $60 and a 25% margin, $60 ÷ 0.75 = $80.
Is margin the same as markup?
No. Margin is based on the selling price and markup on the cost, so the same profit gives a smaller margin than markup.
Why is my markup blank?
Markup divides by the cost, so it cannot be worked out when the cost is zero.
Are my numbers stored or sent anywhere?
No. The calculation runs in your browser and nothing you enter is saved or uploaded.