Gross Margin: How to Calculate It, Read It and Improve It

Quick answer: Gross margin is the percentage of revenue a business keeps after paying the direct costs of making or delivering what it sells (cost of goods sold, or COGS). Gross margin = (Revenue - COGS) / Revenue x 100. A company with $500,000 in sales and $300,000 in COGS has a 40% gross margin: it keeps 40 cents of every dollar to cover everything else.
Below you will find step-by-step worked examples, a margin to markup conversion table, a full SaaS COGS breakdown, sourced industry benchmarks and a worksheet you can copy into a spreadsheet today.
Table of contents
- What gross margin means
- The gross margin formula, step by step
- What goes into cost of goods sold
- Gross margin vs markup
- Gross margin vs operating margin vs net margin
- SaaS gross margin and the COGS breakdown
- What is a good gross margin? Industry benchmarks
- How to improve gross margin
- Copy-paste gross margin worksheet
- Tools and resources
- FAQ
- Keep reading
- Share your margins with investors the safe way with SendNow
What gross margin means
Every sale has two parts: the cost of producing what you sold, and everything left over. Gross margin measures that leftover share as a percentage of the sale.
It answers a simple question: for every dollar a customer pays, how many cents are left after the product itself is paid for? Those cents fund your sales team, your engineers, your rent, your interest payments and, eventually, your profit.
Two terms get mixed up constantly:
- Gross profit is a dollar figure. Revenue minus COGS.
- Gross margin (also called gross profit margin) is a percentage. Gross profit divided by revenue.
Because it is a percentage, gross margin lets you compare a $50,000-a-year side business with a $50 million company, or this quarter with the same quarter three years ago, without size getting in the way.
The gross margin formula, step by step
Gross profit = Revenue - Cost of goods sold
Gross margin (%) = Gross profit / Revenue x 100
Three rules keep the calculation honest:
- Use net revenue, meaning sales after returns, refunds and discounts. Gross sales overstate margin.
- Match the periods. Revenue and COGS must cover the same month, quarter or year.
- Be consistent about what sits in COGS. If you move a cost in or out of COGS, restate prior periods or your trend line lies.
Worked example: a coffee roaster
An illustrative specialty coffee roaster closes its year with the following numbers.
| Line | Amount |
|---|---|
| Net revenue (after refunds and discounts) | $480,000 |
| Green coffee beans | $132,000 |
| Bags, valves and labels | $28,800 |
| Roasting staff wages | $43,200 |
| Roastery utilities and roaster depreciation | $14,400 |
| Inbound freight on beans | $9,600 |
| Total COGS | $228,000 |
Step 1: Gross profit = $480,000 - $228,000 = $252,000
Step 2: Gross margin = $252,000 / $480,000 = 0.525 = 52.5%
The roaster keeps 52.5 cents from every dollar of coffee sold. Rent for the café, marketing, the owner's salary and website costs all have to come out of that 52.5 cents.
Worked example: comparing product lines
The same roaster sells three products. Margin by product shows where the money is really made.
| Product | Price | COGS per unit | Gross profit per unit | Gross margin |
|---|---|---|---|---|
| Single origin, 12 oz bag | $22.00 | $9.50 | $12.50 | 56.8% |
| House blend, 12 oz bag | $16.00 | $7.20 | $8.80 | 55.0% |
| Cold brew cans, 4-pack | $14.00 | $8.40 | $5.60 | 40.0% |
Cold brew looks popular on the shelf, but every can sold pulls the blended margin down. Knowing that, the owner can raise its price, renegotiate can costs or push the bags harder. That decision is impossible with a single company-wide number.
What goes into cost of goods sold
The biggest source of bad gross margin numbers is a messy COGS line. A useful rule: if the cost would disappear when you stop selling the product, it probably belongs in COGS.
| Usually in COGS | Usually NOT in COGS (operating expenses) |
|---|---|
| Raw materials and components | Sales salaries and commissions |
| Direct production or delivery labor | Marketing and advertising |
| Inbound freight and import duties | Office rent and admin salaries |
| Packaging | Most R&D and product development |
| Manufacturing overhead (factory utilities, equipment depreciation) | Accounting, legal and insurance for the company |
| Hosting and infrastructure that runs the product (software) | Internal tools for the back office |
| Merchant or payment fees (treated as COGS by many companies) | Interest and taxes (below operating profit) |
Service businesses use cost of revenue or cost of services instead of COGS. For an agency that means the salaries and contractor fees of the people doing client work. The formula does not change.
Gross margin vs markup
Margin and markup both start from the same gross profit, but divide it by different things. Confusing them is the most common pricing mistake small businesses make.
Gross margin = (Price - Cost) / Price
Markup = (Price - Cost) / Cost
A product that costs $60 and sells for $100 has $40 of gross profit:
- Margin = $40 / $100 = 40%
- Markup = $40 / $60 = 66.7%
If you want a 40% margin and mark up your cost by 40%, you get a $84 price and only a 28.6% margin. To convert between the two:
Markup = Margin / (1 - Margin)
Margin = Markup / (1 + Markup)
Margin to markup conversion table
| Target gross margin | Markup needed on cost | Price for a $10 cost |
|---|---|---|
| 10% | 11.1% | $11.11 |
| 20% | 25.0% | $12.50 |
| 25% | 33.3% | $13.33 |
| 30% | 42.9% | $14.29 |
| 33.3% | 50.0% | $15.00 |
| 40% | 66.7% | $16.67 |
| 50% | 100.0% | $20.00 |
| 60% | 150.0% | $25.00 |
| 70% | 233.3% | $33.33 |
| 75% | 300.0% | $40.00 |
| 80% | 400.0% | $50.00 |
The fastest pricing shortcut from the table: Price = Cost / (1 - Target margin). A $10 cost at a 60% margin target gives $10 / 0.40 = $25. If you prefer not to do the math, the profit margin calculator converts margin and markup live.
Gross margin vs operating margin vs net margin
Gross margin is the first of three margins on an income statement. Each one subtracts more costs.
| Margin | Formula | What it tells you |
|---|---|---|
| Gross margin | (Revenue - COGS) / Revenue | How profitable the product itself is |
| Operating margin | Operating income / Revenue | How profitable the business is after running costs |
| Net margin | Net income / Revenue | What is left for owners after interest and taxes |
A worked walk-down for a company with $2,000,000 in revenue:
| Line | Amount | Margin |
|---|---|---|
| Revenue | $2,000,000 | |
| COGS | ($800,000) | |
| Gross profit | $1,200,000 | 60.0% |
| Operating expenses (sales, R&D, admin) | ($900,000) | |
| Operating income | $300,000 | 15.0% |
| Interest | ($40,000) | |
| Taxes | ($55,000) | |
| Net income | $205,000 | 10.25% |
A strong gross margin with a weak operating margin means the product is fine but overhead is too heavy. A weak gross margin usually cannot be fixed by cutting overhead. For a deeper look at the walk-down, see revenue vs profit and our guide to EBITDA.
SaaS gross margin and the COGS breakdown
Software is famous for high gross margins because serving one more customer costs very little. But "very little" is not zero, and the line between COGS and operating expenses in SaaS is where many founders accidentally flatter their numbers.
What belongs in SaaS COGS
| Cost | In COGS? | Notes |
|---|---|---|
| Cloud hosting, databases, storage for the live product | Yes | The core of SaaS COGS |
| AI model inference and API calls made for customers | Yes | Scales with usage; can be large |
| Third-party services embedded in the product (email, SMS, maps, payments APIs) | Yes | |
| Customer support team | Yes, usually | Keeping paying customers working |
| Site reliability and DevOps for production | Yes, the production share | Time spent building new features goes to R&D |
| Payment processing fees | Often | Choose a policy and keep it |
| Onboarding and implementation staff | Yes, in cost of services | Report services margin separately |
| Customer success focused on renewals and expansion | Often split | Retention work is frequently treated as sales and marketing |
| Engineers building new features | No | R&D (or capitalized software) |
| Sales and marketing tools | No | Operating expense |
Worked SaaS example (illustrative)
A B2B SaaS company has $6,000,000 in annual revenue: $5,400,000 subscription and $600,000 professional services.
| Subscription COGS | Amount |
|---|---|
| Cloud hosting | $540,000 |
| AI model inference | $300,000 |
| Embedded third-party APIs | $120,000 |
| Customer support | $420,000 |
| Production SRE share | $240,000 |
| Payment processing | $160,000 |
| Total subscription COGS | $1,780,000 |
- Subscription gross margin = ($5,400,000 - $1,780,000) / $5,400,000 = 67.0%
- Services gross margin, with $480,000 of delivery staff cost = ($600,000 - $480,000) / $600,000 = 20.0%
- Blended gross margin = ($6,000,000 - $2,260,000) / $6,000,000 = 62.3%
Halving inference cost (through caching, a smaller model or batching) saves $150,000 and lifts subscription margin to ($5,400,000 - $1,630,000) / $5,400,000 = 69.8%. That is nearly three points from one engineering project.
AI is changing this line fast. The 2025 SaaS benchmarks report from Growth Unhinged and High Alpha, based on more than 800 companies, found early-stage gross margins down nearly 10 points year on year, and AI-native startups running about 5 points lower than their SaaS peers. If your product calls a model on every request, track inference cost per customer as closely as hosting.
💡 SendNow tip: Investors in a SaaS round will ask for your gross margin build, not just the headline number. Share the COGS breakdown and P&L in a tracked investor data room, and page-by-page analytics will show you which tabs they spent the most time on. Start free
What is a good gross margin? Industry benchmarks
There is no universal "good" gross margin. A grocery chain with a 25% margin can be healthy; a software company with 25% has a problem. The most useful public dataset is maintained by Aswath Damodaran at NYU Stern, which averages US public companies by sector.
| Industry (US) | Number of firms | Average gross margin |
|---|---|---|
| Drugs (pharmaceutical) | 228 | 71.73% |
| Software (system and application) | 309 | 71.72% |
| Software (internet) | 29 | 62.58% |
| Hotel and gaming | 63 | 60.85% |
| Semiconductor | 66 | 58.97% |
| Apparel | 35 | 56.88% |
| Business and consumer services | 155 | 33.38% |
| Retail (general) | 23 | 33.18% |
| Restaurant and dining | 64 | 32.24% |
| Retail (grocery and food) | 15 | 26.31% |
| Construction supplies | 40 | 25.52% |
| Air transport | 23 | 24.79% |
| Computer services | 64 | 24.26% |
| Food processing | 78 | 23.23% |
| Trucking | 26 | 21.19% |
| Auto and truck | 33 | 10.41% |
| Total market | 5,994 | 37.76% |
Source: Damodaran Online, Margins by Sector (US), data last updated January 2026. Verified on November 30, 2026.
Three cautions when you use benchmarks:
- These are public companies. Small businesses buy in smaller quantities and usually run lower margins in the same category.
- COGS definitions differ. Some companies put shipping or support in COGS and others do not. Read the footnotes before comparing two specific businesses.
- Your trend matters more than the level. A margin sliding from 58% to 51% over six quarters says more than how you compare with an industry average.
How to improve gross margin
There are only two moves: earn more per unit or spend less per unit. Here are seven practical levers, roughly in the order founders find them easiest.
- Raise prices on the products customers value most. Even small increases flow straight to gross profit.
- Cut discounting. Track the gap between list and realized price. Unplanned discounts quietly erode margin.
- Fix your product mix. Promote higher-margin products and bundles, and reprice or retire the ones that drag the average down.
- Renegotiate supplier costs. Volume commitments, longer contracts or alternative suppliers.
- Reduce waste and returns. Spoilage, damage and refunds all inflate effective COGS.
- Automate delivery work. In services and SaaS, automation and self-serve onboarding lower the people cost per customer.
- Optimize infrastructure. Right-size cloud resources, cache AI responses and remove unused third-party services.
Price increase vs cost cut: a worked margin bridge
Back to the coffee roaster ($480,000 revenue, $228,000 COGS, 52.5% margin). Compare two 5% changes, assuming volume stays the same:
| Scenario | Revenue | COGS | Gross profit | Gross margin |
|---|---|---|---|---|
| Today | $480,000 | $228,000 | $252,000 | 52.5% |
| Raise prices 5% | $504,000 | $228,000 | $276,000 | 54.8% |
| Cut COGS 5% | $480,000 | $216,600 | $263,400 | 54.9% |
The margins land almost level, but the price increase produces $12,600 more gross profit. Margin percentage and margin dollars do not always move together, so check both before you decide.
Copy-paste gross margin worksheet
Paste this into Excel or Google Sheets. Put each product, service or plan on its own row.
| Product | Units sold | Price per unit | COGS per unit | Revenue | COGS | Gross profit | Gross margin | Markup |
|---|---|---|---|---|---|---|---|---|
| Product A | 1,200 | $22.00 | $9.50 | $26,400 | $11,400 | $15,000 | 56.8% | 131.6% |
| Product B | 2,000 | $16.00 | $7.20 | $32,000 | $14,400 | $17,600 | 55.0% | 122.2% |
| Product C | 900 | $14.00 | $8.40 | $12,600 | $7,560 | $5,040 | 40.0% | 66.7% |
| Total | $71,000 | $33,360 | $37,640 | 53.0% |
Formulas (assuming row 2, columns A to I):
- Revenue (E2):
=B2*C2 - COGS (F2):
=B2*D2 - Gross profit (G2):
=E2-F2 - Gross margin (H2):
=G2/E2 - Markup (I2):
=G2/F2 - Blended margin:
=SUM(G:G)/SUM(E:E), never the average of the row percentages
That last point matters: averaging 56.8%, 55.0% and 40.0% gives 50.6%, but the true blended margin weighted by sales is 53.0%.
Tools and resources
- Profit margin calculator: our free profit margin calculator handles gross, operating and net margin plus markup.
- Accounting software: QuickBooks, Xero and NetSuite produce gross margin reports by product or class if COGS is mapped correctly.
- Spreadsheets: Excel or Google Sheets for the worksheet above.
- Benchmarks: Damodaran Online margins by sector (US public companies, updated each January).
- SaaS benchmark reports: the annual SaaS benchmarks published by Growth Unhinged with High Alpha, and the surveys from SaaS Capital and KeyBanc, are useful for software peer comparisons.
FAQ
What is a good gross margin?
It depends on the industry. US data compiled by NYU Stern professor Aswath Damodaran (January 2026) shows an all-market average near 38%, with grocery retail around 26%, restaurants around 32% and system and application software around 72%. Compare yourself with your own sector and your own trend, not a single universal number.
Is gross margin the same as gross profit?
No. Gross profit is a dollar amount: revenue minus cost of goods sold. Gross margin is that gross profit divided by revenue, shown as a percentage. A company with $250,000 of gross profit on $500,000 of revenue has a 50% gross margin.
What is the difference between gross margin and markup?
Both use the same gross profit, but margin divides it by the selling price while markup divides it by the cost. A product that costs $60 and sells for $100 has a 40% margin and a 66.7% markup. Margin can never reach 100%, while markup can go well above it.
What is a good gross margin for a SaaS company?
Software companies usually run far higher gross margins than physical-goods businesses because extra customers cost little to serve. Damodaran's January 2026 US data puts system and application software near 72% on average. AI-heavy products can run lower because model inference is a real cost of every customer request.
Can gross margin be negative?
Yes. If cost of goods sold is larger than revenue, gross profit is below zero and so is gross margin. It happens when products are priced below their direct cost, during heavy discounting, or in early startups whose infrastructure is sized for far more customers than they have.
Does gross margin include salaries?
Only the salaries of people who directly produce or deliver what you sell. Production workers, roasters or warehouse pickers, and in SaaS the support and site reliability staff who keep the live product running, are usually in COGS. Sales, marketing, general admin and most R&D salaries sit below gross profit as operating expenses.
What is the difference between gross margin and contribution margin?
Gross margin subtracts cost of goods sold, which can include some fixed production costs such as factory rent. Contribution margin subtracts only variable costs, including variable selling costs like sales commissions and shipping to customers. Contribution margin is better for break-even and pricing decisions; gross margin is the standard reported figure.
Why do investors care about gross margin?
Gross margin shows how much of each revenue dollar is left to pay for sales, R&D, overhead and profit. A high and stable gross margin means growth can turn into profit later. Investors also use it to adjust customer lifetime value, so a low margin makes every customer worth less.
Keep reading
- Profit margin calculator: gross, operating and net
- Revenue vs profit, explained side by side
- What is revenue? Types and recognition
- What is EBITDA and how to calculate it
- Customer acquisition: CAC, LTV and payback
- What is capex? Capital expenditure explained
Share your margins with investors the safe way with SendNow
✅ Keep your P&L, COGS build and pricing model in one investor data room ✅ Gate it with an NDA and stamp every page with a per-viewer watermark ✅ See exactly who opened your financials and how long they spent on each page with document tracking ✅ Block downloads and expire links once the round closes

About the Author: Rifana Hameem
Rifana is the founder of SendNow. She leads the team in building secure, compliant, and analytics-rich document sharing tools for finance and professional teams worldwide.
Connect on LinkedIn
