How the calculation works
Margin price = cost ÷ (1 − margin / 100)
Markup price = cost × (1 + markup / 100)
Prices round upward to the next cent, so the requested percentage is a minimum. Realized percentages reflect that rounded price and can be slightly higher. At zero cost and zero price, both ratios are undefined; the tool displays a dash.
A $10,000 cost at a 30% margin needs a $14,285.72 price. A 30% markup produces $13,000 and only a 23.08% margin.