Profit Margin Calculator
Enter what an item costs you and what you sell it for, and see the gross profit, the profit margin, and — because the two are endlessly confused — the equivalent markup side by side. Works in any currency; nothing you type leaves your browser.
Margin from cost and selling price
Example: cost 60, selling price 100 — a 40% margin.
How the margin is calculated
Gross profit is simply selling price minus cost; margin expresses that profit as a share of the selling price: margin% = (revenue − cost) ÷ revenue × 100. Buying at 60 and selling at 100 gives a profit of 40 and a margin of 40% — figures this page computes with the same tested engine as the calculator above. Because the denominator is revenue, margin answers the retailer's question: of every unit of money a customer hands over, how much do I keep? At the example's 40% margin the answer is 40 kept out of every 100 charged.
The engine performs no rounding of its own: gross profit and the margin percentage are held at full precision, and only the display layer rounds them for the screen. A figure you copy from a result is therefore the rounded presentation of a more precise internal value, so for work that chains one result into the next, prefer running the whole calculation in a single pass. The methodology page documents exactly how that rounding policy works.
For the full arithmetic behind these two percentages — how they are derived, how to convert one into the other, and the mistakes the conversion invites — read the companion guide, Margin vs. markup arithmetic. It sits in the wider Sumvia guides alongside the other business-math explainers.
Margin vs. markup — don't swap the denominators
The single most common pricing mistake is quoting a markup as if it were a margin, or vice versa. The same 60-cost, 100-price sale is a 40% margin (profit ÷ price) but a 66.67% markup (profit ÷ cost). A shop that wants a 40% margin but applies a 40% markup ends up cheaper than intended and quietly gives away profit on every sale. If you start from cost and a target percentage on top, you want the markup calculator; if you are checking totals across many sales, the profit calculator works from revenue and overall costs.
The gap between the two numbers is not a quirk of particular prices; it is built into the definitions, and it is widest exactly where the money is. Holding the selling price at 100 and raising the cost, the engine reports both percentages for each sale:
| Cost | Selling price | Gross profit | Markup | Margin |
|---|---|---|---|---|
| 25 | 100 | 75 | 300% | 75% |
| 50 | 100 | 50 | 100% | 50% |
| 60 | 100 | 40 | 66.67% | 40% |
| 75 | 100 | 25 | 33.33% | 25% |
| 80 | 100 | 20 | 25% | 20% |
Two things fall out of the table. First, because the selling price is fixed at 100, the gross-profit column happens to equal the margin percentage — at a price of 100 the profit is the margin, which is a handy way to feel what a margin means. Second, the markup is always the larger of the two percentages on a profitable sale, and the two drift apart as the profit grows: at a cost of 80 the markup is 25% against a 20% margin, a gap of a few points, while at a cost of 25 the markup has climbed to 300% against a 75% margin. Read a row across and the point is plain: the two columns describe one identical sale.
The identity that links margin and markup
Margin and markup are not independent numbers you have to look up separately; each one
determines the other exactly, because they share a numerator. The gross profit on a sale is
the same whichever base you divide it by — margin puts the selling price underneath, markup
puts the cost underneath. Feed the engine the same cost and price two ways and the figures
line up:
profitMargin on a selling price of 100 and a cost of 60 returns a
40% margin and a 66.67% markup, and markupFromPrices
on that cost of 60 and price of 100 returns the identical pair — profit 40, markup 66.67%, margin 40%.
The algebra behind the pairing is short: a markup of m per cent produces a margin of m ÷ (100 + m) × 100, and a margin of g per cent comes from a markup of g ÷ (100 − g) × 100. You do not have to run those by hand — the point of showing both columns on every result is that the conversion is already done for you — but the shape of the first formula explains the ceiling in the next section, and the margin vs. markup guide works the conversions through step by step.
Why markup is unbounded but margin stays below 100%
A margin can approach 100% but never reach it while any cost remains, because margin is profit divided by the selling price, and profit is the selling price minus a positive cost — the part can never be the whole. A markup has no such ceiling: it divides the same profit by the cost, and the cost can be arbitrarily small next to the price. The example service, costing 150 and sold at 1,200, shows the split starkly — an 87.5% margin but a 700% markup. Drive the cost to zero and the calculator stops reporting a markup at all: a free-to-make item sold at 100 is a 100% margin, and the markup figure is dropped because dividing a profit by a zero cost has no defined value. That is why a quoted markup above 100% is unremarkable while a claimed margin above 100% is always a mistake — usually a markup wearing the wrong label.
Reading the result
A positive margin means the sale contributes profit; -25% on a 100-cost, 80-price sale means each sale loses 20. Margins are comparable across products of very different prices precisely because they are ratios — which also means a healthy-looking margin on a slow seller can still earn less in total than a thin margin on volume. Margin alone never tells the whole story; it tells you the share of each sale you keep.
Because it is a ratio, the same margin can sit on wildly different amounts of cash. A small item costing 12 and selling at 20 carries a 40% margin and keeps 8 per sale; a large item costing 3,000 and selling at 5,000 carries the same 40% margin yet keeps 2,000. The percentages are identical and so are the markups, but the money is three orders of magnitude apart. To turn a margin back into money, multiply the share by the price and then by how many you sell — which is the step the profit calculator takes over when you move from one item to a whole period.
What this page does and does not compute
This page computes the gross margin on a single sale: one cost, one selling price, the profit between them, and the two percentages that describe it. It deliberately does not reach for anything beyond that arithmetic. It does not subtract the overheads that turn a gross margin into a net one — rent, wages, fees, and everything else that sits outside the direct cost of the item; for a figure net of those, total your revenue and all your costs in the profit calculator. It knows nothing of tax, and it applies none: the cost and price you enter are whatever currency and tax basis you choose to type, and the result is in the same terms. As the methodology puts it, a generic tool implements the general mathematical definition, while specific domains — tax rules, regulated calculations, jurisdiction-specific rounding of currency — impose conventions a generic calculator does not know. The margin here is the clean ratio; reconciling it to your own rules is a step this page leaves to you.
Frequently asked questions
What is a profit margin?
Profit as a share of the selling price: margin% = (revenue − cost) ÷ revenue × 100. Buy at 60 and sell at 100 and the margin is 40% — 40 of every 100 you charge is profit.
What is the difference between margin and markup?
They divide the same profit by different bases. Margin divides by the selling price; markup divides by the cost. Cost 60 sold at 100 is a 40% margin but a 66.67% markup — one sale, two very different-looking percentages.
Can a margin be negative?
Yes. A negative margin means the item sold below cost: buy at 100 and sell at 80 and the margin is -25%, a loss of 20 per sale. The calculator reports it as a loss rather than treating it as an error.
What is the difference between gross margin and net margin?
Gross margin uses only the direct cost of what you sold. Net margin subtracts every other cost as well — rent, wages, marketing, fees — so it is always lower. This page computes the gross figure for a single item; for totals across a period, the profit calculator takes overall revenue and costs.
Why can a markup exceed 100% when a margin cannot?
Margin is profit ÷ revenue, and profit can never exceed the revenue that contains it, so margin tops out below 100% whenever cost is above zero. Markup is profit ÷ cost, and profit can be any multiple of cost: a service costing 150 sold at 1,200 has a 87.5% margin but a 700% markup.
How do I turn a target margin into a selling price?
This page reads the margin from a cost and a price you already have; it does not set the price for you. Working the other way — from a cost and a target margin to a price — means applying the markup that margin implies. A 40% margin on a cost of 60 corresponds to a selling price of 100, which is a 66.67% markup; the markup calculator does that step from the cost side.
Does a higher margin always mean more money?
No — margin is a ratio, not an amount. An item costing 12 sold at 20 and one costing 3,000 sold at 5,000 both show a 40% margin, yet the first keeps 8 per sale and the second 2,000. The percentage is the share of each sale you keep; money is that share multiplied by price and volume.
Why must the selling price be above zero while the cost can be zero?
Margin divides profit by the selling price, so a price of zero would divide by zero and has no defined margin — the calculator requires a price greater than zero. A cost of zero is accepted: the whole price is profit, the margin is 100%, and the markup figure is dropped, because dividing profit by a zero cost is undefined.
Everything on this page is computed locally in your browser; your figures are never transmitted. The margin and markup formulas are implemented as tested, typed functions — see the methodology page.