Margin vs markup: how to calculate each

By Sumwick · Reviewed · Published

Margin measures profit as a percentage of revenue. Markup measures profit as a percentage of cost. The profit dollars stay the same, but changing the denominator changes the percentage.

Calculate margin and markup

For a single sale, subtract included cost from selling price to find profit. Then divide by the relevant denominator:

Shopify's margin and markup explanation uses these different denominators. Keep the cost scope consistent when comparing results.

One sale, two percentages

In this illustrative example, an item costs $36.00 and sells for $60.00. Profit after that included cost is $24.00.

The item has a 40% margin and approximately 66.67% markup. Markup is larger here because cost is smaller than selling price. Enter your own revenue and costs in the Profit Margin Calculator.

Set a price for a target margin

Adding your target margin percentage to cost gives a markup instead. To find a price from a margin target, rearrange the margin equation:

Price = cost ÷ (1 − target margin ÷ 100).

With $36 cost and a 40% margin target, price = $36 ÷ 0.60 = $60.00. Adding 40% to cost instead gives $50.40, with only 28.57% margin.

Use the Product Pricing Calculator for a target-based estimate. It rounds the price upward to the next cent so cent rounding does not lower the achieved margin below the target. Your target is an input, not a recommended margin or a prediction of customer demand.

Convert between the percentages

For positive cost and price, these equations follow from the same profit formulas. Enter percentage numbers such as 40, rather than 0.40:

Illustrative positive-margin conversions
MarginEquivalent markup
25.00%33.33%
40.00%66.67%
50.00%100.00%

The table rounds percentages to two decimal places. Reusing a rounded percentage can slightly change a price; use the original cost and target margin for pricing.

What costs belong in the calculation?

The answer depends on what you want to measure. If you include only the product's cost of goods, the result describes gross profit on that scope. Including additional costs changes the result. Shopify's profit-report documentation illustrates why product cost information matters for gross-profit reporting.

A calculator cannot infer missing fees, shipping, returns, advertising, overhead or taxes. Use amounts for the same unit or reporting period. A result after selected costs is not automatically your business's net profit. Price-dependent fees require a separate model and are not added automatically by these tools.

Zero values and losses

With zero cost and positive revenue, margin is 100%, but percentage markup is undefined because its denominator is zero. With zero revenue, percentage margin is undefined; our margin calculator requires positive revenue. If included cost exceeds revenue, profit, margin and markup are negative.

A 100% margin target cannot produce a finite selling price with positive cost. Our pricing calculator supports targets through 99.99%, bounds amounts to $1 billion, and requires positive unit cost.

Review the assumptions alongside your results. For how we check formulas and sources, read our editorial policy.