Skip to content
TheCalcUniverse

Margin Calculator — Gross Margin, Markup, Cost & Price (Solve Any

Solve for Gross Margin %, Markup %, Cost, or Revenue — choose what you know and calculate what you need. Free, instant, and accurate.

✓ Tested formula & cited sources Formula verified 2026-05-17 Runs in your browser — inputs never sent anywhere

See it worked out

Example — Cost (Unit Cost / COGS) 50.00, Revenue (Selling Price) 90.00, Gross Margin (%) 44.44 %, Markup (%) 80.00 %:

Gross Margin (%)

44.4444%

Margin and markup answer different questions from the same numbers — margin is profit as a share of the selling price, markup is profit as a share of cost. A 50% markup is only a 33.3% margin, which is why the two get confused; always check which one a target or industry benchmark actually refers to.

Markup (%)

80%

Gross Profit (Revenue − Cost)

$40.00

Cost

$50.00

Revenue (Selling Price)

$90.00

Gross Margin (%)

44.4444%

Markup (%)

80%

Key: 50% Markup ≠ 50% Margin — at 50% markup, margin = 33.3%

Markup % ÷ (100 + Markup %) = Margin %

The formula

Margin % = (Revenue − Cost) ÷ Revenue × 100 | Markup % = (Revenue − Cost) ÷ Cost × 100

Margin %
Gross Profit Margin
Markup %
Markup Percentage
COGS
Cost of Goods Sold
Revenue
Selling Price
Gross Profit
Gross Profit (Dollars)

Worked example — Cost (Unit Cost / COGS) 50.00, Revenue (Selling Price) 90.00, Gross Margin (%) 44.44 %, Markup (%) 80.00 %

Gross Margin (%) = 44.4444%

Full explanation ↓

How Margin Calculator Works

Margin % = (Revenue − Cost) ÷ Revenue × 100 | Markup % = (Revenue − Cost) ÷ Cost × 100

Gross margin measures profit as a share of revenue (the selling price). Markup measures profit as a share of cost. These two percentages are mathematically related but are never equal unless profit is zero. The conversion formula is: Margin % = Markup % ÷ (100 + Markup %) and Markup % = Margin % ÷ (100 − Margin %).

Margin %
Gross Profit MarginProfit divided by revenue. Tells you what fraction of each dollar of sales is profit. A 40% margin means $0.40 of every $1.00 in revenue is gross profit.
Markup %
Markup PercentageProfit divided by cost. Tells you how much above cost you are pricing the item. An 80% markup means you charge 80% more than what the item costs you.
COGS
Cost of Goods SoldThe direct cost to produce or purchase one unit. Includes materials, manufacturing, and in e-commerce: product cost + inbound shipping.
Revenue
Selling PriceThe price the customer pays. In retail/e-commerce, this is the list price before any discounts or fees.
Gross Profit
Gross Profit (Dollars)Revenue minus COGS, expressed in dollars. This is the absolute profit before operating expenses. A 40% margin on a $100 item yields $40 of gross profit per unit.
Gross margin is the portion of revenue left after subtracting cost

How to Use

  1. Select what you want to solve for using the "Solve For" dropdown.
  2. To find your margin or markup: enter Cost and Revenue, then select Gross Margin or Markup.
  3. To find the right selling price: enter Cost and either your target Margin % or Markup %, then select Revenue.
  4. To find your allowable cost: enter Revenue and either your target Margin % or Markup %, then select Cost.
  5. All four results (cost, revenue, margin, markup) are shown together so you can see the full picture at once.

Quick Reference

25% Markup20% Margin
50% Markup33.3% Margin
100% Markup50% Margin
200% Markup66.7% Margin
300% Markup75% Margin
Margin → MarkupM% ÷ (100 − M%)
Markup → MarginMu% ÷ (100 + Mu%)
Price from Cost+MarkupCost × (1 + Mu%/100)
Ecom Healthy GM35-65% depending on category
Cost from Price+MarginPrice × (1 − M%/100)

Common Uses

  • Setting retail or wholesale prices by calculating the correct selling price from cost and your desired margin percentage
  • Avoiding costly pricing mistakes by understanding the difference between margin and markup when negotiating with buyers
  • Determining the maximum allowable product cost to hit a target margin at a given market selling price
  • Converting between margin and markup percentages for accurate financial reporting and pricing strategy decisions

Understanding the Result

The single most common mistake in retail and e-commerce pricing is treating margin and markup as the same number. They are not — and confusing them leads to systematic under-pricing that quietly destroys profitability. Here is the core math: if your cost is $50 and you apply a 50% markup, your price is $75 and your margin is 33.3% — not 50%. Why? Because margin is calculated on the selling price ($25 profit ÷ $75 = 33.3%), while markup is calculated on cost ($25 profit ÷ $50 = 50%). Same $25 profit, two completely different percentages. This matters most when communicating with buyers, wholesale partners, or platforms. A buyer might ask for "50% margin" and you quote "50% markup" — you have just accepted a deal that pays you far less than expected. Conversion formulas: Margin from Markup: Margin % = Markup % ÷ (100 + Markup %) Markup from Margin: Markup % = Margin % ÷ (100 − Margin %) Example: 80% markup → 80 ÷ 180 = 44.4% margin. 50% margin → 50 ÷ 50 = 100% markup. For e-commerce specifically, gross margin only tells part of the story. After platform fees (Amazon ~15%, Shopify payments ~2.9%), shipping, returns (~5-20% in apparel), and ad spend (often 20-40% of revenue as TACOS/ACOS), net margin is often 5-15% of what gross margin suggests. Always model your full P&L, not just your margin.

Worked Examples

Mike runs a furniture store and buys a dining table for $200 from his supplier. He wants to price it at 50% gross margin. He uses the "Solve for Revenue with Margin" mode to find the correct selling price.

solveFor = revenue · costInput = 200 · marginInput = 50

Selling price = $400.00, Gross Profit = $200.00, Margin = 50%, Markup = 100%

At 50% margin, Mike needs to sell the table for $400. Gross profit is $200 per table. If he mistakenly used 50% markup instead (a common error), he would price at $300 — that gives only 33.3% margin and $100 less profit per table. On 50 tables sold per quarter, that confusion costs $5,000 in lost profit. Mike now uses the calculator for every new product to ensure margins are calculated correctly.

Nadia sells skincare products on Amazon at $34.99. She needs a 35% margin minimum to be profitable after Amazon fees. She wants to know the maximum she can pay her supplier per unit.

solveFor = cost · revenueInput = 34.99 · marginInput = 35

Maximum allowable COGS = $22.74 per unit

Nadia's maximum allowable COGS is $34.99 × (1 − 0.35) = $22.74 per unit. She currently pays $24.50, which gives only 30% margin — below her 35% target. She negotiates with her supplier for a volume discount, getting cost down to $21.90 by committing to 2,000 units per order. This brings her margin to 37.4%, giving her a 2.4% buffer above her minimum threshold for seasonal price promotions.

A competitor analysis reveals that three similar products in Raj's category sell for $59.99, $64.99, and $69.99. Raj's cost is $28 per unit. He uses the margin calculator at each price to find the sweet spot.

solveFor = margin · costInput = 28 · revenueInput = 64.99

Gross Margin = 56.9%, Gross Profit = $36.99, Markup = 132.1%

At $59.99 margin is 53.3% with $31.99 profit; at $64.99 margin is 56.9% with $36.99 profit; at $69.99 margin is 60% with $41.99 profit. Raj chooses $64.99 — it positions him in the middle of the competitive set while delivering a healthy 56.9% margin. The extra $5 in price from the lowest option yields $5 more profit per unit, which compounds significantly at scale.

Frequently Asked Questions

Why does 50% markup not equal 50% margin?
Because they use different denominators. Markup divides profit by cost; margin divides profit by revenue (the selling price). At 50% markup: cost $100, price $150, profit $50. Markup = $50 ÷ $100 = 50%. Margin = $50 ÷ $150 = 33.3%. The higher the markup, the bigger the gap between the two numbers. At 100% markup (doubling the price), margin is only 50%.
Which metric should I use — margin or markup?
Use margin when talking to investors, accountants, or comparing profitability across businesses (industry benchmarks are almost always in margin terms). Use markup when setting prices from cost — it is simpler to say "apply a 2x markup" than to say "target a 50% margin." Both are correct; just be explicit about which you mean to avoid costly miscommunication.
What is a good gross margin for e-commerce?
It varies by category: Consumer electronics 10-25%, Apparel 50-70%, Beauty/personal care 60-80%, Home goods 40-60%, Software/digital goods 70-90%. Amazon FBA sellers often target 30-50% gross margin before fees; after Amazon's referral fee (8-15%) and FBA fees, net product margin is often 15-30%. Always model fees explicitly — they are not small.
How do I back-calculate what my cost must be to hit a target margin?
Use the formula: Cost = Revenue × (1 − Margin %). For example, if your selling price is $100 and you need 60% gross margin, your maximum allowable cost is $100 × (1 − 0.60) = $40. This is called "cost-back" or "design-to-cost" pricing and is the correct approach when you cannot change your price (e.g., a marketplace category where price competition is fierce).
What is the difference between gross margin and net margin?
Gross margin = (Revenue − COGS) ÷ Revenue. It only subtracts the direct cost of goods. Net margin = (Revenue − All Expenses) ÷ Revenue. It subtracts COGS plus all operating expenses: rent, labor, software, ads, shipping, returns, payment processing. A business can have 60% gross margin and 2% net margin if overhead is high. This calculator computes gross margin. Always track both.
When would I solve for cost instead of revenue?
Solve for cost when your selling price is fixed by the market (e.g., competitive marketplace categories) and you need to determine the maximum you can pay your supplier. For example, if your product must sell at $49.99 to compete and you need 40% margin, your max COGS is $49.99 × (1 − 0.40) = $29.99. This tells you exactly what to negotiate with suppliers. If no supplier can meet that cost, the product is not viable at that price point.
How does offering free shipping change my margin calculation?
Free shipping is effectively a cost you absorb. If your shipping cost is $5 per order and you offer free shipping, you should either: (1) include the $5 in COGS before calculating margin, or (2) treat shipping as a separate line item and calculate margin on revenue minus COGS minus shipping. Many e-commerce businesses that switch to free shipping find their effective margin drops 5-10 percentage points. To compensate, some increase product prices slightly to absorb the shipping cost while maintaining margin.
What is the relationship between margin and inventory turn rate?
Low-margin products can still be highly profitable if they turn over quickly. A product with 20% margin that sells 12 times per year can generate more annual profit than a product with 60% margin that sells twice per year. For example: a $20 product with 20% margin ($4 profit) selling 1,000 units/month generates $48,000 annual profit. A $100 product with 60% margin ($60 profit) selling 50 units/month generates only $36,000 annual profit. Always consider margin in context of volume and turn rate.

Pro Tips

  • The "Solve For" dropdown lets you work four different pricing problems with one calculator. Learn all four modes: margin from price, markup from price, price from margin, and cost from margin — they cover virtually every pricing question you will face in e-commerce.
  • Always calculate your cost-back (max COGS) before approaching suppliers. Knowing your ceiling prevents overpaying. The formula is simple: Max Cost = Selling Price × (1 − Target Margin %). Use this calculator's "Solve for Cost" mode to verify.
  • When negotiating wholesale bulk discounts, run the margin calculation at the new lower cost. A 10% cost reduction increases margin by MORE than 10% — on a $100 item with 40% margin, a 10% cost cut (from $60 to $54) raises margin to 46%, a 15% margin improvement.
  • Track your margin at list price AND at your most common discount level. A product with 55% margin at full price drops to 40% at 25% off — knowing both numbers prevents over-discounting during sales events.

Limitations to Know

  • This calculator computes gross margin using standard formulas with a single-product model and fixed cost/revenue inputs. Results represent gross values before platform fees, payment processing, shipping, returns, advertising, and other operating expenses.
  • For e-commerce specifically, effective net margin after all selling costs is often 40-70% lower than gross margin. Multi-product businesses should use weighted average COGS for overall margin analysis.
  • Volume discounts, supplier tier pricing, seasonal cost fluctuations, and currency exchange rate effects are not modeled.
  • For financial reporting, tax preparation, or investor presentations, verify figures with an accountant.
Was this calculator helpful?
Cite this calculator

TheCalcUniverse. "Margin Calculator — Gross Margin, Markup, Cost & Price (Solve Any." TheCalcUniverse, 2026, https://thecalcuniverse.com/ecommerce/margin-calculator/. Accessed July 24, 2026.

Embed this calculator on your site

Free to embed. Paste this into any HTML page — it stays up to date automatically.

Open embed ↗

You may also like

Guides that use this calculator