How to Calculate Profit Margin and Markup

Step-by-step method to calculate profit margin, gross margin, and markup from cost and price, or to reverse-calculate the selling price needed for a target margin.

  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 if you know the margin you want, Max cost for margin if you know the price and margin, or Product margin (fees) if you are selling through a marketplace and need to account for the full cost stack.
  2. 2. Enter your 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 cost and price. Remember: margin is profit ÷ price, markup is profit ÷ cost, and markup is always higher than margin for the same transaction. The calculator also writes out a plain-English note explaining the difference for your numbers.
  4. 4. Add fees, shipping, and ads for product margin: If you sell on a marketplace or pay for ads, switch to Product margin (fees) mode and enter every cost that comes off the top: marketplace fee (percentage and flat), payment processing fee, shipping, packaging, advertising per unit, and expected returns. The calculator shows both the gross margin and the adjusted margin after all of those costs, which is the number that actually reflects what the product earns.
  5. 5. Review the calculation steps and chart: Every mode shows a step-by-step breakdown so you can see exactly how the answer was reached, plus a small chart that visualises the cost-versus-profit split (or the full fee stack, in product mode). Switch currencies at the top of the form to see the analysis in your local currency, or use Share to send the result to someone else.

What Is Profit Margin?

Profit margin is the percentage of every sale that stays with you as profit, once the cost of the thing you sold has been paid for. It is the single number that answers the question every seller asks: out of every dollar that comes in, how many cents do I actually keep?

If you sell a product for $100 and it costs you $60 to buy or make, you keep $40. That $40 is your gross profit, and as a share of the selling price it is a 40% profit margin. This profit margin calculator is built around that simple relationship — cost, price, profit, margin — and then extends it to cover everything else that eats into what you keep: shipping, marketplace fees, payment processing, ads, returns, and business-level expenses like rent, salaries, interest, and taxes.

Profit Margin Formula

The core profit margin formula is straightforward:

Profit Margin = (Selling Price − Cost) ÷ Selling Price × 100

Equivalently, you can think of it as Gross Profit ÷ Revenue × 100, which is the same thing written differently. Both forms show up in textbooks; they always give the same answer, and this calculator displays the result either way.

Some people prefer to work with margin cost — the cost implied by a target margin on a given price. Rearranging the formula gives Cost = Price × (1 − Margin). If you want a 40% margin on a $100 sale, your cost has to stay at or below $60. That is what the "Max cost for margin" mode of this calculator is for: it tells you the ceiling your cost can hit before the margin you want stops being achievable.

Margin vs Markup — the Distinction That Trips Everyone Up

Margin and markup are the two most confused numbers in pricing, and mixing them up is the fastest way to underprice a product and not notice until the end of the quarter.

  • 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.

Same transaction, two different percentages. A 50% markup on cost is only a 33.33% margin on price — a fact that has quietly wrecked the pricing of many otherwise well-run businesses. This calculator always shows both numbers side by side so you can see exactly how they relate for your specific cost and price, and the Target markup → price mode exists so you can work from either end without having to do the algebra by hand.

Gross Margin Formula and Gross Profit Margin Formula

When people say "gross margin" or "gross profit margin," they mean the same thing: profit calculated using only the direct cost of goods sold (COGS), before subtracting operating expenses. The gross margin formula is:

Gross Margin = (Revenue − COGS) ÷ Revenue × 100

The gross profit margin formula is identical — "gross margin" and "gross profit margin" are interchangeable terms, and the gp margin formula is just a shorthand some people use for the same equation. If you see "gp profit" written somewhere, that is gross profit — revenue minus COGS — the dollar figure that the margin 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. Mixing them in produces a number that looks like gross margin but is not one, and it makes comparisons across products or periods meaningless.

How to Calculate Gross Margin

Figuring gross margin from a single product is the easiest case:

  1. Start with the selling price (revenue per unit).
  2. Subtract the cost of goods sold per unit — what you paid for the item itself, landed at your door.
  3. Divide the result by the selling price.
  4. Multiply by 100 to express it as a percentage.

For a whole business or product line, do the same thing with totals: total revenue minus total COGS, divided by total revenue. This is figuring gross margin at scale, and it is the calculation that tells you whether your core product economics are healthy before any operating costs are layered on top.

Figuring profit margin at the business level is subtly different: once you subtract operating expenses, interest, and taxes from gross profit, you get net profit, and dividing that by revenue gives net margin. That is the number that shows up at the bottom of an income statement, and it is the number that ultimately determines whether the business is sustainable.

Gross vs Operating vs Net Margin

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

MarginWhat it subtractsWhat it tells you
Gross marginRevenue − COGSAre the core product economics viable?
Operating marginGross profit − operating expenses (rent, salaries, marketing)Does the business cover its day-to-day costs?
Net marginOperating profit − interest − taxesWhat actually ends up as profit?

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 this business margin calculator mode shows all three side by side — a single margin number in isolation rarely tells the whole story.

How to Find the Right Selling Price for a Target Margin

Working backward from a target margin is one of the most useful things a margin calculator can do, and it is surprisingly 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.

The same logic works for a price margin calculator workflow where you already know the price and want to know the implied margin, or for a cost margin calculator workflow where you know the margin and want to find the maximum cost you can afford. All three directions are supported here.

Product Margin Calculator: Fees, Shipping, Ads, and Returns

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 per order.
  • Payment processing — what Stripe, PayPal, or a card processor charges to move the money, 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, which is a real cost even when the item is restocked.

Once you subtract all of those from net revenue (the price after any discount), you get adjusted margin — the percentage that actually reflects what the product 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 mode of this calculator lets you enter every one of those costs and see the adjusted margin instantly.

Discount Impact: Why Small Discounts Hurt More Than They Look

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.

This is why this calculator has a dedicated Discount impact mode: it isolates the effect of a discount from all other costs, so you can see exactly how much margin you are giving away before you commit to a promotion.

Common Margin Calculation Mistakes

  • Confusing margin and markup. They are two different percentages on the same transaction. A 50% markup is a 33.33% margin, not 50%.
  • Adding margin to cost instead of dividing. Price is cost ÷ (1 − margin), not cost × (1 + margin). The two give very different answers.
  • Ignoring fees and shipping. A 40% gross margin can easily become 15% after marketplace, payment, shipping, and ad costs.
  • Mixing gross and net. Gross margin uses only COGS. If you include rent and salaries, you are calculating operating or net margin, not gross.
  • Forgetting that discounts cut both revenue and margin. A discount is not just a lower price — it is a lower margin on the same cost.
  • Comparing margins across businesses without context. A 20% margin can be excellent in grocery and terrible in software; industry context always matters.

What Counts as a Good Margin?

There is no universal answer, because "good" depends on the industry, the business model, and the volume. As a rough guide for orientation only:

  • Grocery and high-volume retail: single-digit to low-double-digit gross margins are normal.
  • General e-commerce and consumer goods: 20% to 50% gross margin is common.
  • Software, digital products, and services: 70% to 90% gross margin is typical, because there is almost no per-unit cost.
  • Luxury and specialty: 60%+ gross margin is often expected.

The more useful question is not "is my margin good?" but "is my margin improving, and is it high enough to cover my operating costs and still leave a profit?" A margin that looks fine in isolation can still be too thin for the business model it sits inside.

Margin, Markup, and the Earning Margin Concept

Some people describe margin as the earning margin — the share of revenue the business actually earns as profit. That framing is fine as long as it is applied consistently: earnings divided by revenue, not earnings divided by cost. Once cost enters the denominator, you have switched to markup, and the number changes.

What matters is consistency. Pick one definition, apply it across every product and every period, and compare like with like. Margin, markup, gross, operating, and net are all legitimate ways to measure profitability — but only if you know which one you are looking at.

Frequently Asked Questions

Q: What is profit margin?

Profit margin is the percentage of the selling price that 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.

Q: How do I calculate profit margin?

Use the profit margin formula: Margin = (Price − Cost) ÷ Price × 100. Enter your cost and selling price in the Basic mode and the calculator works it out instantly. For a target-margin workflow where you know the margin you want and need to find the right price, use Target margin → price instead.

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: What is gross margin?

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

Q: What is the gross margin formula?

Gross margin = (Revenue − COGS) ÷ 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.

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 for you automatically.

Q: What is margin cost?

Margin cost is the maximum cost you can afford on a given selling price to still hit a target margin. It is calculated as Cost = Price × (1 − Margin). The Max cost for margin mode shows this number directly, so you know the ceiling your landed cost can reach before the margin you want becomes impossible.

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. Once all of those are subtracted, you get the adjusted margin — the percentage the product actually earns after the real-world costs of selling it. For most sellers this is 10 to 20 points lower than the headline gross margin.

Q: What is a business margin calculator?

A business margin calculator works from period totals — total revenue, total COGS, total operating expenses, interest, and taxes — to show gross margin, operating margin, and net margin side by side. It is the right tool when you want to see how a whole business or product line is performing, rather than pricing a single product.

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 from a 10% discount. The Discount impact mode isolates this effect so you can see exactly what a promotion costs you.

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 and consumer goods typically land at 20% to 50%. Software and digital products commonly run 70% to 90% gross margins 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: 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 looking at all three side by side is far more informative than looking at any one alone.

Q: Why is my markup higher than my margin?

Because markup is calculated against a smaller number. 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. For example, 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: Why is my cost percentage of revenue important?

Cost % of revenue is simply 100 minus your margin, expressed from the cost side. If your margin is 40%, your cost is 60% of revenue. Tracking cost as a percentage of revenue is useful when comparing products of different price points, or when monitoring whether your supplier costs are creeping up over time relative to what you charge.

Q: Does this calculator support multiple currencies?

Yes. You can enter and display values in US Dollar, Euro, British Pound, Indian Rupee, Canadian Dollar, Australian Dollar, Japanese Yen, UAE Dirham, or Singapore Dollar. Every margin, markup, and percentage is currency-independent since it is a ratio, so switching currencies does not change the underlying analysis — only the symbol shown next to the money values.

Q: What is the earning margin?

Earning margin is another name for profit margin — the share of revenue the business actually earns as profit. It is the same calculation as margin (profit ÷ revenue), just described differently. As long as the denominator is revenue and not cost, it is the same number; once you divide by cost instead, you are calculating markup.

Q: How do I figure out the maximum cost I can pay for a product?

Use the Max cost for margin mode. Enter the selling price you plan to charge and the margin percentage you want, and the calculator returns the maximum cost you can pay. The formula is Cost = Price × (1 − Margin). If you are negotiating with a supplier, this is the ceiling you cannot go above without breaking your margin target.

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. This is useful for planning ahead when you expect supplier costs to rise, or for stress-testing your pricing against a range of cost scenarios.

Q: Why does gross margin exclude operating expenses?

Because gross margin is meant to isolate the economics of the product itself. Rent, salaries, and marketing are business-level costs that apply regardless of which product you sell, so including them would make it impossible to compare products to each other on a like-for-like basis. Operating and net margins are the right tools for evaluating the whole business.

Loaded shared calculation