Markup is profit as a percentage of what the product cost you. Margin is profit as a percentage of the price the customer pays. They describe the same dollars, so the margin percentage is always the smaller of the two. A 50% markup gives you only a 33.3% margin, and a 100% markup gives you a 50% margin.
That gap matters when you set prices. If you want a 40% margin and add 40% to cost, your price ends up 16% too low. This guide gives you the formulas, a conversion table you can price from, a version that includes payment fees, and a discount table that shows how many extra sales a sale has to bring in before it pays for itself.
The two formulas, with one $20 product
Take a product that costs you $20 and sells for $30. The profit is $10 either way. What changes is the number you divide by.
Profit per unit Price minus cost $10.00
Markup (Price minus cost) / cost $10 / $20 = 50%
Margin (Price minus cost) / price $10 / $30 = 33.3%
Price from a markup Cost x (1 + markup) $20 x 1.5 = $30
Price from a margin Cost / (1 minus margin) $20 / 0.667 = $30
Markup follows the OpenStax Contemporary Mathematics definition (markup equals percent markup times cost). Margin follows the formula Shopify uses on the product details page.Both formulas come from primary references. OpenStax’s Contemporary Mathematics textbook defines markup as the increase over the retailer’s cost and gives retail price as cost plus markup. Shopify’s Help Center calculates margin on the product details page as (price minus cost) divided by price, times 100, with the example of a $50 price and $30 cost giving 40%.
To switch between them:
- Margin from markup: markup / (1 + markup). A 50% markup is 0.5 / 1.5 = 33.3%.
- Markup from margin: margin / (1 minus margin). A 40% margin is 0.4 / 0.6 = 66.7%.
Margin can never reach 100%, because that would mean the product cost nothing. Markup has no ceiling. A $5 item sold at $25 has a 400% markup and an 80% margin.
Markup to margin conversion table
Use this table to price from the margin you want. Find your target margin, then multiply your cost by the multiplier. The last column shows the price for a product that costs you $10.
20% 25% 1.25 $12.50
30% 42.9% 1.429 $14.29
40% 66.7% 1.667 $16.67
50% 100% 2.0 $20.00
60% 150% 2.5 $25.00
70% 233.3% 3.333 $33.33
75% 300% 4.0 $40.00
Exact conversions, calculated two ways in python (formula and price-from-cost check). No assumptions.Two rows are worth remembering. Doubling your cost (a 100% markup, which retailers often call keystone pricing) gives a 50% margin. Tripling it gives 66.7%. Everything between follows the curve in the chart below, which flattens as markup rises. Each extra point of margin takes more and more markup.
Margin rises quickly at low markups and then flattens. A 300% markup still only reaches a 75% margin.
The most common pricing mistake: using your target margin as a markup
Say you decide your store needs a 40% margin. You take a $20 product, add 40%, and list it at $28. Your margin is not 40%. It is $8 / $28, or 28.6%. The price that delivers 40% is $20 / 0.6, which is $33.33.
There is a neat shortcut for how far off you are. If you apply a target margin of X as a markup, your price comes out short of the correct price by exactly X squared. A 40% target gives a price 16% too low (0.4 x 0.4). A 50% target gives a price 25% too low.
20% $24.00 16.7% $25.00 4% $1.00
30% $26.00 23.1% $28.57 9% $2.57
40% $28.00 28.6% $33.33 16% $5.33
50% $30.00 33.3% $40.00 25% $10.00
60% $32.00 37.5% $50.00 36% $18.00
Shortfall = 1 minus (wrong price / correct price), which simplifies to the target margin squared. Checked with exact fractions in python.On 1,000 units of the $20 product with a 40% target, the mistake leaves $5,333.33 of gross profit on the table, assuming you would sell the same number at either price. That assumption is generous to the higher price, so treat the figure as an upper bound. The point is that the error grows fast. At low targets it is a rounding problem. At a 50% or 60% target it can wipe out a large share of your gross profit.
The fix is simple: decide which number your spreadsheet column holds, label it, and always price with cost / (1 minus margin) when you start from a margin target.
What Shopify shows you, and where
Checked October 22, 2026. In your Shopify admin, open Products, select a product, and find the Price section on the product details page. Shopify’s Help Center describes three fields that matter here:
- Price is what you charge the customer.
- Compare-at price displays the original price next to the price when you lower it.
- Cost per item is what the product costs you. For resold goods, Shopify says to enter the amount paid to the manufacturer, without taxes, shipping or other costs. For goods you make, base it on labor and materials. The field is optional, and you can fill it in bulk with the bulk editor or a CSV import.
When cost per item is filled in, Shopify displays projected Profit and Margin in the Price section. That margin is calculated from the Price field. If you mark a product down and keep the old price as the compare-at price, the margin you see is the margin on the new, lower price.
Shopify does not show a markup figure there. If your supplier sheet or wholesale agreement talks in markup, convert it with the table above before you compare it with what Shopify shows.
The profit reports work differently. Shopify’s Help Center says the product page margin uses full price, while the Gross margin in profit reports is based on net sales after discounts and refunds. Its own example: a $20 T-shirt with a $10 cost shows a 50% margin on the product page, but 33% in the Gross profit by product report if it sold at $15 during a 25% discount. Profit is reported only for variants that had a cost recorded when they sold, and cost per item is static data, so update it when your supplier price changes. Our guide to gross margin, contribution margin and net profit walks through those reports in more detail.
Pricing for a margin after payment fees
The margin Shopify shows on the product page is a gross margin: price minus product cost. Every card payment also costs you a fee, and that fee is a percentage of the price plus a fixed amount. If you want your target margin to survive the fee, build it into the formula:
Price = (cost + fixed fee) / (1 minus target margin minus percentage fee)
On Shopify’s US Basic plan with Shopify Payments, the standard online card rate was 2.9% plus 30 cents when we checked on October 22, 2026. Stripe’s standard US online rate is also 2.9% plus 30 cents for domestic cards. For the $20 product and a 40% target:
$33.33 (40% gross margin) $1.27 $12.06 36.2%
$35.55 (fee-aware price) $1.33 $14.22 40.0%
Hypothetical $20 product. Fee rounded to the cent. Formula result and a per-price recalculation agree in python.The fee takes almost four points of margin on this product. On cheaper items the fixed 30 cents hurts more, because it is a bigger share of a small price. Fees can also be higher than the standard rate. Shopify’s US pricing page lists a premium card rate of 3.5% plus 30 cents on Basic and adds 1% for international cards. Stripe adds 1.5% for international cards and 1% when currency conversion is needed. If you use a payment provider other than Shopify Payments, Shopify charges its own third-party transaction fee on top: 2% on Basic, 1% on Grow and 0.6% on Advanced. Our Shopify fees explained guide lists the rest.
You can extend the same formula to shipping and packaging if you pay those per order. Add them to cost in the top line. Once you do, you are pricing for contribution margin rather than gross margin, which is the number that decides what return on ad spend you need to break even.
How discounts change the maths
A discount comes off the price, but your cost stays the same. So the discount comes entirely out of your profit, and your margin falls faster than the discount percentage suggests. The margin after a discount is:
New margin = (old margin minus discount) / (1 minus discount)
A product with a 50% margin sold at 20% off has a 37.5% margin. To make the same total gross profit as before, you need to sell more units:
Extra units needed = discount / (old margin minus discount)
30% +50% +100% +200% +500% No volume is enough
40% +33.3% +60% +100% +166.7% +300%
50% +25% +42.9% +66.7% +100% +150%
60% +20% +33.3% +50% +71.4% +100%
70% +16.7% +27.3% +40% +55.6% +75%
Extra unit sales needed to match gross profit at full price. Product cost only. Checked by formula and by counting units one at a time from a 100-unit base; results agree after rounding up to whole units.
The lower your margin, the more a discount has to lift sales just to stand still.
Read across the 40% row. A 20% sale has to double your unit sales before it makes the same gross profit as full price. A 30% sale has to quadruple them. At a 30% margin, a 30% discount means you are selling at cost, and no amount of volume brings the profit back.
These numbers are the best case, because they count product cost only. Payment fees fall slightly with a lower price, but shipping, packaging and pick-and-pack time do not fall at all. Once you include those, the extra volume you need is higher still. If your sale includes free shipping, check it against your free shipping threshold too.
Getting back to full price after a markdown
Discounts and markups also do not cancel out. If you take 25% off a $40 product, it sells for $30. Adding 25% back gets you to $37.50, not $40. To return to the original price you need a markup of discount / (1 minus discount), which is 33.3% for a 25% markdown. This is the same conversion as margin to markup, applied to the price drop.
Stacked markups: wholesale and retail
If you sell both to shops and to consumers, each layer adds its own markup, and they multiply. Suppose your cost is $10, your wholesale price is $20 (100% markup, 50% margin for you) and the shop doubles it to $40 for its own 50% margin. Your retail price on your own store should usually match the shop’s $40, or you undercut your stockists. On your own sales at $40 your margin is 75%, which is a 300% markup on cost. Wholesale is where your margin is thinnest, so do that calculation first and set retail from it.
Common mistakes
- Mixing the two numbers in one sheet. A supplier quotes markup, your accountant reports margin, and the column header just says “%”. Label every column.
- Using a target margin as a markup. Your price comes out short by the target squared, as the table above shows.
- Leaving cost per item blank in Shopify. Without it, the product page shows no margin and the profit reports skip those sales.
- Letting cost per item go stale. Shopify treats it as static. A supplier increase you never entered makes every margin look better than it is.
- Judging a sale by revenue. Revenue can rise while gross profit falls. Use the discount table before you run the promotion.
- Forgetting fees on low-priced items. A fixed 30 cents is 3% of a $10 order on its own, before the percentage fee.
- Ignoring refunds. A refunded order can still cost you money; see whether you get fees back when you refund a Shopify order.
What you should check next
- Export your products and confirm every active variant has a current cost per item.
- For your ten best sellers, calculate margin with the product page formula and compare it with the margin you thought you were pricing for.
- Recalculate prices that were set as “cost plus X%” when X was meant to be a margin.
- Add payment fees to the formula for any product under about $25, where the fixed fee takes the biggest share.
- Before your next promotion, look up your margin and discount in the discount table and decide whether the sales lift you need is realistic.
Frequently asked questions
Is a 50% markup the same as a 50% margin?
No. A 50% markup on a $20 cost gives a $30 price and a 33.3% margin. A 50% margin needs a $40 price, which is a 100% markup.
Which is better to use, markup or margin?
Use margin to judge profitability and compare products, because it is what Shopify’s product page and profit reports show and it relates directly to revenue. Markup is handy for quick pricing from cost. Just convert before you compare the two.
What margin should an online store aim for?
There is no single right number. It depends on what each order costs you after the product: shipping, packaging, fees, returns and advertising. Work out those costs per order first, then pick the gross margin that leaves enough to cover them.
Does Shopify include payment fees in the margin it shows?
The Help Center describes the product page margin as (price minus cost) / price, with cost being what you enter as cost per item. It does not mention payment fees, so add them yourself with the fee-aware formula above.
Can markup be more than 100%?
Yes. Markup has no upper limit, because it is measured against cost. Margin cannot reach 100%, because it is measured against price.
The takeaway
Markup is measured on cost and margin on price, so margin is always the smaller number. Price from your target margin with cost / (1 minus margin), add fees to the formula when they matter, and check the discount table before every sale. Those three habits stop most pricing mistakes before they reach your store.
Sources
- OpenStax, Contemporary Mathematics, section 6.2, “Discounts, Markups, and Sales Tax” (markup definition, retail price formula), checked October 22, 2026. openstax.org
- Shopify Help Center, “Product details page” (price, compare-at price, cost per item, projected profit and margin formula), checked October 22, 2026. help.shopify.com
- Shopify Help Center, “Profit reports” (gross margin on net sales, static cost per item, missing cost data, $20 T-shirt discount example), checked October 22, 2026. help.shopify.com
- Shopify, Pricing (US plan card rates, premium and international rates, third-party transaction fees), checked October 22, 2026. shopify.com/pricing
- Stripe, Pricing (US domestic card rate, international card and currency conversion surcharges), checked October 22, 2026. stripe.com/pricing
Last reviewed: October 22, 2026. The formulas do not change; the payment fee rates are the published US figures on that date.
How this article was made: researched and drafted with AI assistance, with every factual claim checked against the sources above. The $20 product, the 1,000-unit example and the stacked wholesale prices are hypothetical illustrations; the conversion and discount tables are exact calculations with no assumptions beyond product cost.
Related guides
- Gross margin vs contribution margin vs net profit for online stores
- What ROAS do you need to break even?
- Free shipping threshold: how to set it without losing margin
- Can you sell online without keeping inventory?
