Margin Calculator
Calculate the sale price needed to hit a target gross margin, plus the resulting dollar profit. Enter item cost and target margin percentage — margin (profit / sale price) is not the same as markup (profit / cost).
How It's Calculated
Formula
\text{Sale Price} = \frac{\text{Cost}}{1 - \text{Margin Rate}}\\ \text{Profit} = \text{Sale Price} - \text{Cost}Margin and markup are both ways of describing the same profit dollar amount, but they divide it by two different numbers — and mixing them up leads to real pricing errors. Margin is profit divided by SALE PRICE: (Sale Price − Cost) / Sale Price. Markup is profit divided by COST: (Sale Price − Cost) / Cost. Take a $40 cost item sold for $50: the $10 profit is a 20% margin ($10 / $50) but a 25% markup ($10 / $40) — same dollars, same item, different percentages, because the denominator is different. This calculator solves for margin: give it a cost and a target gross margin percentage, and it returns the sale price required to hit that margin (Sale Price = Cost / (1 − Margin Rate)) along with the resulting dollar profit. Because margin is bounded by sale price rather than cost, a target margin of 100% or higher is mathematically undefined — it would require dividing by zero or a negative number. Margin only approaches 100% as sale price approaches infinity; it can never reach or exceed 100% for any finite price. Always confirm which ratio a source is quoting before using a percentage to set a price — margin and markup numbers are not interchangeable.
Worked Examples
Standard case: $60 cost, 40% target margin
- Convert the target margin to a decimal fraction: r = 40 / 100 = 0.40
- Solve for sale price: Sale Price = Cost / (1 − r) = 60 / (1 − 0.40) = 60 / 0.60 = $100.00
- Profit = Sale Price − Cost = 100.00 − 60.00 = $40.00
- Check: profit / sale price = 40 / 100 = 40% margin, confirming the target
High-margin case: $30 cost, 90% target margin
- Convert the target margin to a decimal fraction: r = 90 / 100 = 0.90
- Solve for sale price: Sale Price = Cost / (1 − r) = 30 / (1 − 0.90) = 30 / 0.10 = $300.00
- Profit = Sale Price − Cost = 300.00 − 30.00 = $270.00
- Check: profit / sale price = 270 / 300 = 90% margin, confirming the target — note how much higher the sale price must climb as the target margin approaches 100%
Frequently Asked Questions
What's the difference between margin and markup?
Margin is profit divided by SALE PRICE: (Sale Price − Cost) / Sale Price. Markup is profit divided by COST: (Sale Price − Cost) / Cost. For a $40 cost item sold at $50, the $10 profit is a 20% margin (10/50) but a 25% markup (10/40) — the same dollars produce two different percentages because the denominator differs. This calculator computes margin, not markup; if you have a target markup instead, you'll need a markup calculator, because plugging a markup percentage into this margin formula will produce the wrong sale price.
Why doesn't a 100% margin work?
This calculator's formula is Sale Price = Cost / (1 − Margin Rate). At exactly 100% margin, the margin rate is 1.0, making the denominator (1 − 1.0) = 0 — division by zero, which is undefined. Above 100%, the denominator goes negative, producing a nonsensical negative sale price. Mathematically, margin can only approach 100% as sale price approaches infinity; it can never actually reach or exceed 100% for any finite price, no matter how high you set the price relative to cost.
What happens if I enter a margin of exactly 100% or higher?
The calculator does not silently cap your input or return a misleading zero — it explicitly tells you the calculation is undefined and leaves the sale price and profit fields blank (shown as "—") rather than showing a fabricated number. Lower your target margin below 100% to get a result.
Can the target margin be 0%?
Yes — 0% is a valid boundary, not an error. At 0% target margin, the sale price equals the cost exactly, and the resulting profit is $0. That's a legitimate answer: you're pricing at break-even with no gross profit built in.
Does this calculator account for taxes, fees, or other selling costs?
No. This calculator solves the pure margin formula using only the unit/production cost you enter. It does not add payment processing fees, marketplace commissions, shipping, sales tax, or overhead — if those apply to your business, factor them into your cost input or adjust the resulting sale price separately.