Margin Calculator
Calculate profit margin from cost and selling price, and understand how margin differs from markup. No signup. Ideal for pricing, business and financial planning.
Result
| Profit | ||
|---|---|---|
| Profit Margin | ||
| Markup |
Share on Social Media:
A margin calculator works out your profit margin from the cost and selling price, along with the profit itself and the markup — free, with no account. Enter the cost and price to see the profit, the margin as a percentage of the selling price, and the markup as a percentage of the cost, all to two decimal places. It runs entirely in your browser, so nothing is uploaded or stored. The results carry no currency symbol, so they are in whatever currency your cost and price are in.
On this page
- How to Calculate Profit Margin Step by Step
- What Profit Margin Is and How It Works
- Margin Versus Markup Explained
- Who Uses a Margin Calculator
- Pro Tips for Working With Margins
- Common Margin Mistakes to Avoid
- Related Tools You May Need Next
- Frequently Asked Questions
How to Calculate Profit Margin Step by Step
- Enter the cost. Type the cost of the product into the cost field. This is what it costs you to make or buy, before selling. It cannot be negative, and it can be zero.
- Enter the selling price. Type the price you sell it for into the price field. The difference between price and cost is your profit. The price must be more than zero.
- Click Calculate. The tool works out the profit, the price minus the cost, the profit margin, the profit as a percentage of the selling price, and the markup, the profit as a percentage of the cost. Typing alone does nothing — you must click the button.
- Read the profit, margin and markup. See all three results — the profit amount, the margin percentage and the markup percentage — so you understand both how much you make per sale and what proportion of the price is profit, and how the same profit looks against the cost.
- Use the figures. Apply the margin to assess your profitability, compare products, set prices, or plan, knowing your margin as a percentage of revenue — and knowing the markup as well, so you do not confuse the two.

What Profit Margin Is and How It Works
Profit margin is a fundamental measure of profitability, expressing profit as a percentage of the selling price. It tells you what proportion of each sale's revenue is profit rather than cost. A margin reveals how much of what you charge you actually keep, making it a key indicator of the health and profitability of a product or business. It is expressed as a percentage of the price, which is what distinguishes it from markup.
The calculation is straightforward. The profit is the selling price minus the cost. The margin is that profit divided by the selling price, expressed as a percentage. So if a product's price is well above its cost, the margin is high, meaning a large share of the revenue is profit; if the price is only a little above cost, the margin is low. This per sale profitability is what the margin captures. Worked through: a product that costs 60 and sells for 100 makes a profit of 40.00, a margin of 40.00% (40 out of 100) and a markup of 66.67% (40 out of 60). A product that costs 80 and sells for 100 makes a profit of 20.00, a margin of 20.00% and a markup of 25.00%. A product that costs 45.50 and sells for 79.99 makes a profit of 34.49, a margin of 43.12% and a markup of 75.80%.
If the cost is zero, the margin is 100.00% — the whole price is profit — and the markup shows as —, because markup divides by cost and there is no cost to divide by. If you sell below cost, the tool shows the loss as negative figures: cost 120 and price 100 gives a profit of -20.00, a margin of -20.00% and a markup of -16.67%. Margin can never exceed 100% when the cost is zero or positive, because the profit can never be larger than the price itself — a margin of 40% means 40 in every 100 of price is profit, and the other 60 covers the cost.
| Cost | Selling price | Profit | Profit margin | Markup |
|---|---|---|---|---|
| 60 | 100 | 40.00 | 40.00% | 66.67% |
| 80 | 100 | 20.00 | 20.00% | 25.00% |
| 45.50 | 79.99 | 34.49 | 43.12% | 75.80% |
| 0 | 100 | 100.00 | 100.00% | — |
| 120 | 100 | -20.00 | -20.00% | -16.67% |
Margin Versus Markup Explained
| Margin | Markup | |
|---|---|---|
| Based on | Selling price | Cost |
| Formula | (price − cost) ÷ price × 100 | (price − cost) ÷ cost × 100 |
| Same sale | Always the smaller percentage | Always the larger percentage |
| Answers | "What share of the price do I keep?" | "How much do I add to the cost?" |
| Maximum | 100% (at zero cost) | No maximum |
Margin is on price, markup is on cost. Margin expresses profit as a percentage of the selling price, while markup expresses it as a percentage of the cost. Because the price is higher than the cost, the margin is always smaller than the markup for the same sale. Confusing them leads to mispricing and misjudging profitability: a 40% markup on a 60 cost gives a price of 84, not 100 — a 40% margin on a 100 price is a markup of 66.67%. The tool shows both, so you can see the same profit two ways at once. If you need the price for a target margin instead, the tool does not do that reverse calculation — use price = cost ÷ (1 − margin), so a 60 cost at a 40% margin needs a price of 60 ÷ 0.60 = 100.
Who Uses a Margin Calculator
Business owners checking profitability. An owner enters the cost and price of a product to see the margin and whether the product is worth selling at that price.
Retailers and resellers setting prices. A seller compares the margins of different products to decide which to stock and what to charge.
Freelancers and service providers pricing work. A freelancer works out the margin on a service after costs, to check the price covers the work and leaves a profit.
E-commerce sellers comparing listings. A seller checks the margin on each listing after the cost of goods, to see which products actually earn money.
Anyone learning margin versus markup. A person uses the calculator to see both figures for the same sale and finally tell the two apart.

Pro Tips for Working With Margins
Always compare the same measure. Margin and markup for one sale are different numbers — 40.00% margin and 66.67% markup on a 60 cost and 100 price — so compare margins with margins and markups with markups, never one with the other.
Read all three results. The profit tells you the money per sale, the margin tells you the share of price kept, and the markup tells you the uplift on cost — together they describe the sale completely.
Use margin for profitability, markup for pricing up. Margin answers "what share of the price do I keep?", markup answers "how much do I add to the cost?" — use the one that matches your question.
Remember margin cannot exceed 100%. With a zero or positive cost, the profit can never be larger than the price, so a margin above 100% means the cost was entered wrong — check for a negative or missing cost.
Watch for negative results. Selling below cost shows negative profit, margin and markup — the tool does not warn you, so read the minus signs before using the figures.
Work out a target price from a target margin. The tool does not do the reverse calculation, so use price = cost ÷ (1 − margin) — a 60 cost at a 40% margin needs a price of 100.
Keep the currency consistent. The results carry no currency symbol, so enter cost and price in the same currency — mixing currencies makes the figures meaningless.
Check the cost of zero case. A free product sold for 100 shows a 100.00% margin and a markup of —, which is correct — markup divides by cost, and there is no cost.
Common Margin Mistakes to Avoid
Confusing margin with markup. They are different measures of the same profit — margin divides by the price, markup by the cost — and for the same sale the markup is always the larger number; a 40% markup is not a 40% margin.
Entering the price as the cost. Swapping the two fields gives a negative profit and a meaningless margin — the cost is what you pay, the price is what you charge.
Expecting a currency symbol. The tool shows plain numbers such as 40.00 with no $ or £ — the figures are in whatever currency your inputs are in, so keep them consistent.
Assuming the tool finds a price from a margin. It does not do the reverse calculation — enter cost and price only, and use price = cost ÷ (1 − margin) yourself for a target margin.
Ignoring a negative result. A loss shows as negative profit, margin and markup, with no warning — a -20.00% margin means you lose 20 on every 100 of price, so do not use the figures without reading the signs.
Entering zero as the price. A revenue of zero or less stops with an Invalid Input message — the price must be more than zero. The message shows twice, with no browser bubble, and any previous result stays unchanged.
Entering a negative cost. A cost below zero is rejected with an Invalid Input message — a cost can be zero, but never negative. The message shows twice, with no browser bubble, and any previous result stays unchanged.
Assuming typing alone calculates. Nothing happens when you type the cost and price — the results appear only after you click Calculate.
Leaving both fields empty. An empty submit shows an Invalid Input message once, along with the browser's 'Please fill out this field.' bubble on the Cost field. Any previous result stays unchanged. Enter the cost and selling price first.
Related Tools You May Need Next
Discount Calculator. Work out a discounted price first.
Percentage Calculator. Work out a percentage of a price.
Percentage Change Calculator. Work out the change between two prices.
Compound Interest Calculator. Grow money over time.
Markup Calculator. Work from markup alone.

Frequently Asked Questions
How do I calculate profit margin?
Enter the cost and the selling price, then click Calculate. The tool works out the profit (price minus cost), then divides it by the selling price and multiplies by 100. For example, a cost of 60 and a price of 100 gives a profit of 40.00 and a margin of 40.00%.
What is the difference between margin and markup?
Margin divides the profit by the selling price, markup divides the same profit by the cost. For a cost of 60 and a price of 100, the profit is 40.00, the margin is 40.00% (40 out of 100) and the markup is 66.67% (40 out of 60). Because the price is higher than the cost, the markup is always the larger number for the same sale.
What is the formula for profit margin?
Profit margin = (selling price − cost) ÷ selling price × 100. The profit is the selling price minus the cost. For example, (100 − 60) ÷ 100 × 100 = 40.00%. The tool also shows the markup, which uses the same profit divided by the cost instead: (100 − 60) ÷ 60 × 100 = 66.67%.
Why is my markup bigger than my margin?
Because they divide the same profit by different numbers. Margin divides by the selling price, markup divides by the cost, and the cost is smaller than the price — so the same profit is a bigger percentage of the cost. On a 60 cost and 100 price, the profit of 40 is 40.00% of the price but 66.67% of the cost. That is normal, not an error.
What does a markup of "—" mean?
It means the cost was zero, so there is no markup to show. Markup is the profit divided by the cost, and dividing by zero is impossible. A free product sold for 100 shows a profit of 100.00 and a margin of 100.00%, with the markup shown as a dash.
Can profit margin be more than 100%?
No, not with a zero or positive cost. The profit can never be larger than the selling price itself, because the profit is the price minus the cost — so the margin tops out at 100% when the cost is zero. If you see a margin above 100%, the cost was entered wrong; check for a negative or missing cost.
What if I sell below cost?
The tool shows the loss as negative figures. A cost of 120 and a price of 100 gives a profit of -20.00, a margin of -20.00% and a markup of -16.67%. It does not warn you, so read the minus signs before using the figures.
Can the calculator find the selling price from a margin?
No. The tool only goes from cost and price to margin — it has no reverse mode. To find the price for a target margin yourself, use price = cost ÷ (1 − margin). For example, a 60 cost at a 40% margin needs a price of 60 ÷ 0.60 = 100.
What currency are the results in?
Whatever currency your cost and price are in. The tool shows plain numbers with no currency symbol, so enter both figures in the same currency — mixing currencies makes the results meaningless.
Is the margin calculator free?
Yes, it is completely free with no account and no usage limit. You can calculate as many margins as you like, as often as you like, at no cost. It runs entirely in your browser on any device — enter the cost and selling price, click Calculate, and read the profit, margin and markup.