Enter what one unit costs you and what you sell it for, and this calculator returns your gross profit margin as a percentage, along with the profit per unit and the equivalent markup. Sellers use it to check pricing, compare products and make sure a discount will not wipe out their profit.
How to use the Profit Margin calculator
- Enter Unit cost: everything you pay to get one unit ready to sell, such as purchase price, materials, inbound shipping and packaging.
- Enter Selling price: the price the customer pays for one unit, before sales tax.
- Read the margin percentage as the main result, and check the detail line for the profit per unit and the markup percentage.
- Try a few selling prices to see how the margin moves before you commit to one.
How the profit margin calculation works
Margin is measured against price
Gross margin is the profit as a share of the selling price: (price − cost) ÷ price × 100. Because it divides by price, a margin can never reach 100% unless the cost is zero. A product that costs $18.50 and sells for $29.99 leaves $11.49 of profit, which is 38.31% of the price.
Markup is the same profit divided by cost instead, so it is always the larger number for a profitable item. That $11.49 is 62.11% of the $18.50 cost. Mixing the two up is one of the most common pricing errors: a seller who wants a 40% margin and adds 40% to cost ends up with only 28.57%.
A negative result means the price is below cost. The calculator allows it so you can see the size of a loss on a clearance item.
What a unit margin does not show
This is a per-unit gross margin. It does not include rent, wages for staff who are not making the product, advertising or software, which are operating expenses. A healthy gross margin can still produce a net loss if overhead is high, so use the net profit calculator for the whole business.
Platform and payment fees are easy to leave out. If a marketplace takes a percentage of each sale, either add that fee to Unit cost or reduce the selling price by it before entering.
Checking a discount
Discounts come straight out of margin. On the $29.99 item, a 20% discount lowers the price to $23.99 and the profit to $5.49, so the margin falls from 38.31% to 22.88% and profit per unit more than halves. Rerun the calculator with the discounted price to see the effect before launching a sale.
Worked example
Unit cost: 18.50 · Selling price: 29.99
- Profit per unit: $29.99 − $18.50 = $11.49.
- Margin: 11.49 ÷ 29.99 = 0.38312771, or 38.312771%.
- Markup (shown in the detail): 11.49 ÷ 18.50 = 0.62108108, or 62.108108%.
Result: 38.312771%
Assumptions and limits
Unit-level gross margin; taxes, overhead and operating expenses excluded. Losses are allowed. Zero cost has undefined markup. Display currency only.
Formula and worked examples last checked November 20, 2026. Spotted a problem? Report an error.
Frequently asked questions
What is a good profit margin?
It depends heavily on the industry. Grocery and fuel retailers work with thin gross margins and high volume, while software and many services have high gross margins but large overheads. Compare yourself with businesses in your own sector and with your own past results rather than a single number.
How do I calculate the price for a target margin?
Divide cost by (1 − target margin). For a 40% margin on a $30 cost, the price is 30 ÷ 0.60 = $50. Check it here: (50 − 30) ÷ 50 = 40%.
Is a 50% margin the same as a 100% markup?
Yes. Doubling the cost gives a 100% markup, and the profit then equals half of the selling price, which is a 50% margin.
Should the selling price include sales tax or VAT?
No. Tax collected from customers is passed on to the government and is not your revenue, so enter the price before tax.
What is the difference between gross margin and net margin?
Gross margin subtracts only the direct cost of the product. Net margin subtracts every expense, including overhead, interest and tax, and divides by revenue. Net margin is always lower for a business with overhead.