Margin calculator: profit margin and gross margin
This margin calculator shows your profit margin and gross margin from what an item cost and what you sell it for. Switch modes to find the selling price for a target margin or the cost that fits a price and margin, and add fees and other costs to see your net margin.
- Gross margin, net margin and markup from cost and price
- Selling price for a target margin, or cost from price and margin
- Fees as a % of the price plus other costs per sale
Last updated
How to use the margin calculator
- Pick what you want to find: your margin on a price you already charge, the price that gives the margin you want, or the cost that fits a price and a margin.
- Enter the cost. For one item, use what you paid plus anything spent to get it ready. For a whole business, use cost of goods sold.
- Enter the selling price (or total revenue), or the target margin.
- If a platform or card processor keeps a share of each sale, enter that percentage under fees. Add any fixed cost per sale, such as a shipping label or packaging, under other costs. Leave both at 0 to see gross margin.
- Read the margin or price, the profit in dollars, the gross margin and the matching markup.
The profit margin and gross margin formulas
Profit margin is profit as a share of the selling price. Gross margin is the same formula using only the cost of goods sold: revenue minus cost of goods sold, divided by revenue. Net margin also takes away fees and other costs.
gross margin = (price − cost) ÷ price
net margin = (price − cost − fees − other costs) ÷ price
To find the price for a target margin, divide the cost (plus any fixed costs) by one minus the margin. If fees are a share of the price, take them away too. To find the cost that fits a price and a margin, work the other way.
price = (cost + other costs) ÷ (1 − margin − fee rate)
cost = price × (1 − margin − fee rate) − other costs
Markup uses the same profit but divides by cost: markup = (price − cost) ÷ cost. That is why a 60% markup is only a 37.5% margin.
Worked example
You buy an item for $20 and sell it for $32.
- Profit: $32 − $20 = $12.00.
- Margin: $12 ÷ $32 = 0.375, or 37.5%. With no fees or other costs, this is also the gross margin.
- Markup: $12 ÷ $20 = 60%.
Now say the place you sell keeps 15% of the price and you spend $2 on packaging. The fee is $32 × 0.15 = $4.80, profit drops to $32 − $20 − $4.80 − $2 = $5.20, and the net margin is $5.20 ÷ $32 = 16.3%. The gross margin is still 37.5%. To get back to a 40% net margin with that fee and packaging, price at ($20 + $2) ÷ (1 − 0.40 − 0.15) = $48.89.
How do you calculate profit margin?
Subtract the cost from the selling price, divide the result by the selling price, and multiply by 100. An item that costs $20 and sells for $32 leaves $12 of profit, and $12 ÷ $32 = 37.5%. For gross margin on a whole business, use total revenue and cost of goods sold for the same period in place of price and cost.
Margin can never reach 100%, because that would need a cost of zero. If your cost is higher than the price, the margin is negative: you lose money on each sale.
What is the difference between gross margin and net margin?
Gross margin counts only what the goods cost you. Net margin also subtracts selling fees and other costs of making the sale. On a $32 sale of a $20 item, the gross margin is 37.5% ($12 profit). If a platform takes 15% ($4.80) and packaging costs $2, the net profit is $5.20 and the net margin is 16.3%.
| $32 sale, $20 cost | Amount | Margin |
|---|---|---|
| Gross profit ($32 − $20) | $12.00 | 37.5% |
| Less 15% selling fee | −$4.80 | |
| Less packaging | −$2.00 | |
| Net profit | $5.20 | 16.3% |
Use the “Fees as a % of price” and “Other costs per sale” boxes above to see both numbers at once: the main result is the net margin and the gross margin sits in the grid beneath it. A business with overhead such as rent and software would take those away as well to reach its true net margin.
What is the difference between margin and markup?
Margin divides profit by the selling price; markup divides the same profit by the cost. So the margin is always the smaller number. Buying at $20 and selling at $32 is a 37.5% margin and a 60% markup. Mixing them up is a common pricing mistake: adding a 40% markup gives only a 28.6% margin.
| Margin | Markup | Price for a $20 cost | Profit on $20 cost |
|---|---|---|---|
| 10% | 11.1% | $22.22 | $2.22 |
| 20% | 25.0% | $25.00 | $5.00 |
| 25% | 33.3% | $26.67 | $6.67 |
| 30% | 42.9% | $28.57 | $8.57 |
| 40% | 66.7% | $33.33 | $13.33 |
| 50% | 100.0% | $40.00 | $20.00 |
Going the other way, a 25% markup is a 20.0% margin, a 50% markup is 33.3%, and a 100% markup is 50.0%. To price from a markup instead, use the markup calculator.
How do fees change your margin?
A fee charged as a share of the price comes straight off your margin, point for point. A 37.5% margin with a 15% selling fee becomes 22.5%. Fixed per-order fees hurt cheap items most: a $0.30 fee is 3% of a $10 sale but 0.3% of a $100 sale.
For exact fees on a real sale, use the eBay, Depop, Poshmark, PayPal, Stripe or Square fee calculators, then bring the fee percentage back here. The links under the result open the markup, break-even and eBay fee calculators with your price and cost already filled in. Planning a sale price? The discount calculator shows how much margin a markdown costs.
How do you calculate margin in Excel or Google Sheets?
Put the cost in A2 and the selling price in B2, then type =(B2-A2)/B2 in C2 and format the cell as a percentage. With $20 and $32 it returns 37.5%. Google Sheets uses the same formulas. Use the table below for the other conversions, with the margin or markup typed as a percentage in the cell shown.
| What you want | Formula | Result for the example |
|---|---|---|
| Margin from cost A2 and price B2 | =(B2-A2)/B2 | 37.5% |
| Markup from cost A2 and price B2 | =(B2-A2)/A2 | 60% |
| Price from cost A2 and margin C2 (40%) | =A2/(1-C2) | $33.33 |
| Cost from price B2 and margin C2 (40%) | =B2*(1-C2) | $19.20 (on $32) |
| Markup from margin C2 (40%) | =C2/(1-C2) | 66.7% |
| Margin from markup D2 (60%) | =D2/(1+D2) | 37.5% |
| Net margin with fee rate E2 (15%) and other costs F2 ($2) | =(B2-A2-B2*E2-F2)/B2 | 16.3% |
Common questions
What is a 40% margin on a $20 cost?
A selling price of $33.33. Divide the cost by one minus the margin: $20 ÷ 0.60 = $33.33. The profit is $13.33, which is 40% of the price and a 66.7% markup on cost.
Is gross margin the same as profit margin?
Gross margin counts only the cost of the goods you sold. Net profit margin also takes away fees, shipping supplies and overhead such as rent and software. With $10,000 of sales and $6,000 of goods, gross margin is 40% even if overhead brings net margin lower.
How do I find the selling price from cost and margin?
Divide the cost by one minus the margin as a decimal. A $45 cost at a 25% margin is $45 ÷ 0.75 = $60. In the calculator, pick “A selling price” and enter the cost and the margin.
How do I find the cost from the price and margin?
Multiply the price by one minus the margin. To sell at $60 and keep a 25% margin, the cost has to be $60 × 0.75 = $45. Pick “A cost” in the calculator to do this, with fees and other costs taken off as well.
Can profit margin be more than 100%?
No. Margin is profit divided by price, and profit can never be bigger than the price. Markup has no limit: a $5 item sold for $20 has a 300% markup but a 75% margin.
How do I convert markup to margin?
Divide the markup by one plus the markup. A 50% markup is 0.50 ÷ 1.50 = 33.3% margin. To go back, divide the margin by one minus the margin: 33.3% ÷ 66.7% = 50%.
What price gives me a 30% margin after eBay fees?
For a $20 item with free shipping and no tax in a category with the standard 13.6% + $0.40 fee, list at $36.17. The fee is $5.32 and the profit is $10.85, which is 30.0% of $36.17. Enter 13.6% as fees and $0.40 as other costs to check it.
Guides that use this calculator
Related calculators
- Markup calculatorSelling price from cost and markup or margin, or both from a price
- Percentage increase calculatorPercent change between two numbers, a price after a raise, the original before a raise, or yearly growth
- Commission calculatorFlat or tiered sales commission, the rate you earned, or the sale needed for a target
- Break-even calculatorUnits and sales needed to cover your costs, and contribution margin
- eBay fee calculatorSeller fees by category, payout, profit and the price for a target profit
- Etsy fee calculatorListing, transaction, processing and Offsite Ads fees, for physical and digital products, plus profit