Aviy
Business FinanceGross Margin FormulaGross Profit MarginGross Margin PercentageGross Margin RatioGross Profit

Gross Margin Explained: Formula, Examples and How to Improve It

Gross Margin Explained: Formula, Examples and How to Improve It - Aviy AI invoicing
18 min read

Gross margin is the percentage of revenue left after subtracting the direct cost of producing your goods or services (cost of goods sold). You calculate it by dividing gross profit by total revenue, then multiplying by 100. A higher gross margin means more money is available to cover overhead, taxes and profit.

Gross margin is one of the most useful numbers in business, and most owners never look at it. They watch revenue go up, feel good, and wonder why the bank account stays flat. Your gross margin is the answer to that mystery: it tells you how much of every sale you actually keep after paying the direct costs of delivering it. Understand it, and you understand whether your business can ever be profitable.

This guide breaks gross margin down into plain language. You will learn the exact formula, see worked examples for both product and service businesses, find out what a good gross margin looks like, and pick up practical ways to improve yours without simply hiking prices and hoping for the best.

What Is Gross Margin?

Gross margin is the share of revenue that remains after you subtract the cost of goods sold (COGS) - the direct costs tied to producing what you sell. It is expressed as a percentage of revenue, which makes it easy to compare across products, months and even competitors.

Think of revenue as the top line of your income statement. The first thing it has to cover is the cost of actually making or delivering the thing your customer paid for. What is left over is your gross profit, and gross profit expressed as a percentage of revenue is your gross margin.

A business with a 60% gross margin keeps 60 cents of every dollar of sales to put toward rent, salaries, software, marketing, taxes and - eventually - profit. A business with a 15% gross margin keeps only 15 cents to cover all of that. Same revenue, wildly different reality.

Why this number sits at the top

Gross margin matters because it is the first and biggest filter your money passes through. If your gross margin is too thin, no amount of cost-cutting elsewhere will save you. You cannot out-discipline a broken margin. That is why investors, lenders and seasoned founders look at gross margin before almost anything else.

The Gross Margin Formula (With Examples)

The gross margin formula has two steps. First you find gross profit, then you turn it into a percentage.

Gross profit = Revenue − Cost of goods sold

Gross margin % = (Gross profit ÷ Revenue) × 100

That is the whole thing. The hard part is not the math - it is deciding what counts as cost of goods sold, which we cover in detail below.

Example 1: A product business

Imagine an online store sells handmade candles. In one month it brings in $20,000 in sales. The wax, wicks, jars, labels and shipping materials cost $8,000 in total.

  • Revenue: $20,000
  • Cost of goods sold: $8,000
  • Gross profit: $20,000 − $8,000 = $12,000
  • Gross margin: ($12,000 ÷ $20,000) × 100 = 60%

So 60 cents of every dollar is available to cover marketing, the studio lease, the owner's salary and profit.

Example 2: A service business

Now take a small web design agency. It invoices $40,000 in a month. The direct cost of delivering that work - the contractors and freelancers who built the sites - comes to $16,000.

  • Revenue: $40,000
  • Cost of goods sold (direct delivery labor): $16,000
  • Gross profit: $24,000
  • Gross margin: ($24,000 ÷ $40,000) × 100 = 60%

Notice the agency does not include the founder's office rent or the accounting software in COGS, because those costs exist whether or not this particular project happens. We will return to that distinction.

Example 3: A freelancer

A freelance copywriter charges $5,000 for a project. To deliver it, she pays a research assistant $500 and buys $100 of stock images.

  • Revenue: $5,000
  • Direct project costs: $600
  • Gross profit: $4,400
  • Gross margin: ($4,400 ÷ $5,000) × 100 = 88%

Solo service providers often have very high gross margins because their main "cost" is their own time, which usually is not counted in COGS.

Gross Margin vs Gross Profit vs Net Margin

These three terms get tangled constantly, so let's separate them clearly.

MetricWhat it measuresFormSits where
Gross profitRevenue minus COGSDollar amountNear the top
Gross marginGross profit as % of revenuePercentageNear the top
Operating marginProfit after operating expenses, as % of revenuePercentageMiddle
Net marginProfit after everything (incl. tax and interest), as % of revenuePercentageBottom line

Gross profit is a raw dollar figure. Gross margin is that same figure expressed as a percentage, which lets you compare a $20,000 month against a $200,000 month fairly. Net margin goes all the way down the income statement, subtracting overhead, marketing, salaries, interest and tax to reveal what you truly keep.

A business can have a healthy 65% gross margin and still lose money if its overhead is bloated - that shows up as a negative net margin. Gross margin tells you whether the core offer is sound; net margin tells you whether the whole business is. For a deeper breakdown of the top-line versus bottom-line difference, the relationship between gross and net is worth understanding fully.

What Counts as Cost of Goods Sold?

Getting COGS right is what makes or breaks the accuracy of your gross margin. The rule of thumb: COGS includes costs that scale directly with each sale and would disappear if you stopped making that sale.

Typically inside COGS

  • Raw materials and components
  • Manufacturing or production labor
  • Packaging and shipping of the product
  • Payment processing fees on each sale (often included)
  • Subcontractors or freelancers hired specifically to deliver a project
  • Software licenses resold or consumed per project

Typically outside COGS (these are operating expenses)

  • Office rent and utilities
  • Salaries of admin, sales and management staff
  • Marketing and advertising
  • General software subscriptions (your accounting tool, your email)
  • Insurance and professional fees

For service businesses the line is fuzzier, because your main input is labor. A common approach is to include the directly billable delivery labor in COGS and keep everything that supports the business generally - sales, admin, your own management time - in operating expenses.

What Is a Good Gross Margin?

There is no universal "good" number, because gross margin varies enormously by industry. A grocery store survives on thin margins because it sells huge volume; a software company expects very high margins because its cost to serve one more customer is tiny.

Here are realistic ballpark ranges to orient yourself. Treat these as directional, not gospel - your real benchmark is your own industry and your own past performance.

Business typeTypical gross margin range
Software / SaaS70-90%
Professional services / agencies40-60%
Freelancers / consultants70-90%
Retail (general)20-50%
Restaurants / food60-70% on food, but high labor
Manufacturing25-45%
Grocery / supermarkets10-25%

The single most useful comparison is you versus you. If your gross margin was 52% last quarter and it is 47% now, something changed - and finding out what matters more than whether 47% beats some industry average. Consistency and trend tell the real story.

How freelancers and agencies should read these numbers

If you sell your own time, a high gross margin is expected and not impressive on its own - the question becomes whether your operating expenses and your effective hourly rate make the business worthwhile. If you resell other people's time (a typical agency model), your gross margin is the spread between what you charge and what you pay your team, and a healthy spread is what funds the whole operation.

Gross Margin vs Markup: Don't Confuse Them

This is the single most common error in pricing, and it costs businesses real money. Margin and markup use the same two numbers but divide by different denominators.

  • Margin = profit ÷ selling price
  • Markup = profit ÷ cost

Say an item costs you $60 and you sell it for $100. Your profit is $40.

  • Gross margin = $40 ÷ $100 = 40%
  • Markup = $40 ÷ $60 = 67%

Same transaction, two very different percentages. If you want a 40% margin and you mistakenly apply a 40% markup, you will underprice and quietly bleed profit on every sale.

CostPrice for 30% markupPrice for 30% margin
$100$130$142.86
$500$650$714.29
$1,000$1,300$1,428.57

To hit a target margin, the formula is: Price = Cost ÷ (1 − target margin). For a 30% margin on a $100 cost: $100 ÷ (1 − 0.30) = $142.86.

Why Gross Margin Matters More Than Revenue

Revenue is vanity, gross profit is sanity. A business doing $1 million at a 12% gross margin keeps $120,000 to run everything. A business doing $400,000 at a 55% gross margin keeps $220,000. The smaller-revenue business is healthier and has far more room to invest, hire and weather a slow month.

Gross margin also drives almost every other financial decision:

  • It sets a ceiling on how much you can spend to acquire a customer.
  • It determines how much pricing room you have during a recession or price war.
  • It tells you whether scaling will help or simply multiply your losses.
  • It shapes your break-even point and your runway.

If your gross margin is healthy, growth amplifies profit. If it is broken, growth amplifies the problem. This is why founders who chase top-line revenue without watching margin so often grow themselves into a cash crisis. Improving how reliably you collect what you have billed - through faster invoicing and tighter payment terms - protects the cash side of the same equation.

Real-world example: Maya the consultant

Maya runs a two-person marketing consultancy. Last year she celebrated hitting $300,000 in revenue, up from $210,000. But her gross margin slid from 58% to 44% because she had started subcontracting more work at rates that were too generous. In dollar terms her gross profit barely moved - from roughly $122,000 to $132,000 - despite a 43% jump in revenue.

Once Maya started tracking gross margin per project, she renegotiated subcontractor rates, dropped two low-margin clients, and raised prices on a third. Revenue dipped slightly the next quarter, but her gross margin climbed back to 56% and her take-home actually rose. The lesson: she had been working harder for the same money because she was watching the wrong number.

How to Improve Your Gross Margin

You improve gross margin one of two ways: increase revenue per sale, or decrease the direct cost per sale. Here are the levers that actually work.

1. Raise prices deliberately

The fastest route, and the most underused. A modest price increase flows almost entirely to gross profit because your direct costs do not change. Many businesses are afraid of losing customers, but they overestimate the churn a small, well-communicated increase causes.

2. Reduce cost of goods sold

Renegotiate supplier contracts, buy in larger quantities, find alternative vendors, or redesign the product to use cheaper inputs without hurting quality. For service businesses, this means tightening how efficiently you deliver - fewer wasted hours, better templates, less rework.

3. Improve your product or service mix

Some of what you sell is far more profitable than the rest. Lean into the high-margin offerings and either reprice or retire the low-margin ones. Often a small slice of your catalog carries most of your gross profit.

4. Cut waste in delivery

Spoilage, errors, returns, scope creep and rework all silently erode margin. A service business that stops giving away "quick favors" and bills accurately for change requests can lift its margin several points without raising a single headline price.

5. Reduce payment processing leakage

Card fees, currency conversion costs and chasing late invoices all nibble at margin. Streamlining how you bill and collect - clear payment terms, online payment options, automatic reminders - keeps more of each sale and reduces the cost of getting paid.

6. Increase average order value

Bundling, upselling and minimum order sizes spread your fixed delivery effort across a larger sale, which lifts the effective margin on each transaction.

Common Gross Margin Mistakes

Even experienced owners trip over these. Avoiding them is often worth more than any clever growth tactic.

  • Confusing margin with markup. Covered above - it leads to chronic underpricing.
  • Putting the wrong costs in COGS. Dumping overhead into COGS makes gross margin look artificially low; leaving out real direct costs makes it look artificially high.
  • Ignoring payment processing fees. On thin-margin products, a 3% card fee can be the difference between profit and loss.
  • Tracking only revenue. The classic trap that lets a "growing" business quietly go broke.
  • Forgetting to count your own time. Solo operators often show a 90% gross margin while paying themselves a starvation wage. Margin looks great because labor is invisible.
  • Averaging everything together. A blended gross margin can hide the fact that half your products lose money while the other half subsidise them.
  • Setting and forgetting prices. Your supplier costs rise every year; if your prices do not, your margin shrinks automatically.

Gross Margin Best Practices

Follow these steps to make gross margin a working tool rather than a number you compute once and forget.

  1. Define COGS precisely and write it down. List exactly which costs go into COGS so every month is calculated the same way.
  2. Calculate gross margin monthly. Make it a fixed part of your bookkeeping routine, not an annual surprise.
  3. Segment it. Track margin by product, service line, client type and channel - wherever decisions get made.
  4. Set a target margin per offer. Decide the margin you need, then price backward into it using Price = Cost ÷ (1 − target margin).
  5. Watch the trend, not just the snapshot. A single month tells you little; the direction over six months tells you everything.
  6. Pair it with cash flow. A great margin you cannot collect is just a nice-looking spreadsheet. Invoice promptly and chase late payers.
  7. Review pricing on a schedule. Build an annual price review into your calendar so margin erosion never sneaks up on you.

Doing this consistently turns gross margin from an accounting term into a steering wheel for the whole business.

Pros and Cons of Focusing on Gross Margin

Gross margin is powerful, but like any single metric it has blind spots. Here is a balanced view.

Pros

  • Simple to calculate and easy to explain to anyone.
  • Reveals the fundamental health of your core offer before overhead clouds the picture.
  • Comparable across time, products and competitors because it is a percentage.
  • Directly guides pricing and product-mix decisions.
  • An early-warning system for cost creep and underpricing.

Cons

  • Ignores overhead, so a strong gross margin can still hide an unprofitable business.
  • Depends heavily on how you define COGS, which can be subjective for services.
  • Says nothing about cash flow or how fast you actually get paid.
  • A blended figure can mask big differences between products.
  • Industry benchmarks vary so widely that cross-industry comparisons are misleading.

The takeaway: use gross margin as your first lens, then pair it with net margin and cash flow for the full picture.

Summary

Gross margin is the percentage of revenue you keep after covering the direct cost of what you sell, and it is one of the clearest signals of whether a business model actually works. Calculate it by subtracting cost of goods sold from revenue to get gross profit, then dividing gross profit by revenue. Decide what belongs in COGS, keep that definition consistent, and track the number every month rather than once a year.

Watch the trend, segment it by product or service, and remember that margin is not markup. A strong gross margin gives you room to invest, weather downturns and grow profitably; a weak one means scaling only multiplies your problems. Get this number right and most other financial decisions become far easier to make.

Frequently asked questions

What is gross margin in simple terms?

Gross margin is the slice of each sale you keep after paying the direct costs of producing or delivering it. If you sell something for $100 and it costs $60 to make, your gross profit is $40 and your gross margin is 40%. That 40 cents on the dollar is what is left to cover rent, salaries, marketing, tax and eventually profit. The higher the percentage, the healthier your core offer.

How do you calculate gross margin?

Use two steps. First, subtract cost of goods sold from revenue to get gross profit. Then divide gross profit by revenue and multiply by 100 to get the percentage. For example, $50,000 revenue minus $20,000 COGS equals $30,000 gross profit; $30,000 divided by $50,000 is 0.60, or a 60% gross margin. The formula works identically for product and service businesses.

What is a good gross margin percentage?

It depends entirely on your industry. Software businesses often run 70-90%, professional services 40-60%, retail 20-50%, and grocery as low as 10-25%. Rather than chasing a universal target, compare your gross margin against others in your industry and against your own past performance. A stable or rising trend in your own numbers matters more than beating an arbitrary benchmark.

What is the difference between gross margin and gross profit?

Gross profit is a dollar amount - revenue minus cost of goods sold. Gross margin is that same gross profit expressed as a percentage of revenue. Gross profit tells you how many dollars you kept; gross margin tells you what proportion of each sale you kept. The percentage is more useful for comparing different months, products or competitors because it removes the effect of scale.

Is gross margin the same as markup?

No, and confusing them is a costly mistake. Markup is profit divided by cost, while margin is profit divided by selling price. An item costing $60 sold for $100 has a 40% margin but a 67% markup. To hit a target margin, price using Price = Cost ÷ (1 − target margin). Always set prices from margin, not markup, to avoid quietly underpricing every sale.

How can I improve my gross margin?

There are two basic levers: increase revenue per sale or reduce the direct cost per sale. Practical moves include raising prices deliberately, renegotiating supplier costs, shifting toward higher-margin products, cutting waste and rework, reducing payment processing leakage, and increasing average order value. Small price increases are often the fastest win because the extra revenue flows almost entirely to gross profit.

What is included in cost of goods sold?

COGS includes costs that scale directly with each sale - raw materials, production labor, packaging, shipping, project subcontractors and often payment processing fees. It excludes general overhead such as rent, admin salaries, marketing and general software, which are operating expenses. The test: would the cost disappear if you stopped making that specific sale? If yes, it usually belongs in COGS.

Why does gross margin matter more than revenue?

Revenue only shows how much money came in; gross margin shows how much you actually keep to run the business. A company with $400,000 in sales at a 55% margin keeps more gross profit than one with $1 million at a 12% margin. Margin sets the ceiling on what you can spend to grow and determines whether scaling helps or simply multiplies losses.

What gross margin do investors look for?

Investors use gross margin to judge whether a business model is fundamentally sound and scalable. They favor high, stable or improving margins because that signals pricing power and efficient delivery. Software investors often expect 70%+, while investors in physical-goods businesses accept lower figures if volume and consistency are strong. A declining margin is a red flag regardless of revenue growth.

How is gross margin different from net margin?

Gross margin only subtracts the direct cost of goods sold, sitting near the top of the income statement. Net margin subtracts everything - overhead, marketing, salaries, interest and tax - leaving the true bottom-line profit as a percentage of revenue. A business can have a strong gross margin yet a negative net margin if overhead is too high. Use both together for a full picture.

Conclusion

Gross margin is the financial number that tells you whether your business actually works, long before revenue or net profit can. By stripping out everything except the direct cost of delivering each sale, it reveals how much of your top line you genuinely keep - and therefore how much room you have to grow, invest and survive lean months. Master the formula, define cost of goods sold consistently, and you give yourself a reliable compass for pricing and decision-making.

Treat gross margin as a habit, not a one-off calculation. Track it monthly, segment it by product and service line, and watch the trend rather than a single snapshot. Pair it with net margin and cash flow, never confuse it with markup, and review your prices on a schedule. Do that, and your gross margin stops being an accounting term and becomes one of the most practical tools you own.

Sources and further reading