The two formulas
Use the same three amounts every time: cost, selling price, and the difference (selling price minus cost). Then:
- Markup = difference divided by cost.
- Margin = difference divided by selling price.
Multiply by 100 if you want a percent. Markup answers "how much did I add on top of my cost?" Margin answers "how many cents of each dollar I collect are not cost?" Cost sits in the bottom of the markup fraction. The price the customer pays sits in the bottom of the margin fraction. That single swap is the whole distinction.
To go the other way, from a percentage you chose to a price:
- Price from a markup = cost times (1 + markup). A 25% markup multiplies cost by 1.25.
- Price from a margin = cost divided by (1 minus margin). A 20% margin divides cost by 0.80. Margin has to stay below 100%, because you cannot have a cost that is zero or negative and still be using this formula.
These are arithmetic identities. They are not a recommended markup for roofing, cleaning, or any other trade. They are not tax advice. What you include in "cost" is a business choice, and tax on the selling price is a question for an accountant.
Example A: same dollars, two percentages
Example only. A materials line costs you $200. You sell it for $300. The difference is $100.
Markup = 100 / 200 = 0.50, which is 50%. Margin = 100 / 300 = 0.333..., which is 33.3% if you round to one decimal. You did not earn two different profits. You described one $100 gap in two ways.
A smaller case that is easy to remember, also an example: 25% markup on any cost is a 20% margin. Price is 1.25 times cost, and the gap of 0.25 divided by 1.25 is 0.20. The free calculator on our site uses that pair as its on-page example. It is an illustration of the conversion, not a target.
Example B: pricing for a 40% margin
Example only. Cost is $200, and you want a 40% margin. Margin is a share of the selling price, so the cost is the other 60% of that price.
Selling price = 200 / (1 - 0.40) = 200 / 0.60 = $333.33, rounded to the cent. Difference = 333.33 - 200 = $133.33. Check the margin: 133.33 / 333.33 = 0.40, or 40%. Check the markup on that same price: 133.33 / 200 = 0.66665, or 66.7% to one decimal. A 40% margin in this example is a 66.7% markup. Quoting "40%" without saying which word you mean will not produce this price.
Example C: the mix-up that underprices the job
Example only, same $200 cost. You add a 40% markup because you said "40%" and multiplied. Price = 200 times 1.40 = $280. Difference = $80. Margin = 80 / 280 = 0.2857..., or 28.6% to one decimal.
You kept about 29 cents of each dollar collected, not 40. If your costs were complete and you needed a 40% margin to cover the plan you wrote down, this price misses it. The job can still be busy and still fail the plan. The error was the denominator, not the crew.
| What you did | Selling price | Markup | Margin |
|---|---|---|---|
| Sell at $300 | $300.00 | 50% | 33.3% |
| Target a 40% margin | $333.33 | 66.7% | 40% |
| Add a 40% markup | $280.00 | 40% | 28.6% |
Apply it to the whole job, not only the material receipt
Contractors rarely have a single $200 receipt. A job cost usually stacks materials, labour hours times your labour rate, subcontractors, equipment, and some share of overhead. The markup and margin formulas do not care what the lines are called. They care what total you decide is "cost" and what price you charge above it.
Leave a cost out and the margin on paper looks healthier than the job was. A common version of that mistake is marking up materials and forgetting that labour has a cost too, or treating overhead as something the year will absorb. Overhead is still a cost. If you recover it as a percentage of the other lines, say so, and keep that percentage out of the profit margin so you do not count it twice.
A labour rate prices an hour. A margin prices the whole job after the lines are added. Do not use one percentage as if it were the other. If you round the final price, run the margin formula on the rounded figure. None of the percentages above is a target. Pick a margin from your own costs, then convert it with the division.