What are gross, operating and net profit margins, and how do you calculate them?

Profit margins tell you how much of every dollar of sales a company keeps, at three levels. Gross margin subtracts the cost of what was sold; operating margin also subtracts the costs of running the business; net margin takes out interest and taxes too. Each is a profit divided by revenue, and only means something next to sector peers.

Level Basic · 8 min · Updated · Company data as of · Kaplio editorial team · How we work

Level: basico · Category: Rentabilidad · Duration: 8 min min · Points: 10

What gross, operating and net margins measure, how to calculate them from the income statement, and why Costco and Microsoft both make money with opposite margins.

In 30 seconds

  • Gross margin measures the power of the product: how much is left after paying for what was sold.
  • Operating margin measures management and is the best one for comparing companies in the same sector.
  • Net margin is what's left for shareholders, but one-off gains and losses distort it.
  • A margin is only good or bad relative to its sector: 3% is healthy for a grocer and poor for a software company.
  • What tells you the most is how stable the margin stays over several years.

Introduction

In fiscal 2025, Costco earned a 12.8% gross margin: out of every hundred dollars it took in, nearly eighty-seven went straight to paying for the merchandise. Microsoft, in fiscal 2026, kept 67.9%. Both make billions. How is that possible with margins so far apart? The answer explains almost everything about how a business works.

Explanation

A margin is a percentage: the share of revenue that survives a particular kind of cost. There are three, and each one subtracts a bit more than the one before.

Picture a juice stand. You sell a cup for $4. The fruit and the cup cost you $1.50, so you keep $2.50: a gross margin of 62.5%. Now pay the rent on the stand, your helper's wages and the electricity, which work out to $1.50 a cup: you're left with $1, an operating margin of 25%. Pay the interest on the loan you took out for the juicer, then your taxes, and you keep $0.70: a net margin of 17.5%.

All three come from the income statement, and each tells a different story:

Gross margin: the power of the product. When it's high, customers pay far more than the thing costs to make. It usually points to a brand, patents or software that can be copied almost for free.
Operating margin: management's discipline. It covers selling, marketing, research and administrative costs. It's the best one for comparing companies in the same industry, because neither debt nor taxes distort it.
Net margin: what's really left for shareholders. It's also the easiest to distort, because it includes gains and losses that have nothing to do with the business.

Look at the whole staircase, not a single step. A company with a strong gross margin and a weak operating margin spends too much on overhead. One with a strong operating margin and a weak net margin usually carries a lot of debt.

Formula

Gross margin = (Revenue − Cost of goods sold) / Revenue × 100
Operating margin = Operating income (EBIT) / Revenue × 100
Net margin = Net income / Revenue × 100
Cost of goods sold = what it costs to make or buy what was sold
Operating income = Gross profit − Operating expenses (selling, general and administrative, R&D)

Example

Let's start with Walmart, fiscal 2026, which ended on January 31, 2026, using the annual report it filed with the SEC (millions of dollars):

Step 1. Revenue: 713,163. Cost of sales: 535,395. Gross profit: 177,768. Gross margin: 177,768 / 713,163 = 24.9%.
Step 2. Operating income: 29,825. Operating margin: 29,825 / 713,163 = 4.2%.
Step 3. Net income attributable to Walmart: 21,893. Net margin: 21,893 / 713,163 = 3.1%.

Walmart keeps three cents of every dollar. That sounds like nothing until you multiply it by more than $700 billion in sales.

Now Costco, fiscal 2025 (ended August 31, 2025): revenue of 275,235, merchandise costs of 239,886, operating income of 10,383 and net income of 8,099. Gross margin of 12.8%, operating margin of 3.8% and net margin of 2.9%. Costco sells close to cost on purpose: it makes its money on membership fees and enormous volume.

And Microsoft, fiscal 2026 (ended June 30, 2026): revenue of 331,839, gross margin of 67.9%, operating margin of 46.8% and net margin of 40.3%. A different planet.

The table below compares the gross margin of four big retailers. Before you look: do you think Walmart has a higher gross margin than Target?

Real-data example

Gross margin · Data as of
CompanyTickerGross margin
Walmart Inc.WMT25.2%
Costco Wholesale CorporationCOST12.8%
Target CorporationTGT29.3%
The Kroger Co.KR23.1%

Over the trailing twelve months as of October 4, 2026, Target has the highest gross margin of the four (29.3%), followed by Walmart (25.2%) and Kroger (23.1%); Costco sits at 12.8%. Walmart's 25.2% doesn't contradict the 24.9% in the example: the table uses the most recent twelve months, while the example uses the fiscal year that ended in January 2026.

How to read it

How to read it
Rough thresholds, in line with the sector guide on Kaplio's stock pages and with Kaplio's Buffett method:

SectorGood gross marginGood operating margin
Software70% or moreAbove 25%
Semiconductors45% or moreAbove 20%
Branded pharma70% or moreAbove 20%
Branded consumer goods (beverages, personal care)35% or more, and stableAbove 15%
IndustrialsStable12% or more
Retail and grocery10% to 30%, depending on the model3% to 6%

For net margin, Kaplio's Buffett method treats anything sustained above 20% as a sign of a competitive advantage, and staying below 10% year after year as a warning. That yardstick doesn't work for grocers: there, a steady 3% is a good business. Always compare within the sector.

Pitfalls and limitations
- A low margin doesn't mean a bad company. Costco and Walmart make up for it with turnover: they sell through their inventory many times a year.
- Net margin gets inflated by things outside the business. In fiscal 2026 (which ended in June 2026), Microsoft reported $10,697 million of non-operating income, so its net margin sat closer to its operating margin than usual. If net margin grows much faster than operating margin, go looking for the one-off item.
- Not everyone counts the same way. Some companies put depreciation in cost of sales and others don't, so the gross margins of two companies in the same sector may not be comparable.
- One year can fool you. What matters is stability over five or ten years; a margin that rises and falls with the cycle gives away a product with no pricing power.

Case in point: Coca-Cola
In 2025, Coca-Cola posted a 61.6% gross margin on drinks made from water, sugar and concentrate. That margin barely moves even when aluminum or sugar prices climb: the company passes the cost on to customers. That's what Buffett called pricing power, and it shows up in gross margin before any other number. Once you've got margins down, the next step is the EBITDA margin.

Practice on Kaplio

See Costco's margins

Frequently asked questions

What is the difference between gross and net profit margins?

Gross margin is the share of revenue left after paying for what was sold, the raw materials or merchandise. Net margin is what's left at the very end, after operating costs, interest and taxes. Between them sits operating margin, which takes out overhead but not financing costs. Gross shows product strength; net shows what reaches shareholders.

What is the difference between operating and gross profit margin?

Gross margin only subtracts the direct cost of what was sold. Operating margin also subtracts selling, marketing, research and administrative costs. A company can have an excellent gross margin and a weak operating margin if it spends too much on overhead, which is why it pays to look at both, and at how they trend.

Is net profit margin the same as operating margin?

No. Operating margin measures what the business earns after its running costs. Net margin also subtracts interest and taxes, and adds or subtracts one-off items such as asset sales. That's why operating margin is better for comparing how two companies are run, while net margin tells you what really reached shareholders that year.

Is 10% a good operating profit margin?

It depends entirely on the sector. For a retailer or grocer, where 3% to 6% is normal, 10% would be outstanding. For industrials, Kaplio's guide treats 12% or more as good, and in software anything below 25% is modest. Compare the figure with direct competitors and check that it holds steady over several years.

Related lessons

Sources

Educational content. Not investment advice.