Margin Calculator
Convert between cost, selling price, gross margin and markup, or find the price that delivers a target margin or markup.
Updated Formula covered by automated tests
Margin and markup describe the same dollar profit from two different starting points, and mixing them up is one of the most common pricing errors in small retail and e-commerce businesses. Markup measures profit against what an item cost you; margin measures it against what the customer pays. This tool works in three directions: enter a cost and a selling price to see both percentages, enter a cost and a target margin to get the price you need to charge, or enter a cost and a markup to see what margin that markup really delivers.
Shop owners use it when setting shelf prices, wholesalers use it when a retailer asks for a keystone (100%) markup, and freelancers use it to price materials passed through to clients. Accountants and lenders almost always talk in gross margin, because it lines up with the revenue figure at the top of an income statement, so it helps to know your prices in both terms.
The formula
- Cost
- What one unit costs you to buy or make, in dollars (cost of goods sold per unit)
- Price
- What the customer pays for one unit, before sales tax
- Margin
- Gross profit as a percentage of the selling price; always below 100%
- Markup
- Gross profit as a percentage of cost; can be any positive number, including above 100%
Both percentages share the same numerator, the dollar profit, and differ only in the denominator. Because the price is always larger than the cost when you make a profit, the margin is always the smaller number. They convert directly: markup = margin ÷ (1 − margin) and margin = markup ÷ (1 + markup), using decimals.
Working backwards from a target margin needs division, not multiplication. If you want 40% of the price to be profit, cost must be the other 60% of the price, so price = cost ÷ 0.60. Multiplying cost by 1.40 instead answers a different question (a 40% markup) and leaves you short of the target.
Worked example
Lena makes soy candles that cost her $12.00 each in wax, wicks, jars and labels. She wants a 40% gross margin to cover her market stall fees and her time.
- 1 Price for a 40% margin: 12.00 ÷ (1 − 0.40) = 12.00 ÷ 0.60 = $20.00.
- 2 Profit per candle: 20.00 − 12.00 = $8.00. Check the margin: 8.00 ÷ 20.00 = 40%.
- 3 The equivalent markup: 8.00 ÷ 12.00 = 66.7%.
- 4 The common mistake, adding 40% to cost: 12.00 × 1.40 = $16.80, profit $4.80, margin only 4.80 ÷ 16.80 = 28.6%.
Result: Lena should price her candles at $20.00, a 66.7% markup. Pricing at $16.80 would earn her $3.20 less per candle than she planned.
Before you rely on the result
- Works on a single unit with one cost. Bundles, volume discounts, returns and spoilage change the real margin and are not modelled.
- Prices here exclude sales tax or VAT; add tax after choosing a pre-tax price. For business pricing decisions with tax or financing consequences, an accountant can check the full picture.
Frequently asked questions
What markup gives me a 50% margin?
A 100% markup, often called keystone pricing in retail: double the cost and half the selling price is profit. Other useful pairs are a 25% margin from a 33.3% markup and a 33.3% margin from a 50% markup.
Can a margin ever be 100% or more?
No. A 100% margin would mean the item cost nothing, so the formula would need an infinite price. Markup has no such ceiling: an item bought for $5 and sold for $20 has a 300% markup but a 75% margin.
Is this my net profit margin?
No, it is the gross margin on one item. Net margin subtracts rent, wages, marketing, payment fees, shipping and taxes as well, so a product with a healthy 50% gross margin can still leave a business with a single-digit net margin.
Should payment processing and marketplace fees go into the cost?
If they are charged per sale, including them gives a more honest per-unit picture. Marketplace fees are usually a percentage of the price, though, so the cleaner approach is to set the price first and then subtract the fee as part of the profit check.