How to Calculate Profit Margin: Margin vs Markup, a Conversion Table and an E-commerce Example
How to calculate profit margin: formula, worked example, margin vs markup with a conversion table, pricing from a target margin, discounts and break-even ROAS.
TL;DR — Summary
- Profit margin is profit divided by selling price: Margin = (Price − Cost) / Price × 100. A product sold for $100 that costs $55 has a 45% margin.
- Markup is profit divided by cost: $45 / $55 = 81.8%. The two are often confused; a 50% markup is only a 33.3% margin. Convert with Margin = Markup / (1 + Markup) and Markup = Margin / (1 − Margin).
- To price from a target margin, divide cost by (1 − target margin): a $60 cost and 40% target margin give $60 / 0.60 = $100. 'Add 40% to cost' ($84) leaves only a 28.6% margin.
- In e-commerce the margin that drives decisions is contribution margin: the same product keeps 31% after shipping, payment fees, packaging and returns, so break-even ROAS = 1 / 0.31 ≈ 3.23. A 20% discount cuts gross margin from 45% to 31.25%, and you need 80% more unit sales to keep the same gross profit.
How do you calculate profit margin? (Short answer)
Profit margin shows how many dollars of every $100 in sales you keep as profit. Formula: Profit margin (%) = (Selling price − Cost) / Selling price × 100.
Example: if you sell a product for $100 and buy it for $55, profit per unit is $45 and the margin is $45 / $100 = 45%. The same formula works on totals: $50,000 of monthly sales with $27,500 cost of goods sold is also a 45% gross margin. (All figures are illustrative.)
Which costs you subtract decides which margin you get: product cost only gives gross margin, adding per-order variable costs gives contribution margin, and adding operating expenses gives operating margin. Below I show all of them on one product.
What's the difference between margin and markup?
Margin divides profit by selling price; markup divides profit by cost. The same $45 profit is 45% of the $100 price and 81.8% of the $55 cost. Both are correct but answer different questions: markup asks 'how much did I add to cost?', margin asks 'how much of the sale did I keep?'
Mixing them up is expensive: if a supplier means markup when they say '50% profit' and your budget assumes a 50% margin, you actually keep only a third of each sale. Advertising and pricing math (break-even ROAS, max CPA, discount decisions) always uses margin on selling price.
- Profit margin = Profit / Selling price
- Markup = Profit / Cost
- Markup to margin: Margin = Markup / (1 + Markup) → 50% markup = 0.5 / 1.5 = 33.3% margin
- Margin to markup: Markup = Margin / (1 − Margin) → 40% margin = 0.4 / 0.6 = 66.7% markup
- Margin can never reach 100%; markup easily exceeds 100%
Markup to margin conversion table
Common markups and their margin equivalents are below. Supplier price lists and wholesale talks use markup; financial reports and ad math use margin. Use the table to translate between the two.
- 25% markup = 20% margin
- 33.3% markup = 25% margin
- 50% markup = 33.3% margin
- 66.7% markup = 40% margin
- 100% markup (selling at 2× cost) = 50% margin
- 150% markup = 60% margin
- 200% markup (selling at 3× cost) = 66.7% margin
How do you set a price from a target profit margin?
From target margin to price: Selling price = Cost / (1 − Target margin). For a product costing $60 with a 40% target margin, the price is $60 / 0.60 = $100; profit $40, margin $40 / $100 = 40%.
The most common mistake is adding the target percentage to cost: $60 × 1.40 = $84. At that price profit is $24 and margin is $24 / $84 = 28.6%, about 11 points below target. When setting campaign, wholesale or marketplace prices, apply the formula after adding every variable cost to the product cost.
Gross, contribution, operating and net margin: four margins on one product
'Profit margin' isn't a single number; you stop at different steps of a ladder depending on which costs you subtract. Example product: price $100, product cost $55; per order shipping $7, payment fee $3, packaging $1.50, returns allowance $2.50; ad cost per order $12; the store gets 1,000 orders a month and has $15,000 of monthly operating expenses such as rent, salaries and software ($15 per order).
Gross margin (45%) shows pricing and sourcing power; contribution margin (31%) shows what each order leaves for ads and fixed costs. After ads 19% remains, and after operating expenses operating margin falls to 4%. Many stores look at gross margin, call themselves profitable and lose money further down the ladder. Net margin is what remains after items such as financing costs are also deducted; I don't go into that calculation here.
- Gross margin = ($100 − $55) / $100 = 45%
- Contribution margin = ($100 − $55 − $7 − $3 − $1.50 − $2.50) / $100 = $31 / $100 = 31%
- Contribution after ads = ($31 − $12) / $100 = 19%
- Operating margin = ($19 − $15) / $100 = 4%
How do you calculate profit margin on a marketplace?
On a marketplace, commission and shipping come out of the selling price, so the gap between gross and contribution margin widens. Say you sell the same product on a marketplace for $100 with an example 20% commission and $9 shipping: $100 − $55 − $20 − $9 = $16 contribution, a 16% contribution margin, about half of the 31% on your own store.
Shipping cost depends on dimensional weight; shaving a few centimetres off the box can change the chargeable weight and therefore your margin. Commission rates vary by category, so check the current rate in the marketplace's seller panel. You can work out net profit per order after commission, shipping, returns and ads with the marketplace profit calculator, and chargeable weight with the dimensional weight calculator.
How does a discount affect profit margin?
A discount comes straight off margin but cuts profit much harder. On the $100 product costing $55, a 20% discount makes the price $80: gross profit falls from $45 to $25 (−44%), and gross margin drops from 45% to 31.25%.
Sales lift needed to keep the same total gross profit: Required sales multiple = Margin / (Margin − Discount). Here 0.45 / (0.45 − 0.20) = 1.8, so you need to sell 80% more units. As the discount approaches the margin the multiple explodes; a 40% discount needs 9× the sales. Since contribution margin is lower than gross margin, running this check on contribution margin is safer during promotions.
How profit margin links to ROAS: break-even ROAS
What you can spend on ads without losing money is capped by contribution margin. Break-even ROAS = 1 / Contribution margin. With a 31% contribution margin, break-even ROAS is 1 / 0.31 ≈ 3.23: at most $31 of ad spend per $100 of sales.
The example's $12 ad cost per order equals a ROAS of $100 / $12 ≈ 8.3, comfortably above break-even. A discount that drops contribution margin from 31% to 20% pushes break-even ROAS to 5; if you don't update the target in your ad platform, the campaign brings revenue while losing money. You can see break-even and target ROAS together with the ROAS calculator.
How do you calculate profit margin in Excel?
With selling price in column B and cost in column C, type =(B2-C2)/B2 into D2 and format it as a percentage. For markup use =(B2-C2)/C2; for price from a target margin (target in E2) use =C2/(1-E2).
Adding shipping, commission and returns as separate cost columns and calculating contribution margin shows at a glance which products can carry advertising. A total margin hides the average of profitable and unprofitable products; make decisions per product or category.
What profit margin should you aim for?
There's no one-size-fits-all number; the right question is 'does my margin carry my costs?' Minimum contribution margin must cover ad cost per order plus operating cost per order. In the example that's $12 + $15 = $27, or 27% of sales; a 31% contribution margin clears it by only 4 points.
There are four ways to raise margin: raise the price, lower product cost (supplier, order quantity), lower per-order variable costs (box size, return rate, payment fees) and grow basket size (fixed per-order items such as shipping become a smaller share of a bigger basket). The contribution margin ladder shows which one will move fastest.
Frequently Asked Questions
What is the profit margin formula?
Is margin the same as markup?
How do I price a product for a 30% margin?
What's the difference between gross and net profit margin?
What does a negative profit margin mean?
Resources & Related Reading
- What Is Dropshipping? Profit Math Including Returns
- Discount Calculator: Sale Price and Profit Impact
- Trendyol Commission Rates 2026 & How to Calculate Fees
- Gross Profit Margin Calculator
- Net Profit Margin Calculator
- ROAS Calculator (break-even ROAS)
- Marketplace Profit Calculator
- Shipping Cost Calculator
- Dimensional Weight Calculator
- What Is ROAS and How to Calculate It
- How to Set Target ROAS in Google Ads
- Black Friday 2026 Ad Plan
- What Is CAC? Customer Acquisition Cost Explained
- Penn State Extension: What's the difference between markup and profit? ↗
Digital marketing specialist building websites, performance ad programs and B2B lead generation systems for B2B and e-commerce brands.
Connect on LinkedIn ↗Last updated: