Margin Calculator
Turn a cost and a selling price into profit margin, markup, and profit per unit.
Margin and markup together
Margin measures profit against the selling price; markup measures the same profit against the cost — this calculator shows both at once.
Selling below cost
If the selling price is lower than the cost, profit and both percentages turn negative — a clear signal you are selling at a loss.
What is profit margin?
Profit as a share of the selling price
Profit margin is the slice of each sale you actually keep, expressed as a percentage of the selling price. A product that costs 60 and sells for 100 leaves 40 of profit, which is a 40% margin — 40 of every 100 in revenue. Because it is measured against revenue, margin can never exceed 100%, which makes it the figure businesses use to compare profitability across products of very different prices.
Subtract the cost from the selling price to get the profit, divide that profit by the selling price, and multiply by 100.
Profit margin = (price − cost) ÷ price × 100The same profit divided by the cost instead of the price gives the markup: 40 ÷ 60 × 100 ≈ 66.67%. Margin and markup describe the identical profit from two different angles, which is why a 40% margin and a 66.67% markup are the same deal.
Suppose an item costs you 60 and you sell it for 100.
Find the profit
100 − 60 = 40, your profit per unit.Divide by the selling price
40 ÷ 100 = 0.40.Convert to percent
0.40 × 100 = a 40% profit margin.
The key is not to confuse margin with markup. Margin is measured over the selling price, markup over the cost — the same 40 of profit is a 40% margin but a 66.7% markup. Markup is always the larger number because the cost is the smaller base, so quoting one when you mean the other quietly inflates or deflates the figure. Use margin when you want to know how much of each sale you keep, and markup when you are setting a price by adding a percentage on top of cost. If you start from the cost and a target markup, the markup calculator works the price out for you.
The arithmetic is exact, but a couple of cases need care.
Gross margin, not net profit
This is a gross margin: it counts only the direct cost of the item against its price. It does not subtract overheads, shipping, fees, taxes, or returns, so your real take-home per sale is lower. A zero or negative cost or price has no meaningful margin, so the calculator waits for two positive figures before showing a result.