Margin Calculator Formula
Understand the math behind the margin calculator. Each variable explained with a worked example.
Formulas Used
Profit Margin
margin_pct = revenue > 0 ? ((revenue - cost) / revenue) * 100 : 0Profit
profit = revenue - costMarkup
markup_pct = cost > 0 ? ((revenue - cost) / cost) * 100 : 0Variables
| Variable | Description | Default |
|---|---|---|
revenue | Revenue (Selling Price)(USD) | 100 |
cost | Cost(USD) | 60 |
How It Works
How to Calculate Profit Margin
Formula
Margin % = [(Revenue - Cost) / Revenue] x 100
Profit margin tells you what percentage of each dollar in revenue is actual profit. It is one of the most important metrics for evaluating business health.
Worked Example
A product sells for $100 and costs $60.
revenue = 100cost = 60
- 01Profit = $100 - $60 = $40
- 02Margin = ($40 / $100) x 100 = 40%
- 03Markup = ($40 / $60) x 100 = 66.67%
Ready to run the numbers?
Open Margin Calculator