How to Use the Margin Calculator

Enter cost and selling price to compute profit margin, markup, and cost percentage, or set a target margin to find the selling price. Add product fees, test discounts, or switch to business mode for gross, operating, and net margins.

  1. 1. Choose the mode that matches what you know: Pick the mode that fits your situation. Cost & price → margin if you already know both numbers. Target margin → price or Target markup → price if you know the margin you want. Max cost for margin if you know the price and margin. Product margin (fees) if you sell through a marketplace and need to account for the full cost stack.
  2. 2. Enter cost and selling price: In the Basic mode, enter the cost of the product (what you paid for it, landed) and the selling price (what you charge the customer). The calculator computes profit, margin, markup, and cost as a percentage of revenue — all four numbers update instantly as you type.
  3. 3. Read the margin and markup together: Margin and markup are shown side by side so you can see how they relate for your specific numbers. Margin is profit ÷ price, markup is profit ÷ cost, and markup is always higher than margin for the same transaction. A short note explains the difference using your actual numbers.
  4. 4. Test a target margin or maximum cost: If you know the margin you want, switch to Target margin → price and the calculator works backward to the price you need. If you already have a price and are negotiating with a supplier, use Max cost for margin to find the ceiling your cost can hit before the margin breaks.
  5. 5. Add product fees or a discount if needed: For real products, switch to Product margin (fees) and enter the fees that come off the top: marketplace fee, payment processing, shipping, packaging, advertising, and expected returns. The calculator shows both the gross margin and the adjusted margin after all of those costs. For a promotion, switch to Discount impact and enter the discount percentage.
  6. 6. Switch to Business mode for period-level margins: For a whole business or product line, use Business / period margins. Enter total revenue, total COGS, operating expenses, interest, and taxes. The calculator shows gross, operating, and net margin side by side, so you can see how the profit layers stack.

What Is Profit Margin?

Profit margin is the percentage of the selling price you keep as profit after subtracting the cost of the product or service you sold. If you sell for $100 and the cost is $60, your profit is $40 and your profit margin is 40% ($40 ÷ $100). Margin describes what share of revenue is profit. It is not the same as markup — the distinction matters and is covered further down the page.

Profit Margin Formula

Profit = Revenue − Cost

Profit Margin = Profit ÷ Revenue × 100

Cost % of Revenue = Cost ÷ Revenue × 100

For a single product with a clean cost and price, profit margin % + cost % = 100%. That identity breaks down once fees, discounts, or period-level expenses enter the picture, which is why the calculator shows the two figures separately.

Worked Example

Revenue $100, cost $60.

  • Profit = $100 − $60 = $40
  • Profit margin = $40 ÷ $100 × 100 = 40%
  • Markup = $40 ÷ $60 × 100 = 66.67%
  • Cost % of revenue = $60 ÷ $100 × 100 = 60%

The same sale is a 40% margin and a 66.67% markup. Both are correct — they describe the same $40 from two different bases.

Gross Margin Formula

Gross margin uses revenue minus cost of goods sold (COGS) — the direct cost of the product only, before operating expenses, interest, or taxes.

Gross Profit = Revenue − COGS

Gross Margin = Gross Profit ÷ Revenue × 100

If a product sells for $100 and its COGS is $60, gross margin is 40%. The gross profit margin formula and the gp margin formula are the same equation under different names — gross margin, gross profit margin, and gp margin all refer to the same calculation. If you see gp profit written somewhere, that is gross profit — the dollar figure the percentage describes.

What does not belong in gross margin: rent, salaries, marketing, interest, taxes. Those are operating and financing costs, and they belong in the business margin calculations further down this page.

Margin vs Markup

This is the single most common source of pricing errors, and it is worth being precise.

  • Margin = profit ÷ selling price. A $40 profit on a $100 sale is a 40% margin.
  • Markup = profit ÷ cost. The same $40 profit on a $60 cost is a 66.67% markup.

Because cost is a smaller number than price (assuming you are selling at a profit), markup is always the higher percentage for the same sale. A 50% markup on a $60 cost gives a $90 price, which is only a 33.33% margin. A 100% markup is a 50% margin. There is no way to make them equal — it is arithmetic, not convention.

To convert between them:

  • Margin = Markup ÷ (1 + Markup)
  • Markup = Margin ÷ (1 − Margin)

Percentages must be converted to decimals first. The Target markup → price mode handles this indirectly — it uses markup as the input and shows the resulting margin alongside.

Target Margin Pricing

Working backward from a target margin is one of the most useful things a margin calculator can do, and it is easy to get wrong by hand. The formula is:

Selling Price = Cost ÷ (1 − Target Margin)

If your cost is $60 and you want a 40% margin, the price is $60 ÷ 0.60 = $100. Note that you do not simply add 40% to cost — that would give $84, which is only a 28.57% margin on the resulting price. This is exactly the trap the Target margin → price mode exists to avoid.

Maximum Cost for a Target Margin

The reverse question is just as useful for negotiating with suppliers: what is the highest cost I can pay and still hit a target margin at a given price? The formula is:

Maximum Cost = Price × (1 − Target Margin)

If the price is $100 and you want a 40% margin, the maximum cost is $100 × 0.60 = $60. The Max cost for margin mode shows this number directly.

Product Margin With Fees and Discounts

Real products rarely sell at a clean price with no other costs attached. A product margin calculator has to account for everything that comes off the top before the seller sees any money:

  • Marketplace fee — what Amazon, eBay, Etsy, or a similar platform takes, often a percentage plus a small flat fee.
  • Payment processing — what Stripe, PayPal, or a card processor charges, again often percentage plus flat.
  • Shipping and packaging — the physical cost of getting the item to the buyer.
  • Advertising / customer acquisition cost — the per-unit share of ad spend it took to make the sale happen.
  • Returns and refunds — the percentage of orders that come back.

Once you subtract all of those from net revenue (the price after any discount), you get the adjusted margin — the percentage the product actually earns after the real-world costs of selling it. For many sellers this is 10 to 20 points lower than the headline gross margin, and it is the number that should drive pricing decisions. The Product margin (fees) mode lets you enter each of those costs and see the adjusted margin.

Discount Impact

A 10% discount does not reduce margin by 10% — it reduces it by much more, because the cost stays the same while the revenue drops. On a $100 product with a $60 cost (40% margin), a 10% discount brings revenue to $90, profit to $30, and margin to 33.33%. That is a 6.67-point drop in margin from a 10% discount. On a thinner-margin product, the same discount can wipe out the profit entirely.

The Discount impact mode isolates this effect so you can see exactly how much margin a promotion costs before you commit to it.

Gross vs Operating vs Net Margin

These three margins stack on top of each other, each subtracting a broader set of costs:

MarginWhat it subtracts
Gross marginRevenue − COGS
Operating marginGross profit − operating expenses (rent, salaries, marketing)
Net marginOperating profit − interest − taxes

A company with a healthy 50% gross margin can still have a negative net margin if its operating expenses are out of control. Conversely, a business with a modest 20% gross margin can be very profitable if it runs lean. That is why the Business margins mode shows all three side by side — a single margin number in isolation rarely tells the whole story.

Limitations

Margin alone does not determine business profitability. A product can have a healthy gross margin and still lose money once operating expenses, financing costs, and taxes are layered on top. Margin also tells you nothing about sales volume — a 5% margin on a million units beats a 50% margin on ten. Use this calculator as a pricing and per-unit profitability tool; the business mode gives the period-level view, but it does not replace a full P&L or cash-flow analysis.

Margin Calculator – Profit, Gross Margin, Markup & Pricing

Frequently Asked Questions

Q: What is profit margin?

Profit margin is the percentage of the selling price you keep as profit after subtracting the cost of the product or service sold. If you sell for $100 and the cost is $60, your profit is $40 and your profit margin is 40% ($40 ÷ $100). Margin describes what share of revenue is profit, not what share of cost.

Q: What is the profit margin formula?

Margin = (Price − Cost) ÷ Price × 100. Equivalently, Margin = Profit ÷ Revenue × 100. Enter your cost and selling price in the Basic mode and the calculator returns profit, margin, markup, and cost as a percentage of revenue all at once.

Q: What is gross margin?

Gross margin is revenue minus cost of goods sold (COGS), divided by revenue, expressed as a percentage. It includes only the direct cost of the product itself — not rent, salaries, marketing, interest, or taxes. Those belong in operating margin and net margin, which the Business mode shows side by side.

Q: What is the gross margin formula?

Gross margin = (Revenue − COGS) ÷ Revenue × 100. If a product sells for $100 with a COGS of $60, gross margin is 40%. The gross profit margin formula and the gp margin formula are the same equation under different names.

Q: What is the difference between margin and markup?

Margin is profit divided by selling price. Markup is profit divided by cost. A $40 profit on a $100 sale is a 40% margin. The same $40 profit on a $60 cost is a 66.67% markup. They describe the same transaction, but the percentages are very different — a 50% markup is only a 33.33% margin, which is why the two are so often confused.

Q: How do I calculate the selling price for a target margin?

Use the formula Price = Cost ÷ (1 − Margin). For a 40% margin on a $60 cost, the price is $60 ÷ 0.60 = $100. Note that you do not simply add 40% to cost — that would give $84, which is only a 28.57% margin. The Target margin → price mode does this calculation directly.

Q: How do I find the maximum cost I can pay to still hit a target margin?

Use the formula Cost = Price × (1 − Margin). At a $100 price with a 40% target margin, the maximum cost is $60. The Max cost for margin mode shows this ceiling directly, which is useful when negotiating with a supplier.

Q: How does a discount affect my margin?

A discount reduces revenue while the cost stays the same, so it cuts margin by more than the discount percentage suggests. On a $100 product with a $60 cost (40% margin), a 10% discount brings revenue to $90 and margin down to 33.33% — a 6.67-point drop. The Discount impact mode isolates this effect.

Q: What is a product margin calculator and why do I need one?

A product margin calculator goes beyond gross margin to include the real costs of selling a physical or digital product: marketplace fees, payment processing, shipping, packaging, advertising, and returns. What is left after all of those is the adjusted margin — the percentage the product actually earns after the real-world costs of selling it. For many sellers this is 10 to 20 points lower than the headline gross margin.

Q: What is the difference between gross, operating, and net margin?

Gross margin subtracts only COGS from revenue. Operating margin also subtracts operating expenses like rent, salaries, and marketing. Net margin subtracts everything, including interest and taxes. A business can have a healthy gross margin and a negative net margin if operating costs or debt are too high — which is why the Business mode shows all three side by side.

Q: Why is my markup higher than my margin?

Because markup divides profit by cost, and cost is always smaller than price (assuming you are selling at a profit). Margin divides the same profit by the larger price. So markup is always higher than margin for the same transaction — a 50% markup corresponds to a 33.33% margin, and a 100% markup corresponds to a 50% margin.

Q: Can profit margin be negative?

Yes. If your cost exceeds your selling price, you are selling at a loss and the margin is negative. A $100 price with a $120 cost gives a −20% margin. The calculator accepts negative margins and displays them clearly so you can see exactly how much you are losing per sale.

Q: What counts as a good profit margin?

It depends entirely on the industry. Grocery and high-volume retail often run single-digit to low-double-digit gross margins. General e-commerce typically lands at 20% to 50%. Software and digital products commonly run 70% to 90% because there is almost no per-unit cost. The more useful question is whether the margin is high enough to cover your operating costs and still leave a profit.

Q: Can I compare the effect of a cost increase on my pricing?

Yes. The Compare scenarios mode shows the current margin and the new selling price you would need to hold the same margin after a given cost increase. Useful for planning when you expect supplier costs to rise, or for stress-testing pricing against a range of cost scenarios.

Loaded shared calculation