ThisCalculator

Business

Gross Margin Calculator Formula

Updated · Standard formula, shown below

Gross margin 60.0 %
Gross profit
60.00 $
Result
Markup
150.0 %
Result
Cost of goods sold
40 $
You entered

Gross Margin Calculator Formula

This calculator works out your gross margin percentage, gross profit, and selling price from cost and revenue figures. You enter the cost of goods sold (COGS) and either the revenue or the desired margin, and you get the margin percentage, markup percentage, and profit amount. The core formula is: Gross Margin = (Revenue – Cost) ÷ Revenue × 100.

Formula

Gross margin (also called gross profit margin) is the percentage of revenue that remains after subtracting the direct costs of producing or purchasing the goods sold. Written in symbols:

Gross Margin (%) = (Revenue – Cost of Goods Sold) ÷ Revenue × 100

Where:

  • Revenue = the total selling price (what the customer pays), in dollars
  • Cost of Goods Sold (COGS) = the direct cost to produce or acquire the item, in dollars
  • Gross Profit = Revenue – COGS (in dollars)
  • Gross Margin = Gross Profit ÷ Revenue, expressed as a percentage

Notice that gross margin is always expressed as a percentage of revenue, not of cost. This is a common point of confusion with markup, which is expressed as a percentage of cost.

Worked Example

Using the default values from the calculator above:

  • Cost of goods sold = $40
  • Revenue = $100

Step 1: Calculate gross profit: $100 – $40 = $60

Step 2: Divide gross profit by revenue: $60 ÷ $100 = 0.6

Step 3: Convert to percentage: 0.6 × 100 = 60%

The calculator shows a gross margin of 60.0%, a gross profit of $60.00, and a markup of 150% (because $60 profit ÷ $40 cost = 1.5, or 150%).

Why Gross Margin Matters

Gross margin tells you how efficiently a business uses its direct inputs—materials, labor, and freight—to generate sales. A higher margin means you keep a larger slice of each dollar of revenue to cover operating expenses like rent, salaries, and marketing. It is a key metric for pricing decisions, cost control, and comparing profitability across products or companies.

For example, a software company might have a gross margin of 80% because its main cost is development, which is fixed. A grocery store might have a gross margin of 25% because it sells high-volume, low-margin goods. Neither is inherently better; context matters.

Gross Margin vs. Markup

People often use these terms interchangeably, but they are different:

  • Gross Margin = (Revenue – Cost) ÷ Revenue × 100. It tells you what percentage of the selling price is profit.
  • Markup = (Revenue – Cost) ÷ Cost × 100. It tells you how much you added to the cost to get the selling price.

Example: An item costs $50 and sells for $75. Gross margin = (75 – 50) ÷ 75 = 33.3%. Markup = (75 – 50) ÷ 50 = 50%. The same transaction yields different percentages because the denominators differ.

A common pricing mistake is to apply a markup percentage and assume it equals the margin. If you want a 40% margin, you cannot simply add 40% to cost. To achieve a 40% margin, divide the cost by (1 – 0.40). For a $50 cost, the price should be $50 ÷ 0.6 = $83.33.

How to Use the Calculator

Enter any two of the three values—cost, revenue, or margin—and the calculator will compute the missing one. The calculator above takes cost and revenue, but you can also work backward:

  • To find selling price from cost and desired margin: Price = Cost ÷ (1 – Margin%). For a $40 cost and a 60% margin, price = $40 ÷ 0.4 = $100.
  • To find cost from price and desired margin: Cost = Revenue × (1 – Margin%). For $100 revenue and a 60% margin, cost = $100 × 0.4 = $40.
  • To find margin from cost and price: Use the formula above.

Always express the margin as a decimal in these reverse calculations (e.g., 60% becomes 0.60).

Common Mistakes and Pitfalls

  • Mixing up margin and markup: As shown, they are not the same. Using markup when you mean margin can underprice or overprice your product.
  • Forgetting to include all direct costs: COGS should include materials, direct labor, and freight, but not rent, utilities, or administrative salaries. Including indirect costs makes the margin artificially low.
  • Using cost instead of revenue as the base: The formula divides by revenue, not cost. Dividing by cost gives markup, not margin.
  • Rounding too early: If you round the margin to a whole number before using it in a price calculation, you may get a noticeably different price. Keep extra decimal places until the final step.
  • Ignoring currency or units: The formula works with any currency as long as both cost and revenue are in the same currency. Mixing dollars and euros will produce a meaningless result.

Limitations of the Gross Margin Formula

Gross margin is a snapshot, not the whole story. It does not account for operating expenses, taxes, interest, or one-time charges. Two businesses can have the same gross margin but very different net profits if one has high overhead. Also, gross margin can vary by industry, season, and product mix. A company with a low gross margin can still be profitable if it sells high volume and keeps operating costs low.

The formula assumes that all units are sold at the same price and that costs are constant. In reality, discounts, volume pricing, and economies of scale can change both revenue and cost per unit. For multi-product businesses, a weighted average gross margin is more useful than a simple average.

Frequently Asked Questions

What is a good gross margin?

There is no universal “good� margin. It depends on the industry. Service businesses often have margins above 50%, while retail and grocery may be 20–30%. Compare your margin to historical performance and industry benchmarks rather than an arbitrary number.

Can gross margin be negative?

Yes, if the cost of goods sold exceeds revenue. That means you are losing money on every sale before considering operating expenses. A negative gross margin is a serious red flag and usually requires a price increase or cost reduction.

What is the difference between gross margin and net margin?

Gross margin subtracts only the direct costs of goods sold. Net margin subtracts all expenses, including operating costs, interest, and taxes. Net margin is always lower than gross margin for a profitable business.

How do I calculate margin if I only know cost and markup?

First convert markup to margin: Margin = Markup ÷ (1 + Markup). For example, a 50% markup equals a margin of 0.5 ÷ 1.5 = 33.3%. Or, if you know cost and markup, you can find revenue and then use the margin formula.

Does gross margin include shipping costs?

It depends on how you define COGS. If you pay to ship goods to your warehouse, that is typically included in COGS. If you charge customers for shipping, that is revenue. The key is to be consistent so your margin is comparable over time.

Can I use this formula for services?

Yes, but you must define the “cost of goods sold� for the service. For a service business, COGS might be the direct labor and materials used to deliver the service. Overhead like office rent is not included.

Related

Formula used
in c | Cost of goods sold | $ | 40 | 0
in r | Revenue (selling price) | $ | 100 | 0
out gm | Gross margin | % | (r - c) / r * 100 | 1
out gp | Gross profit | $ | r - c | 2
out mk | Markup | % | (r - c) / c * 100 | 1

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.