Pricing & profit

Gross Margin Calculator

Measure revenue remaining after cost of goods sold.

Free, no sign-upRuns in your browserReviewed October 2026Formula & methodology
US dollars
US dollars
units
Gross marginExample40%
Gross profit
$4,000
Average gross profit per unit
$20.00

Understand the result

What is gross margin?

Gross margin is the percentage of revenue left after paying the direct cost of the goods or services you sold. It equals (revenue − cost of goods sold) ÷ revenue × 100. A 40% gross margin means $0.40 of every sales dollar is available for overhead and profit.

Gross margin isolates how profitable your product or service is before rent, salaries, marketing and other overhead. It is the first number to check when you change suppliers, prices or your product mix, because operating costs cannot hide what happened.

What goes into cost of goods sold

  • Retailers and online stores: what you paid for the products you sold, plus inbound freight and import duties.
  • Manufacturers and makers: raw materials, direct labor and production overhead.
  • Restaurants: food and beverage costs for the items sold.
  • Service businesses: the direct cost of delivering the service, such as contractor hours or software used only for client work.

Rent, office salaries, advertising and software you would pay for anyway are operating expenses, not COGS. Keep them out, or the margin stops telling you about the product.

Example: a coffee shop month

Sales are $42,000. Coffee, milk, syrups, pastries and cups cost $12,600.

  1. Gross profit: $42,000 − $12,600 = $29,400
  2. Gross margin: $29,400 ÷ $42,000 = 0.70, so 70%

That 70% still has to pay baristas, rent and equipment, which is why a high gross margin does not guarantee a profitable shop.

Gross margin vs. markup vs. net margin

MeasureDivides profit byCosts included
Gross marginRevenueCost of goods sold only
MarkupCostCost of the item only
Net marginRevenueAll expenses, interest and taxes

Common mistakes

  • Putting overhead into COGS. It understates gross margin and hides whether the product itself is priced well.
  • Using purchases instead of cost of goods sold. Inventory you bought but have not sold yet is not a cost of this period’s sales.
  • Averaging away the product mix. One blended margin can hide a best-seller with a thin margin. Check your top products separately.
Common questions

Gross Margin FAQ

What is a good gross margin?

It depends heavily on the industry. Grocers and distributors work with low gross margins and high volume, while software and many service businesses keep most of each dollar. Compare against businesses with the same model and watch your own trend month to month.

How is gross margin different from operating margin?

Gross margin subtracts only cost of goods sold. Operating margin also subtracts operating expenses such as payroll, rent and marketing, so it is lower for any business with overhead.

Is gross margin the same as gross profit?

No. Gross profit is the dollar amount (revenue minus COGS). Gross margin is that amount as a percentage of revenue. This calculator shows both, plus the average gross profit per unit.

Can gross margin be negative?

Yes, when the direct cost of what you sold is higher than its revenue. That usually points to a pricing error, a supplier cost increase or heavy discounting.

Guides for this calculation

Build context around the numbers with worked examples from our guides.

Contribution Margin Formula: Calculate It, Understand It & Use It →