About this tool
Margin and markup both describe the profit on a sale, but they divide it by different numbers. Gross margin compares profit with the selling price, while markup compares it with the cost. Mixing them up is a common pricing mistake: a 50% markup is only a 33.3% margin. This calculator converts between them and finds the selling price for a target margin or markup.
How it works
Choose which two values you know: cost and selling price, cost and a target margin, cost and a markup, or selling price and a target margin. Enter them per item in one currency and select Calculate.
The calculator returns the cost, selling price, gross profit, gross margin and markup together, so you can see both percentages for the same price. Use the price-and-margin option to find the most you can pay for an item and still reach your target margin.
Example
An item costs 60 and sells for 100. The gross profit is 40, so the margin is and the markup is .
To reach a 40% margin on an item that costs 60, the price must be . Applying a 40% markup instead gives only , which is a margin of about 28.6%.
Assumptions and limits
The calculator works with gross margin on a single item: cost means the direct cost of the item, not overheads, shipping, payment fees or taxes unless you include them. Margins of 100% or more are impossible because they would require a zero cost. Sales tax or VAT should be excluded from the selling price.
Frequently asked questions
What is the difference between margin and markup?
Margin is profit divided by the selling price; markup is profit divided by the cost. For the same sale the markup is always larger than the margin when there is a profit.
How do I convert markup to margin?
Use with both as decimals. A 50% markup is margin. To go the other way, use .
How do I calculate a selling price from a desired margin?
Divide the cost by one minus the margin: . For a cost of 60 and a 25% margin the price is .
Can margin be negative?
Yes. If the selling price is below cost, the profit is negative and so are both margin and markup, which shows the item is sold at a loss.
What is a good profit margin?
It varies widely by industry. Grocery retailers may work with gross margins of 20% to 30%, while software and luxury goods can exceed 70%. Compare with businesses like yours and make sure the margin covers your operating costs.
Link with your values
Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.
| Parameter | Value | If omitted |
|---|---|---|
modeKnown values | one of: cost_price, cost_margin, cost_markup, price_margin | default cost_price |
costCost per item | amount without a currency symbol; allowed ≥ 0; used with mode = cost_price, cost_margin, cost_markup | required |
priceSelling price per item | amount without a currency symbol; allowed ≥ 0; used with mode = cost_price, price_margin | required |
margin_pctGross margin | percent: 6.5 means 6.5%; used with mode = cost_margin, price_margin | required |
markup_pctMarkup | percent: 6.5 means 6.5%; used with mode = cost_markup | required |
Examples
?cost=42&price=70?cost=60&margin_pct=35?cost=18.5&markup_pct=120?price=249&margin_pct=45
Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.
Result elements: [data-result-block="margin_markup_calculator"]