Start with the denominator.
Markup measures the difference between selling price and cost as a percentage of cost. Gross margin measures that same difference as a percentage of selling price. Shopify explains the distinction in its margin and markup guide.
Price for a markup: cost × (1 + markup rate)
Price for a target margin: cost ÷ (1 − margin rate)
Resulting margin: (price − cost) ÷ price
Use decimal rates in the formulas: 40% is 0.40. The target-margin formula assumes a positive cost and a margin below 100%. These examples exclude sales tax and use only the stated product cost; they do not calculate net profit after operating expenses.
Work through one supplier increase.
Suppose a fictional item used to cost $12.00 and sold for $20.00. Its gross margin was 40%. The new supplier cost is $13.50. Here is what three different instructions produce, before rounding.
| Instruction | Selling price | Gross margin |
|---|---|---|
| Keep the old selling price | $20.00 | 32.50% |
| Apply a 40% markup | $18.90 | 28.57% |
| Maintain a 40% margin | $22.50 | 40.00% |
For the target margin, $13.50 ÷ 0.60 gives $22.50. That is a $2.50 increase over the old selling price. The 40% markup gives $13.50 × 1.40 = $18.90, which would actually lower the old selling price. A change log makes that difference easy to spot before import.
Recheck the margin after rounding.
Rounding a calculated $22.50 price down to $21.99 produces about 38.61% margin at a $13.50 cost. Rounding up to $22.99 produces about 41.28%. If 40% is a minimum, the lower price fails the rule.
Specify “round up to the next price ending in .99” if that is your intention. “Round to .99” does not state the direction. Decide whether a maximum price, a margin floor, or a price ending takes priority when those rules conflict.
Turn the calculation into a usable brief.
Example pricing instruction
For confirmed SKU matches, use the new USD unit purchase cost excluding sales tax. Target a 40% margin on that cost, then round upward to the next .99 price. Flag any selling-price decrease or increase above 15% for approval. Hold rows with missing or zero costs. Leave compare-at prices unchanged and flag any sale-price conflicts.
This is an illustrative rule, not a recommended margin or approval threshold for every store. At $22.99, the example price rises 14.95% from $20.00, so it sits below that particular 15% threshold.
Agree whether freight, duties, packaging, or other costs belong in your cost basis before calculating. If they are excluded, the resulting percentage does not account for them. Use a consistent currency and tax basis across the comparison.
Source and calculation notes
Shopify: markup versus margin, checked on 16 October 2026. The supplier-change scenario, prices, and approval rule on this page are original illustrative examples from VariantDesk. Percentages in the comparison are rounded to two decimal places.