BusinessMarch 29, 2026

Gross Margin Calculator: Formula, Industry Benchmarks & How to Improve It

By The hakaru Team·Last updated March 2026

Quick Answer

  • *Gross margin = (Revenue − COGS) ÷ Revenue × 100. It measures how much profit remains after covering the direct cost of producing your product or service.
  • *The S&P 500 average gross margin is approximately 45%. Software runs 70–85%; retail 30–50%; restaurants 30–40%; manufacturing 20–35%.
  • *COGS includes direct materials and direct labor. It does not include SG&A, R&D, rent, or marketing — those go below the gross profit line.
  • *To improve gross margin: raise prices, cut direct costs, increase volume, reduce waste, or shift toward higher-margin product lines.

What Is Gross Margin?

Gross margin is the percentage of revenue that remains after subtracting the direct cost of producing your goods or services. It's one of the first profitability metrics investors and operators look at because it reveals the underlying economics of a product before overhead expenses cloud the picture.

A company with a 60% gross margin keeps $0.60 of every dollar of revenue to cover operating costs and generate profit. A company with a 20% gross margin keeps only $0.20 — meaning it must be exceptionally lean on operating expenses to survive.

Gross Profit vs. Gross Margin: The Key Distinction

These two terms are related but not interchangeable:

  • Gross profit is a dollar amount: Revenue − COGS. If you earn $1,000,000 in revenue with $600,000 in COGS, your gross profit is $400,000.
  • Gross margin is a percentage: Gross Profit ÷ Revenue × 100. That same scenario yields a 40% gross margin.

The percentage form is more useful for benchmarking across companies of different sizes. A startup with $400,000 gross profit and a Fortune 500 with $4 billion gross profit may have the same 40% gross margin, making them directly comparable on product economics.

The Gross Margin Formula

The formula is straightforward:

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

Where:

  • Revenue = total sales before any deductions
  • COGS = cost of goods sold — the direct costs tied to production

Example: A software company earns $2,000,000 in annual revenue. Its hosting, customer support, and payment processing costs (its COGS) total $400,000. Gross profit = $1,600,000. Gross margin = $1,600,000 ÷ $2,000,000 × 100 = 80%.

You don't need to do this by hand. Our gross margin calculator handles the math instantly.

What Counts as COGS? (And What Doesn't)

Misclassifying expenses above or below the gross profit line is one of the most common accounting errors in small business. It distorts your margins and makes benchmarking meaningless.

Included in COGS

CategoryExamples
Direct materialsRaw materials, components, packaging
Direct laborWages of workers who make the product
Manufacturing overheadFactory utilities, depreciation of production equipment
Freight inCost to receive inventory from suppliers
Cloud infrastructure (SaaS)Hosting, CDN, database costs tied to delivering the product

Not Included in COGS (Goes Below the Line)

CategoryExamples
SG&ASales salaries, marketing spend, office rent
R&DEngineering salaries, product development costs
G&AAccounting, legal, executive salaries
Interest expenseLoan interest payments
TaxesIncome tax

According to the Financial Accounting Standards Board (FASB), operating expenses and COGS must be reported separately on GAAP income statements. Many early-stage founders incorrectly lump engineering salaries or office rent into COGS, which understates gross margin and makes the business look worse than it is.

Industry Gross Margin Benchmarks

Context is everything. A 35% gross margin is excellent for a grocery chain but alarming for a SaaS startup. According to CSIMarket's industry analysis (2025), here's how gross margins break down across major sectors:

IndustryTypical Gross Margin RangeWhy
Software / SaaS70–85%Near-zero marginal cost of delivery
Financial services60–80%Labor-light, capital-intensive models
Pharmaceuticals55–75%High prices, low manufacturing cost per pill
Restaurants30–40%Food cost typically 60–70% of menu price
Retail30–50%Varies widely by category (luxury vs. grocery)
Manufacturing20–35%High material and labor intensity
Grocery / food retail20–30%Razor-thin margins, high volume
Construction15–25%Labor and materials dominate cost structure

The S&P 500 composite gross margin sits at approximately 45% as of 2025 (CSIMarket). But that number is heavily skewed by the large weighting of high-margin tech and healthcare companies. Most Main Street businesses operate far below that average.

The Three Layers of Profitability: Gross, Operating, and Net Margin

Gross margin is just the first layer. To understand a business fully, you need all three:

MetricFormulaWhat It Tells You
Gross margin(Revenue − COGS) ÷ RevenueProduct/service economics before overhead
Operating margin(Revenue − COGS − OpEx) ÷ RevenueCore business profitability before interest & taxes
Net marginNet Income ÷ RevenueBottom-line profitability after everything

A business can have a 70% gross margin but a 5% net margin if it burns heavily on sales, marketing, and R&D. Amazon famously operated with near-zero net margins for years while maintaining healthy gross margins — reinvesting every dollar of gross profit into growth. For a deeper look at the middle layer, see our guide on operating margin.

According to NYU Stern's 2025 industry data, the average net margin across all US industries is approximately 7.6%— compared to a gross margin average of over 40%. The gap between gross and net shows how much a company spends running the business beyond production.

Gross Margin in SaaS: Why Software Margins Are So High

Software businesses have an economic property that most industries don't: near-zero marginal cost of delivery. Writing the software costs money. Hosting it for the 10,000th user costs almost nothing more than hosting it for the 100th.

The main COGS items for a SaaS company are:

  • Cloud hosting (AWS, GCP, Azure)
  • Third-party API costs (payment processing, identity verification, data providers)
  • Customer support salaries (sometimes classified as COGS, sometimes as OpEx)
  • Content delivery and bandwidth

Stripe, Shopify, and Salesforce all report gross margins above 70%. Pure software companies with no hardware components often exceed 80%. This is why software companies command premium valuations — each incremental dollar of revenue contributes massively to gross profit without proportional cost increases.

According to OpenView Partners' 2024 SaaS Benchmarks report, the median gross margin for B2B SaaS companies with $10–$50M ARR is 74%, with top-quartile performers exceeding 80%.

Contribution Margin vs. Gross Margin

These two metrics are often confused, but they answer different questions:

Gross MarginContribution Margin
SubtractsAll COGS (fixed + variable)Only variable costs
Best forFinancial reporting, investor analysisPricing decisions, break-even analysis
Fixed cost treatmentIncluded if in COGSExcluded entirely
Per-unit viewLess useful per unitDirectly useful per unit sold

Example: A manufacturer sells a product for $100. Variable costs (materials + hourly labor) are $40. Fixed manufacturing overhead allocated per unit is $20. Gross margin = ($100 − $60) ÷ $100 = 40%. Contribution margin = ($100 − $40) ÷ $100 = 60%.

Contribution margin tells you how much each unit sold contributes to covering fixed costs. It's the right number for break-even analysis and pricing decisions. Gross margin is what shows up on your income statement and what investors scrutinize.

Top 5 Strategies to Improve Gross Margin

Improving gross margin is about either increasing the gap between price and direct cost, or producing more efficiently. Here are the five highest-leverage levers:

1. Raise Prices

The fastest way to improve gross margin is to charge more — without increasing COGS. A 10% price increase on a product with 40% gross margin improves margins by 6 percentage points if volume holds. According to McKinsey research, a 1% price increase translates to an 8.7% operating profit improvement on average, making pricing the highest-ROI lever in the business.

2. Reduce Direct Labor Costs

Automation, process improvement, and cross-training can reduce the labor hours required per unit without cutting quality. Even small efficiency gains compound: reducing labor per unit by 15% on a product line with 30% labor content in COGS improves gross margin by 4–5 points.

3. Source Cheaper Materials

Renegotiating supplier contracts, consolidating vendors, or finding alternative materials with comparable quality directly reduces COGS. Larger order volumes typically unlock volume discounts. According to Deloitte's 2024 Global CPO Survey, companies that actively manage supplier relationships see material cost reductions of 8–12% compared to passive procurement.

4. Increase Volume to Spread Fixed COGS

Fixed costs in COGS (factory rent, equipment depreciation, production salaries) are diluted across more units at higher volumes. If your factory has $500,000 in fixed production overhead and you produce 10,000 units, fixed overhead per unit is $50. At 20,000 units, it drops to $25 per unit — directly boosting gross margin without touching variable costs.

5. Eliminate Waste and Reduce Defect Rates

Defective products, spoilage, and production waste are direct COGS inflators. Lean manufacturing principles (5S, Kaizen, Six Sigma) target this specifically. A restaurant reducing food waste from 8% to 4% of food purchased effectively improves food cost margin by the same amount — often worth 2–3 percentage points of gross margin improvement.

Common Gross Margin Mistakes

Confusing Markup with Margin

Markup and margin are not the same thing. If you buy an item for $60 and sell it for $100, your markup is 67% (profit ÷ cost). Your gross margin is 40% (profit ÷ revenue). Many business owners set prices using markup but report margin to investors — creating confusion. See our markup calculator guide for the full breakdown.

Misclassifying Operating Expenses as COGS

Sales team salaries, marketing agency fees, and office rent are operating expenses — not COGS. Including them above the gross profit line artificially suppresses gross margin and makes benchmarking against industry peers meaningless.

Ignoring Product-Level Margins

Blended gross margin hides which products are pulling your average up or down. A retailer with a 40% overall gross margin might have some SKUs at 60% and others at 15%. Segmenting by product line reveals where to focus — and where to potentially exit.

Optimizing Margin at the Expense of Revenue

Cutting COGS too aggressively (using cheaper materials, reducing customer support) can boost gross margin while destroying customer satisfaction and long-term revenue. Gross margin and revenue growth are both inputs to business value — don't sacrifice one to optimize the other in isolation.

Related Tools and Guides

Frequently Asked Questions

What is the gross margin formula?

Gross margin = (Revenue − COGS) ÷ Revenue × 100. For example, if your revenue is $500,000 and your cost of goods sold is $300,000, your gross profit is $200,000 and your gross margin is 40%. The formula isolates how efficiently you produce or deliver your product before operating expenses.

What is a good gross margin?

It depends heavily on your industry. Software companies typically see 70–85% gross margins. Retail averages 30–50%. Restaurants run 30–40% on food and beverage. Manufacturing lands at 20–35%. According to CSIMarket, the S&P 500 average gross margin is approximately 45%. Compare yourself to your sector peers, not the overall market.

What is the difference between gross margin and net margin?

Gross margin measures profitability after subtracting only COGS from revenue. Net margin subtracts all expenses including operating costs, interest, taxes, and depreciation. A business can have a 60% gross margin but a 5% net margin if its SG&A, R&D, and interest costs are high. Gross margin shows product economics; net margin shows total business efficiency.

What is included in cost of goods sold (COGS)?

COGS includes direct materials, direct labor used in production, and manufacturing overhead directly tied to production. It does not include rent, marketing, sales salaries, R&D, or administrative costs — those are operating expenses that appear below the gross profit line on the income statement.

What is the difference between gross margin and contribution margin?

Gross margin subtracts all COGS (both fixed and variable) from revenue. Contribution margin subtracts only variable costs — costs that change directly with each unit sold. Contribution margin is more useful for pricing decisions and break-even analysis because it shows how much each sale contributes to covering fixed costs.

Why do SaaS companies have such high gross margins?

Software has near-zero marginal cost of delivery. Once code is written, serving the 1,000th customer costs almost nothing more than serving the 10th. Hosting, support, and payment processing are the main incremental costs. This is why top SaaS companies like Microsoft and Adobe report gross margins above 70%, sometimes exceeding 80%.