Margin Calculator
Enter any two of cost, price, or margin — get the third, plus gross profit and markup.
Margin vs Markup Reference
| Margin % | Markup % |
|---|---|
| 10% | 11.11% |
| 20% | 25.00% |
| 25% | 33.33% |
| 30% | 42.86% |
| 33% | 49.25% |
| 40% | 66.67% |
| 50% | 100.00% |
Markup = Margin / (1 − Margin). Margin = Markup / (1 + Markup).
This gross margin calculator works out the selling price, the cost, the gross profit, the margin percentage, and the markup percentage — from any two of the others. Pick a mode, enter two numbers, and the rest fills in. Every result is expressed as a share of revenue too, so you can see how much of each sales dollar is left once the goods are paid for.
Margin is the number that decides whether a price survives a bad month. At a 40% gross margin, 40 cents of every sales dollar stays with you to cover rent, wages, and returns; at 15%, almost nothing does. Below are the formula, a worked example, the margin-to-markup conversion, and the ranges most industries treat as normal.
How to calculate gross margin
- Find the landed cost of the item — what you paid, including freight in. Say $30.
- Find the revenue — what the customer pays. Say $50.
- Gross profit = revenue − cost = $50 − $30 = $20.
- Gross margin = gross profit / revenue = $20 / $50 = 0.4.
- Multiply by 100: 40%. The same $20 is a 66.7% markup, because markup divides by the $30 cost instead.
Example
A chair costs $80 landed and you want a 35% gross margin. Price = 80 / (1 − 0.35) = $123.08. Gross profit is $43.08, which is 35% of $123.08 and a 53.8% markup on the $80 cost. Price the same chair at $115 instead and the margin falls to 30.4% — five dollars of price movement is worth four points of margin.
Gross margin formula
Gross margin = 100 × (revenue − cost) / revenue. Selling price = cost / (1 − margin/100). Markup = 100 × margin / (100 − margin). Cost = revenue × (1 − margin/100).
How to use this calculator
- Choose the mode that matches what you already know: cost + margin, cost + markup, or cost + selling price.
- Enter the cost. In the second mode add the markup percentage; in the third add the price you plan to charge.
- Read the selling price panel first, then the four-row breakdown for gross profit, gross margin, and markup.
- Change the margin field to test a target — the price updates as you type, and the URL keeps the inputs so a scenario can be shared.
What is gross margin?
Gross margin is the share of revenue left after the direct cost of the goods sold. It answers one narrow question: if I sell another unit at this price, how much is left to run the business? It is not net profit — rent, salaries, advertising, interest, and tax all come out of that remainder, which is why a company can post a 45% gross margin and a 3% net margin.
Because it is a ratio, it compares across sizes: 40% means the same thing on a $5 phone case and a $5,000 sofa.
Margin vs. markup
Both describe the same $20 of profit on a $50 sale, but they divide it by different bases. Margin divides by revenue ($20 / $50 = 40%); markup divides by cost ($20 / $30 = 66.7%). Margin is always the smaller number and can never reach 100%, while markup has no ceiling. To convert, markup = margin / (1 − margin) and margin = markup / (1 + markup).
| Margin | Markup |
|---|---|
| 10% | 11.1% |
| 20% | 25.0% |
| 25% | 33.3% |
| 30% | 42.9% |
| 33% | 49.3% |
| 40% | 66.7% |
| 50% | 100.0% |
The two only converge at a 50% margin, where cost and profit happen to be equal.
A note on terminology
Margin, profit margin, gross margin, and gross profit margin are used interchangeably here, and in most small businesses they describe the same calculation. The distinction that does matter is gross vs. net: gross margin stops at cost of goods sold, net margin subtracts every other expense. If you arrived searching for profit calculator, gross profit calculator, gp calculator, or sales margin formula, this is the right page — the arithmetic is identical.
What is a good gross margin?
There is no universal target. Software and apparel routinely clear 60–80%, grocery and consumer electronics often run 15–25%, and a distributor at 18% can be healthier than a boutique at 55% because it turns inventory far faster. Two rules do hold across industries: a negative gross margin means every sale loses money, and a margin that cannot cover fixed costs plus a thin net profit will not survive a slow quarter. Compare against your own category first, then against your own prior quarters — the trend matters more than the level.
What this calculator leaves out
Volume discounts, freight-in, payment processing, marketplace commissions, and returns all change the real margin. If you sell through a channel that takes 15%, treat that fee as part of the cost, or the number above will be the margin you wish you had. Sales tax and VAT are not revenue either — they pass straight through, so price net of tax.
Common mistakes
- Dividing profit by cost instead of revenue. That is markup, and it makes every margin look better than it is.
- Setting a target margin and then applying it as a markup. A 40% markup is only a 28.6% margin on the price.
- Reporting a margin above 100%. It would require a negative cost, so the formula or the fields are the wrong way round.
FAQ
What is the difference between gross margin and net margin?
Gross margin subtracts only the direct cost of the goods. Net margin subtracts every other expense as well — rent, payroll, marketing, interest, and tax. The gap between the two is usually where a business either works or does not.
How do I calculate a 20% margin?
Divide the cost by 0.8. A $30 item needs a $37.50 price: 30 / (1 − 0.20) = 37.50, which leaves $7.50 of gross profit, exactly 20% of the price. Multiplying the cost by 1.20 is the common error — that yields a 16.7% margin.
How do I calculate a 30% margin?
Cost / 0.7. A $70 cost becomes $100 at a 30% margin, with $30 of profit. The same $70 cost at a 30% markup would sell for $91 and return only a 23.1% margin.
What is a good margin for a small business?
Most small businesses sit between 20% and 50% gross margin, with services near the top and resale near the bottom. The more useful test is break-even: fixed costs / gross margin gives the revenue needed just to cover overhead.
How do I convert margin to markup?
Markup = margin / (1 − margin). A 25% margin is a 33.3% markup; a 40% margin is a 66.7% markup. Going back, margin = markup / (1 + markup).
Is margin the same as profit?
No. Profit is an amount — $20 on this sale. Margin is that amount as a share of revenue — 40%. Two companies can earn identical profit while one runs at 8% margin and the other at 45%, and the second has far more room to absorb a price cut.
Can a margin be over 100%?
No. Margin is profit divided by revenue, and profit cannot exceed revenue unless cost is negative. A figure above 100% means the tool is computing markup, or the cost and price fields are swapped.
How do I calculate margin in Excel?
Put cost in A1 and price in B1. In C1, =B1-A1 gives profit. In D1, =C1/B1 gives margin; format D1 as a percentage. For a target margin, =A1/(1-0.4) returns the price for a 40% margin.
Why is markup always higher than margin?
Because the same profit is divided by a larger base. Revenue equals cost plus profit, so the denominator grows and the percentage shrinks. The two are equal only when profit is zero.
What is a 40% margin on $100?
It depends which $100 you mean. If $100 is the selling price, the cost must be $60 and the profit $40. If $100 is the cost, the price must be $166.67. That ambiguity is why the calculator has three modes.