Key takeaways
- Margin = (price − cost) ÷ price; markup = (price − cost) ÷ cost. Same profit, different base.
- Margin can never reach 100%, while markup has no upper limit; a 100% markup is a 50% margin.
- To hit a target margin, price = cost ÷ (1 − margin), not cost × (1 + margin).
- A discount comes straight out of profit: on a 60% margin product, 25% off cuts profit per unit by 41.7%.
- Your margin percentage is the deepest discount you can give before a sale loses money on product cost alone.
What is the difference between margin and markup?
Margin and markup describe the same profit from two directions. Margin divides gross profit by the selling price, so it tells you how much of every sale you keep. Markup divides gross profit by the cost, so it tells you how much you added on top of what you paid.
With the numbers from the intro, a $50 price and a $30 cost leave $20 of gross profit. As a share of the $50 price, that is a 40% margin. As a share of the $30 cost, it is a 66.7% markup. Neither number is wrong. They answer different questions, and mixing them up is how stores end up with prices that look healthy on paper and thin in the bank account.
| Metric | Formula | Example: $30 cost, $50 price |
|---|---|---|
| Gross profit | Price − cost | $50 − $30 = $20 |
| Margin % | (Price − cost) ÷ price × 100 | 20 ÷ 50 = 40% |
| Markup % | (Price − cost) ÷ cost × 100 | 20 ÷ 30 = 66.7% |
| Price from a markup | Cost × (1 + markup %) | 30 × 1.667 = $50 |
| Price from a target margin | Cost ÷ (1 − margin %) | 30 ÷ 0.60 = $50 |
| Margin from markup | Markup ÷ (1 + markup) | 0.667 ÷ 1.667 = 40% |
| Markup from margin | Margin ÷ (1 − margin) | 0.40 ÷ 0.60 = 66.7% |
How do you calculate profit margin?
Subtract the cost from the price, divide by the price and multiply by 100. A product that sells for $40 and costs you $16 makes $24 of gross profit, and 24 ÷ 40 = a 60% margin.
Shopify uses the same formula. When you enter a Cost per item on a product, Shopify calculates the margin as ([price − cost] ÷ price) × 100, and its own example is a $50 price with a $30 cost, which gives a 40% margin (Shopify Help Center). Filling in Cost per item for every product is the first step to knowing how far you can discount.
Be clear about which cost you mean. Gross margin subtracts the product cost only. Contribution margin also subtracts the variable costs of each order, such as shipping you pay, packaging and payment fees. With a hypothetical $2 of shipping and $1.50 of fees on that $40 order, the contribution is $40 − $16 − $2 − $1.50 = $20.50, a 51.25% contribution margin. For discount decisions, contribution margin is the more honest number.
- Find the cost per item, including what it took to get the product into stock, such as inbound freight and duties.
- Subtract the cost from the selling price to get gross profit.
- Divide gross profit by the selling price.
- Multiply by 100 to express the result as a percentage.
How do you calculate markup and set a price from it?
Divide gross profit by cost. The $16 product that sells for $40 has a markup of 24 ÷ 16 = 150%. To go the other way, multiply the cost by 1 plus the markup: $16 × 2.5 = $40.
Markup is convenient when you build prices from cost, for example when a supplier sends a price list and you apply the same markup to every line. A 100% markup, often called keystone pricing, doubles the cost: a $25 item sells for $50, which is a 50% margin.
If you work toward a target margin instead, divide the cost by 1 minus the margin. For a 40% margin on a $30 cost, the price is 30 ÷ 0.60 = $50. The margin calculator works in both directions and shows margin, markup and profit side by side.
How do you convert margin to markup?
Use markup = margin ÷ (1 − margin), and margin = markup ÷ (1 + markup). The table converts common targets and shows the price you would charge for an item that costs $20. The "price = cost ×" column is the multiplier you apply to any cost to reach that margin.
| Margin | Equivalent markup | Price = cost × | Price for a $20 cost |
|---|---|---|---|
| 10% | 11.1% | 1.111 | $22.22 |
| 20% | 25% | 1.25 | $25.00 |
| 25% | 33.3% | 1.333 | $26.67 |
| 30% | 42.9% | 1.429 | $28.57 |
| 33.3% | 50% | 1.5 | $30.00 |
| 40% | 66.7% | 1.667 | $33.33 |
| 50% | 100% | 2 | $40.00 |
| 60% | 150% | 2.5 | $50.00 |
| 70% | 233.3% | 3.333 | $66.67 |
| 75% | 300% | 4 | $80.00 |
| 80% | 400% | 5 | $100.00 |
Why is a 50% markup not a 50% margin?
Because the base is different. A 50% markup on a $20 cost gives a $30 price, and $10 of profit on a $30 price is a 33.3% margin. Margin is always the smaller of the two numbers, and it can never reach 100% unless the product costs nothing. Markup has no ceiling: a $5 item sold for $25 has a 400% markup and an 80% margin.
The classic pricing error follows from this. Suppose you want a 40% margin on a product that costs $30, and you add 40% to the cost. You get $42, and the margin is $12 ÷ $42 = 28.6%, well short of the target. The correct price is $30 ÷ 0.60 = $50. If your team sets prices from costs, agree on whether each target is a margin or a markup, and write it down.
How do discounts eat into your margin?
A discount comes entirely out of profit, because the cost doesn't change. The margin after a discount is (price × (1 − discount) − cost) ÷ (price × (1 − discount)), or more simply 1 − (1 − margin) ÷ (1 − discount). On the $40 product with a $16 cost, 25% off makes the price $30 and the profit $14: the margin falls from 60% to 46.7%, and profit per unit falls by 41.7%, even though the price fell by only 25%.
The table shows the same product at different discounts. Notice where the profit runs out: a 60% discount on a 60% margin product sells at cost. The discount calculator runs this check for any price, cost and discount.
| Discount | Sale price | Profit per unit | Margin | Profit lost vs full price |
|---|---|---|---|---|
| 0% | $40.00 | $24.00 | 60.0% | 0% |
| 10% | $36.00 | $20.00 | 55.6% | 16.7% |
| 20% | $32.00 | $16.00 | 50.0% | 33.3% |
| 25% | $30.00 | $14.00 | 46.7% | 41.7% |
| 30% | $28.00 | $12.00 | 42.9% | 50.0% |
| 40% | $24.00 | $8.00 | 33.3% | 66.7% |
| 50% | $20.00 | $4.00 | 20.0% | 83.3% |
| 60% | $16.00 | $0.00 | 0.0% | 100% |
Your margin percentage is the deepest discount you can offer before each sale loses money on product cost alone. Shipping, payment fees, returns and ad costs make the real limit lower, so set your floor from contribution margin.
Which should you use: margin or markup?
Use margin for decisions about discounts, expenses and profitability, because costs such as advertising, fees and shipping are also measured against revenue. If marketing takes 15% of revenue and your margin is 40%, you can see at a glance what is left. Use markup when you build prices from costs, such as applying a standard markup to a supplier's price list.
Whichever you use, label it. A spreadsheet column called "profit %" is a common source of confusion, because nobody can tell which base it uses. Shopify's product page calculates margin, not markup, so expressing your targets as margins keeps them comparable with what you see in the admin.
How do you protect margin when you run a sale?
Decide the floor before you decide the discount. Work out the contribution margin of each product group, choose the lowest margin you will accept during a sale, and only then pick the discount. Our guide on how much discount to offer turns that floor into a maximum discount and a break-even sales target.
Then make sure the discount lands only where the margin can carry it. With Sale Scheduler by SalePilot, you can target a sale by collection, product, variant or one advanced condition, such as a product tag or vendor, and add one exclusion type, for example excluding a low-margin collection. See product targeting for the options. The review screen shows every variant's price before and after the change, so you can check the deepest cuts against your floor before you start or schedule the sale.
- Enter a Cost per item in Shopify for every product you plan to discount.
- Group products by margin band, for example under 40%, 40% to 60%, and over 60%.
- Set a maximum discount for each band that keeps it above your floor.
- Tag or collect each band so you can target it, and exclude products that can't carry a discount.
- Preview the new prices, then schedule the sale with an end so full prices come back on time.