ThisCalculator

Business

Gross Margin Calculator: Formula & How to Use It

Updated · Standard formula, shown below

Gross margin 40.00 %
Gross profit per unit
20.00 $
Result
Markup
66.67 %
Result
Selling price per unit
50 $
You entered

Gross Margin Calculator: Formula & How to Use It

A gross margin calculator works out the percentage of revenue that remains after deducting the cost of goods sold (COGS). You enter your selling price and your cost per unit (or total revenue and total COGS), and it returns the gross margin percentage, gross profit, and often the markup. This is a standard financial metric used by businesses to gauge how efficiently they produce and sell their products.

Formula

The gross margin percentage is calculated as:

Gross Margin (%) = [(Selling Price – Cost of Goods Sold) / Selling Price] × 100

Where:

  • Selling Price – the amount you charge a customer for one unit (or total revenue for a period), in dollars.
  • Cost of Goods Sold (COGS) – the direct cost to produce or acquire that unit (materials, labor, freight), in dollars.

The result is a percentage. For example, a 40% gross margin means that for every $1 of revenue, $0.40 remains after covering the direct product costs.

Worked Example

Using the calculator’s default values: selling price = $50, cost per unit = $30.

  1. Gross profit per unit = $50 – $30 = $20
  2. Gross margin = ($20 / $50) × 100 = 40%
  3. Markup = ($20 / $30) × 100 = 66.67%

The calculator shows a gross margin of 40%, a profit of $20 per unit, and a markup of 66.67%.

Why Gross Margin Matters

Gross margin tells you how much money you have left to cover operating expenses (rent, salaries, marketing) and still generate net profit. A healthy gross margin varies by industry – software companies often have margins above 80%, while grocery stores might operate on 20–30%. Tracking this number over time helps you spot rising material costs, pricing power, or inefficiencies in production.

How to Use the Calculator

Enter two numbers:

  • Selling price – what you charge per unit or total revenue.
  • Cost per unit – what you pay to produce or buy each unit.

The calculator instantly gives you the margin percentage, the profit per unit, and the markup. Use it when setting prices, evaluating a new product, or preparing financial statements. You can also work backward: if you know your desired margin, you can determine the price needed by rearranging the formula: Price = COGS / (1 – Margin%).

Common Mistakes and Misconceptions

One frequent error is confusing gross margin with markup. They are related but not the same. A 50% markup (cost plus 50%) results in a 33.3% gross margin. Another mistake is forgetting to include all direct costs in COGS – if you exclude shipping or packaging, your margin looks higher than reality. Also, be consistent with units: use per-unit or total figures, but don’t mix them.

Another misconception is that a high gross margin always means high profitability. You still need to account for operating expenses, taxes, and interest. A company with a 70% gross margin could still lose money if its overhead is enormous.

Limitations of Gross Margin

Gross margin only considers direct production costs. It ignores:

  • Operating expenses (rent, utilities, salaries)
  • Depreciation and amortization
  • Interest and taxes
  • One-time charges

It also doesn’t reflect cash flow or how quickly inventory sells. For a full picture, combine gross margin with net margin, operating margin, and inventory turnover.

Frequently Asked Questions

What is a good gross margin?
It depends on the industry. Generally, above 50% is considered strong for product businesses, while service businesses often have even higher margins. Compare your margin to industry benchmarks, not arbitrary numbers.

How do I calculate gross margin in Excel?
In a cell, type =(A1-B1)/A1*100, where A1 is revenue and B1 is COGS. Format the cell as a percentage. For markup, use =(A1-B1)/B1*100.

What’s the difference between gross margin and net margin?
Gross margin subtracts only COGS from revenue. Net margin subtracts all expenses – operating costs, interest, taxes – from revenue. Net margin is always lower than gross margin for a profitable company.

Can gross margin be negative?
Yes, if your COGS exceeds your selling price. That means you lose money on every unit sold before considering any other costs. This is unsustainable unless you plan to raise prices or cut costs.

Does gross margin include shipping costs?
It depends on how you account for shipping. If you pay to ship raw materials in, that’s part of COGS. If you charge customers for shipping, that revenue is not part of the product price. Be consistent with your accounting method.

Related

Formula used
in price | Selling price per unit | $ | 50 | 0
in cost | Cost per unit | $ | 30 | 0
out margin | Gross margin | % | (price - cost) / price * 100 | 2
out profit | Gross profit per unit | $ | price - cost | 2
out markup | Markup | % | (price - cost) / cost * 100 | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.