Home › Finance › Profit Margin Calculator
Finance

Profit Margin Calculator

Enter a cost and a selling price and get the profit, the gross margin and the markup side by side — plus the selling price any target margin really requires — so the two percentages are never confused again.

Free · No sign-up · Runs in your browser · First published 2026-10-20 · Updated October 2026

Cost should be the full unit cost — materials or wholesale price plus packaging, shipping-in and fees per unit — or the margin flatters the product. The selling price is the price before sales tax; tax collected for the state is never your revenue. Everything is worked out on your own device.

Gross margin
—

The same profit, wearing two different percentages

Ask a seller their margin and a buyer their markup on the very same deal and you can hear two different percentages for identical money — because the two words divide the same profit by two different things. Margin divides profit by the selling price: of every dollar the customer hands over, how much is profit? Markup divides profit by the cost: how much was added on top of what the item cost? Margin is the accountant's measure and the one in every company's accounts; markup is the pricing habit on the shop floor. Confusing them is not a rounding slip — pricing a product at a "25% margin" by adding 25% to the cost delivers a margin of only 20%, and across a whole catalogue that five-point leak is real money. This calculator prints both, side by side, on every result, plus the price each target margin genuinely requires, so the confusion has nowhere to survive. It is the pricing-side companion to the discount calculator, which runs the customer's end of the same arithmetic.

The formulas, with every term defined

Profit = selling price − cost · Gross margin % = profit ÷ selling price × 100 · Markup % = profit ÷ cost × 100
Price for a target margin = cost ÷ (1 − margin ÷ 100) · Price from a markup = cost × (1 + markup ÷ 100)
Bar chart of the worked example: an $80 cost, a $100 selling price and $20 of profit — a 20 percent margin and a 25 percent markup
The worked example below, drawn as bars: the same $20 is 20% of the price and 25% of the cost.

Read it in words. The cost is everything one unit costs you — wholesale or materials, plus packaging, shipping-in and per-unit fees; leave pieces out and every percentage downstream flatters the product. The selling price is what the customer pays before sales tax — tax is collected for the state and is never revenue, a separation the sales tax calculator works through. The profit is the difference. Dividing it by the price gives the gross margin, which can never reach 100% on a real product (that would need a cost of zero) and falls as the cost share rises. Dividing the same profit by the cost gives the markup, which can pass 100% freely — a markup of 100% means the price is double the cost, which is a margin of exactly 50%. The target-margin formula runs the margin equation backwards: because the margin is measured against the price you are solving for, the price is the cost divided by what is left after the margin takes its share — never the cost plus that percentage of itself.

Worked example: an $80 cost sold at $100

The defaults above enter a cost of $80 and a selling price of $100. The profit is 100 − 80 = $20. The gross margin is 20 ÷ 100 × 100 = 20.00% — twenty cents of every sales dollar is gross profit, and the cost takes the other 80.00%. The markup is 20 ÷ 80 × 100 = 25.00% — the price is a quarter on top of the cost, a multiple of 1.2500x. One deal, one $20 profit, two correct percentages: 20% and 25%. The target table under the result shows the same $80 cost priced for other margins: a 10% margin needs $88.89, 20% is the $100 entered, 30% needs $114.29, 40% needs $133.33, and a 50% margin needs $160.00 — exactly double the cost, because at a 50% margin the cost must be the other half of the price.

Margins and markups on other deals

CaseCostPriceProfitMarginMarkup
Worked example$80$100$2020.00%25.00%
High-margin product$60$100$4040.00%66.67%
Half-again pricing$50$75$2533.33%50.00%
Larger ticket, same margin$200$250$5020.00%25.00%
Thin retail margin$35$50$1530.00%42.86%
Sold at a loss$80$70−$10−14.29%−12.50%

Two rows teach the whole lesson. The worked example and the $200 → $250 row have identical percentages (20.00% margin, 25.00% markup) at completely different sizes — percentages describe the shape of a deal, never its size, which is why the profit column sits beside them. And the loss row breaks the usual ordering: at a loss, the margin (−14.29%) is bigger in magnitude than the markup (−12.50%), because the divisor — the $70 price — is now the smaller number. The gap between the two measures widens as profit grows: at a $40 profit on a $60 cost the markup is 66.67% against a 40.00% margin. Anyone quoting you a percentage without naming its base is, deliberately or not, leaving the most important part out — the same warning the percent change calculator gives about rises and falls.

Reading a margin honestly — the limits

Four cautions belong with any figure here. This is gross margin, not net profit. It covers the unit's own cost only — rent, wages, advertising, payment fees beyond the unit, returns and your tax bill all come out afterwards, so a healthy 40% gross margin can still end the year at a loss; the ROI calculator is the tool for judging the whole venture. The cost must be complete: the commonest real-world error is costing the wholesale price and forgetting shipping-in and packaging, which overstates the margin on every unit sold. Discounts come straight off the margin: a 20%-margin product sold at 10% off does not have a 10% margin — the price falls to $90 against the same $80 cost, leaving $10 of profit and an 11.11% margin, because the discount is taken from the price while the cost stands still. And a target margin is not a pricing strategy: the table shows what a margin requires, not what customers will pay — a price the market refuses earns a margin of nothing at all.

Frequently asked questions

What is the difference between margin and markup?

Both divide the same profit by a different base. Margin divides by the selling price — the share of each sales dollar that is profit. Markup divides by the cost — how much was added on top of cost. A cost of $80 sold at $100 makes $20 of profit either way, but that is a margin of 20.00% (20 of 100) and a markup of 25.00% (20 of 80). This calculator always shows both so the base is never in doubt.

How do I price a product for a 30% margin?

Divide the cost by (1 − 0.30), that is, by 0.70 — not by adding 30% to the cost. An $80 cost needs a price of 80 ÷ 0.70 = $114.29 for a true 30% margin. Adding 30% to the cost instead gives $104, whose margin is only 23.08%, because the margin is measured against the final price, which is larger than the cost. The target table under every result lists the prices for margins of 10% to 50% at your cost.

Can a margin be over 100%?

No — not on a real sale. Margin is profit divided by price, and profit is the price minus a positive cost, so the margin is always under 100% and reaches it only if the cost were zero. Markup has no such ceiling: a $10 cost sold at $40 has a markup of 300%. That difference is a quick test when someone quotes a percentage — anything over 100% must be a markup (or an error), never a margin.

What does a negative margin mean?

That the unit sold for less than it cost. Selling an $80 cost at $70 gives a profit of −$10, a margin of −14.29% and a markup of −12.50%. Clearance and loss-leader pricing do this deliberately, but the calculator shows the size of the loss per unit so the decision is a chosen one — and note that at a loss the margin's magnitude exceeds the markup's, because the price has become the smaller base.

Does this calculator include sales tax and overheads?

No to both, deliberately. The selling price is the price before sales tax, because tax is collected on the state's behalf and is not revenue — counting it would inflate the margin. And the result is a gross margin: it covers only the unit cost you enter. Rent, wages, marketing and other overheads decide the net margin of the business as a whole, which no single-product calculator can know — enter a fully loaded unit cost if you want those costs reflected per item.

Ahsan ul Haq
Editor, ToolFigure

Every ToolFigure calculator is checked against hand-worked examples before it is published — the same worked examples you can follow on each page. More about ToolFigure →

Related tools

Calculators that show their working

Free forever · No sign-up · Every result comes with its formula and a worked example.

Browse all tools