How to calculate margin
Margin = (Price − Cost) ÷ Price × 100 Markup = (Price − Cost) ÷ Cost × 100
Worked example. Profit margin: 38.46%.
Example inputs — Cost: $40.00; Selling price: $65.00. Starting values are illustrative.
From George Guju, founder of Calculyn · Educational calculator guidance, not professional advice.
How it works
Margin is profit as a share of the selling price; markup is profit as a share of cost. A 50% markup is only a 33% margin — mixing them up is a common pricing mistake.
Using the margin estimate
Profit margin and markup describe the same dollar spread using different denominators. This calculator subtracts entered cost from selling price, then expresses that difference as a share of selling price for margin and a share of cost for markup. It helps check pricing arithmetic before quoting a product or service. The word profit here means price less the cost you entered; it is not automatically net business profit after overhead, financing, tax and every other expense. Define the cost basis before interpreting the percentage.
Step-by-step inputs
- Cost. Enter the cost associated with the same unit or transaction as the selling price. Decide whether it includes only acquisition cost or also delivery, labor and sale-related charges, and use that definition consistently. Starting example: $40.00 .
- Selling price. Enter revenue you actually retain for that unit after planned discounts. Use a positive price to obtain a margin. Do not mix a per-unit cost with the revenue for an entire batch. Starting example: $65.00 .
Worked example with the starting values
Using the starting inputs, the estimate is Profit margin: 38.46% .
The profit line subtracts cost from price. The headline divides that difference by price and multiplies by one hundred, while the markup line divides it by cost. For a profitable transaction with positive cost, the markup percentage is larger because its denominator is smaller. Both describe the same dollar difference; adding or averaging them has no useful meaning. The displayed percentages are calculated from unrounded inputs, so compare them on a consistent cost basis.
- Profit
- $25.00
- Markup
- 62.5%
Compare selling price scenarios
The starting cost stays fixed while the selling price changes. These are per-unit margin comparisons, not sales forecasts or benchmarks for what margin a business should achieve.
| Selling price | Profit margin |
|---|---|
| $50.00 | 20% |
| $65.00 | 38.46% |
| $80.00 | 50% |
Make a useful comparison
Compare realistic selling prices at the same cost. A discount reduces both revenue and the dollar spread while the cost may stay unchanged. The scenario table makes that margin sensitivity visible, but it does not estimate how many extra customers a discount attracts or whether total business profit would rise.
Separate product contribution from business profitability. If entered cost contains only purchase or production costs, the remaining spread still has to cover overhead and other expenses. Use the break-even calculator with a clearly defined variable cost and fixed-cost total when you need a sales-volume target rather than just a per-unit percentage.
Translate a target margin into a selling price using cost divided by one minus the target margin expressed as a decimal. That is different from adding the target percentage to cost, which creates a markup. After finding a candidate price, enter it here to check the implied margin and consider customer demand separately.
Common mistakes to avoid
- Do not label a cost-based percentage as margin. A quoted percentage without its denominator can lead to underpricing, especially when suppliers, sales teams and accounting reports use different conventions.
- A zero cost produces a full margin on a positive price, but the calculator omits markup because division by zero is undefined. A missing markup is not zero markup, and a zero input does not establish that a product truly has no costs.
- A price below cost produces a negative margin, indicating a loss on the entered basis. A nonpositive selling price instead shows a prompt without a meaningful margin breakdown. Neither result includes unentered overhead or tax effects.
Assumptions & limitations
- Results are rounded for display.
Formula and assumptions reviewed October 2026 by the Calculyn team. How we build our calculators
Frequently asked questions
What's a good profit margin?
It depends on the industry — grocery stores run on a few percent, while software can exceed 70%.
How do I set a price for a target margin rather than a target markup?
With a positive cost and a target margin below 100%, divide cost by one minus the margin written as a decimal. Adding a percentage to cost sets markup instead. Enter the resulting price to check the margin on your chosen cost basis.
Does the profit line mean money left after all business expenses?
Only if your entered cost actually includes every expense relevant to that transaction. The tool subtracts just that cost from price. Overhead, financing, taxes and other omitted costs still need a separate calculation.
