Profit Margin Calculator
Work out profit margin and markup from cost and price, or find the selling price that gives you a target margin or markup.
How it works
Profit margin and markup both start from the same number, the profit:
profit = selling price − cost
They differ only in what that profit is compared with:
margin % = profit / selling price × 100
markup % = profit / cost × 100
The calculator has three tabs, one for each question people bring to it.
Cost & price. You know what something cost and what you sell it for. The tool returns the profit (or the loss), the margin and the markup.
Target margin. You know the cost and the share of the price you want to keep as profit. The selling price that achieves it is:
selling price = cost / (1 − margin % / 100)
Target markup. You know the cost and the percentage you add on top of it:
selling price = cost × (1 + markup % / 100)
Margin and markup can be converted into each other: margin = markup / (1 + markup) and markup = margin / (1 − margin), with the percentages written as decimals. A few pairs worth remembering:
| Markup | Margin | |---|---| | 25% | 20% | | 50% | 33.3% | | 100% | 50% | | 200% | 66.7% |
All amounts are handled as whole cents internally, not decimals, and the selling price is rounded to the nearest cent (a tie rounds up). Profit is always the rounded price minus the cost, so the figures add up to the cent. The percentages are calculated from those rounded amounts, which is why a target margin of 30% on a $19.99 cost shows a resulting margin of 30.01%: the price has to be a whole number of cents.
Two edge cases: a selling price of zero returns an error, because margin is a share of the price. A cost of zero is accepted, but the markup is shown as undefined, since there is nothing to compare the profit with.
Going from margin to markup
The table above starts from markup. Starting from margin, the same conversion looks like this:
| Margin | Markup | |---|---| | 10% | 11.1% | | 20% | 25% | | 30% | 42.9% | | 40% | 66.7% | | 50% | 100% | | 60% | 150% | | 75% | 300% |
The pattern is that margin is always the smaller number, and the gap widens quickly. A 50% margin is a markup of 100%: the price is double the cost. Mixing the two in a price list or a supplier conversation is how a "30% margin" quietly becomes 23.1%.
Price with or without VAT or sales tax
Margin is only meaningful if cost and price are on the same footing. Say a shelf price of 120 includes VAT at 20% (a rate chosen only to keep the arithmetic easy) and the item costs 80. The seller keeps 120 / 1.20 = 100, so the real profit is 20 and the margin is 20 / 100 = 20%. Using the shelf price instead gives 40 / 120 = 33.3%, which overstates it. Whether tax you paid on your own purchases counts as a cost depends on whether you can reclaim it, which varies by country and business type; enter the cost net of anything you get back.
How a discount eats the margin
A discount comes off the price, but the cost stays the same, so the whole discount comes out of profit. Take an item that costs 60 and sells for 100: profit 40, margin 40%. A 25% discount makes the price 75, the profit 15 and the margin 20%. The discount was 25% of the price, but 62.5% of the profit (25 of 40). To earn the same total profit, you now need to sell 40 / 15 = 2.67 times as many units. Run the discounted price through the cost and price tab before you set the promotion.
Break-even and percentage costs in the price
The tool works per unit. To get a break-even volume, divide your fixed costs by the profit per unit. With 2,000 a month in fixed costs and a product that costs 15 and sells for 25, the profit per unit is 10, so break-even is 2,000 / 10 = 200 units, or 200 × 25 = 5,000 in sales (also 2,000 divided by the 40% margin).
If part of your costs is a percentage of the price, such as a payment fee, add it to the margin you enter. For a cost of 70, a 3% fee and a 20% margin you want to keep after the fee, enter a target margin of 23%: the price is 70 / 0.77 = 90.91. The fee is about 2.73 and the profit after it is 90.91 − 70 − 2.73 = 18.18, which is 20% of the price. The 3% is only an example.
Examples
Cost & price. A shop pays $60 for a jacket and sells it for $100. The profit is $40. The margin is 40 / 100 = 40% and the markup is 40 / 60 = 66.7%.
Target margin. A bakery's cost for a cake is $12.50 and the owner wants a 60% margin. The price is 12.50 / 0.40 = $31.25, a profit of $18.75 and a markup of 150%.
Target markup. A reseller buys a part for $200 and adds a 35% markup. The price is 200 × 1.35 = $270, a profit of $70 and a margin of 25.9%.
A loss. A $100 item sold for $80 is a $20 loss: a −25% margin and a −20% markup.
Things to watch for
- Margin and markup are not interchangeable. Applying a 30% markup does not give a 30% margin; it gives 23.1%. If you quote prices from a margin target, use the target margin tab, not a markup.
- Use the price without sales tax. If your selling price includes VAT or sales tax, the tax is not your income and the margin will look better than it is. Take the tax out first with the VAT calculator.
- Decide what counts as cost. Product cost only gives a gross margin. Adding shipping, payment fees, rent and wages gives a figure closer to what you actually keep. Keep the definition the same when comparing products or periods.
- Discounts change the margin quickly. A product that costs $80 and sells for $100 has a 20% margin. A 10% discount drops the price to $90, so the profit halves from $20 to $10 and the margin falls to 11.1%, not 10%. Work out the new price with the discount calculator and run it through the cost and price tab.
- A margin of 100% is not reachable for a product that costs anything, which is why the target margin tab stops at 99.99%.
- Everything runs in your browser. The costs and prices you enter are not sent to a server.
Frequently asked questions
Last updated: 10/08/2026
Related tools
Calculate return on investment and the annualized return from what you put in and what you got back, or find the final value for a target ROI.
Calculate CTR, CPC, CPM, CPA, conversion rate, ROAS and ROI from your ad numbers. Fill in what you have; you only get the metrics those numbers allow.
Calculate a discounted price, work out a discount percentage, or combine two discounts that apply one after another.
Add VAT to a price or work out how much VAT is included, using UK, German, or Turkish rates.