Margin Calculator
This calculator finds profit margin, markup and profit from a cost and selling price. Alternatively, enter cost and a target margin to calculate the price required, using sales revenue rather than cost as the margin denominator.
By Dr. Hassan Khames EliwaLast updated
Result
- Selling price
- $100.00
- Profit
- $40.00
- Markup
- 66.67%
How it works
Margin and markup use different denominators
Profit is selling price minus cost. Margin expresses that profit as a share of revenue; markup expresses it as a share of cost. These measures describe the same transaction but answer different questions. Margin tells you how much of each sales dollar remains after the entered cost. Markup tells you how far above cost the price has been set.
Choose cost and price to inspect an existing offer. Choose cost and target margin to set a price. The target-margin formula rearranges the margin equation; it does not simply add the target percentage to cost. A target margin must be below 100%, and this pricing mode requires a positive cost. Negative target margins are allowed to represent deliberate below-cost pricing.
Decide what belongs in cost
For a product-level gross margin, cost might include purchase price, freight into the warehouse and direct manufacturing costs. For a contribution view, you may also include transaction fees and other variable selling costs. Those are different measures. Label your cost definition so a colleague can reproduce the calculation rather than assuming that every margin is net profit.
Use prices and costs on a consistent tax basis. A tax-registered seller will commonly compare tax-exclusive sales and recoverable-tax-exclusive costs. The calculator does not decide whether tax is recoverable, allocate overhead or estimate income tax. The GST and VAT calculator can separate an inclusive amount before you run the comparison.
Read losses without hiding them
A price below cost produces negative profit, negative margin and negative markup. If cost is zero and price is positive, margin is 100%, but markup is undefined because it would divide by zero. The result explicitly says “Not defined” rather than presenting an infinite percentage.
Worked example
Pricing a product that costs $60
Enter cost of $60 and selling price of $100 in cost-and-price mode. Profit is $100 − $60 = $40.00. Divide $40 by the $100 selling price to get 40.00% margin. Divide the same $40 by the $60 cost to get 66.67% markup.
Switch to cost-and-target-margin mode and enter cost of $60 with a 40% target. The required selling price is $60 ÷ 0.60 = $100.00. The other results remain $40.00 profit and 66.67% markup.
Adding 40% to $60 instead would produce a price of $84. That is a 40% markup, but its margin is only 28.57%. This is why a price-setting conversation should always specify whether the percentage is margin or markup.
Expert tips
Common mistakes
- Using markup as margin. A 50% markup does not leave half the selling price as profit. The denominator changes, so the two percentages only coincide when profit is zero.
- Ignoring selling fees. Payment processing, marketplace charges and packaging can consume a narrow margin. Include the costs relevant to your decision rather than relying on the purchase invoice alone.
- Calling gross profit take-home profit. Rent, wages, financing, losses and tax may still need to be paid. This calculator only subtracts the cost you enter from revenue.
For education, not financial advice. Results are estimates based on the inputs you give. Lenders, tax authorities and advisers may use different rules, fees and rounding. Check the numbers with a qualified professional before you commit to anything.
Frequently asked questions
Can margin exceed 100%?
Not with a nonnegative cost and positive selling price. A zero cost gives 100% margin. A positive cost cannot achieve exactly 100% margin at any finite price.
Why is markup larger than margin on a profitable sale?
Profit is divided by a smaller number when cost is below selling price. That makes markup larger even though the dollar profit is unchanged.
Can I calculate a loss-making price?
Yes. Enter a price below cost, or a negative target margin in target-price mode. Review whether the loss is intentional, such as a clearance decision, rather than a data-entry mistake.
Does this calculate net profit margin?
Only if your entered cost includes every expense you intend to allocate. With product purchase cost alone, the output is a product gross margin, not a full business net margin.
How do I learn more about the difference?
The margin versus markup guide explains the different denominators. Use the same cost definition across products when comparing their results.
Related calculators
Related guides
MathPercentages people get wrong: change, difference and pointsThe denominator determines the answer. Learn to distinguish percentage change, symmetric difference and percentage-point movements.14 November 2026 · 7 min read
FinancialMargin vs markup: the pricing mistake that eats profitA percentage added to cost is not the same percentage retained from sales. That denominator mistake can quietly undermine a pricing plan.14 November 2026 · 7 min readAbout the author
Dr. Hassan Khames Eliwa holds a PhD in Construction & Built Environment and has more than 20 years of international project controls experience. He is Director of Eliwa Project Controls Limited in Auckland and founder of PMMilestone.org and PMMilestone.com.
Buy me a coffee