Most cost-plus pricing advice tells you to mark your cost up by some percentage and call it a day. The problem is that markup and margin measure profit against two different numbers — cost versus price — so a markup that feels generous can quietly deliver a margin that's thinner than you think. This calculator flips the math around: tell it your unit cost and the profit margin you actually want to keep, and it solves for the price that gets you there.
How it works
Enter your unit cost — what it really costs you to produce or deliver one unit, all-in — and a target margin, the share of the final selling price you want to walk away with as profit. The calculator solves price = unitCost / (1 − targetMarginPercent / 100), dividing by one minus the margin instead of simply adding a percentage on top. That division is the whole trick: it forces the margin to land on the selling price, not on the cost, which is what "margin" actually means.
From there it's arithmetic. Profit per unit is the price minus your cost. Markup percent — shown alongside the margin so you can see both — is that profit expressed as a percentage of cost instead of price, which is almost always a bigger number for the same dollar amount of profit. A target margin of 100% or higher isn't allowed: it would mean the entire price is profit and none of it covers your cost, which the formula can't solve without dividing by zero.
Worked example
Say a unit costs you $50 to produce, and you want to keep a 40% margin on every sale.
- Price: $50 ÷ (1 − 0.40) = $50 ÷ 0.60 = $83.33
- Profit per unit: $83.33 − $50 = $33.33
- Equivalent markup: $33.33 ÷ $50 × 100 = 66.66%
Notice the gap: a 40% margin required a 66.66% markup on cost, not a 40% markup. If you'd instead just marked the $50 cost up by 40% — the mistake this calculator exists to prevent — you'd have priced at $70 and walked away with a 28.57% margin, not the 40% you were aiming for. That's $13.33 of profit per unit left on the table, invisible until you actually do the margin math.
How to interpret your result
The price is your target: what to charge so that, after covering your unit cost, the profit left over is exactly the margin percentage you asked for — not close to it, not "roughly," exactly. If you're currently pricing by guesswork or by a markup rule of thumb, compare your actual selling price to what this calculator says you should charge at your desired margin; a gap in either direction tells you whether you're overcharging relative to your own goal or, more often, undercharging without realizing it.
The equivalent markup figure is there so you can translate between the two systems. If a competitor, supplier, or pricing template talks in markup percentages, this is the number that describes your exact same price and cost, converted to their language — useful for comparing apples to apples without accidentally treating a markup target as if it were a margin target.
Margin compounds the way any percentage-of-revenue metric does: shave a few points off it across hundreds of units and the difference between a comfortable margin and a break-even one adds up fast. Revisit your target margin whenever your unit cost changes — a cost increase that doesn't get reflected in a repriced number quietly erodes the margin you thought you'd locked in.
Methodology & sources
The formula: price = unitCost / (1 − targetMarginPercent / 100); profitPerUnit = price − unitCost; markupPercent = unitCost > 0 ? (profitPerUnit / unitCost) × 100 : 0. All three outputs round from unrounded intermediate math, and the calculator rejects a target margin at or above 100% since that would require dividing by zero.
Solving for price from a target margin — rather than simply adding a markup on top of cost — is standard pricing math, and Harvest's guide on how to calculate selling price from margin walks through the identical formula and the same margin-versus-markup distinction this tool is built around. If you're used to pricing by markup, the short version worth remembering is: markup on cost always undershoots a margin target of the same percentage, and the gap widens the higher the target gets.