margincalculator.fyi

The formulas, demystified.

Margin and markup are easy to confuse. Here's how each one works, with a worked example.

Profit margin

Margin tells you what share of every dollar of revenue ends up as profit. It's always relative to the selling price.
margin % = (revenue − cost) / revenue × 100
Example: Revenue $100, cost $70 → margin = 30 / 100 = 30%.

Markup

Markup is the same profit, but expressed relative to cost. A 50% markup is only a 33.3% margin — they are not the same number.
markup % = (revenue − cost) / cost × 100
Example: Cost $70, revenue $100 → markup = 30 / 70 ≈ 42.86%.

Selling price from markup

Use this when you know what cost you paid and the markup you want to apply.
price = cost × (1 + markup% / 100)
Example: Cost $40 with 25% markup → price = 40 × 1.25 = $50.

Discount

Discounts are simple percent-off the original price.
final = original × (1 − discount% / 100)
Example: $200 with 30% off → 200 × 0.70 = $140 (save $60).

VAT / sales tax — adding

Use when your listed price is exclusive of tax.
gross = net × (1 + rate / 100)
Example: $100 net at 20% VAT → gross = $120 (tax $20).

VAT / sales tax — removing

Use when your total includes tax and you need to extract the net.
net = gross / (1 + rate / 100)
Example: $120 gross at 20% VAT → net ≈ $100 (tax $20).