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 : 0

Profit

profit = revenue - cost

Markup

markup_pct = cost > 0 ? ((revenue - cost) / cost) * 100 : 0

Variables

VariableDescriptionDefault
revenueRevenue (Selling Price)(USD)100
costCost(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
  1. 01Profit = $100 - $60 = $40
  2. 02Margin = ($40 / $100) x 100 = 40%
  3. 03Markup = ($40 / $60) x 100 = 66.67%

Ready to run the numbers?

Open Margin Calculator