Margin Calculator Formula
Understand the math behind the margin calculator. Each variable explained with a worked example.
Formulas Used
Profit
profit = selling_price - costProfit Margin
margin_percent = selling_price > 0 ? (selling_price - cost) / selling_price * 100 : 0Markup
markup_percent = cost > 0 ? (selling_price - cost) / cost * 100 : 0Variables
| Variable | Description | Default |
|---|---|---|
cost | Cost(USD) | 45 |
selling_price | Selling Price(USD) | 75 |
How It Works
Profit Margin Formula
Margin% = (Selling Price - Cost) / Selling Price × 100
Markup% = (Selling Price - Cost) / Cost × 100
Worked Example
A product costs $45 and sells for $75.
cost = 45selling_price = 75
- 01Profit = $75 - $45 = $30
- 02Margin = $30 / $75 = 40%
- 03Markup = $30 / $45 = 66.7%
Ready to run the numbers?
Open Margin Calculator