Gross margin measures profit after cost of goods sold, while operating margin measures profit after all operating expenses, also known as EBIT. The formulas look similar, but they answer different questions about a company, and investors typically check both before forming a view on a stock. Below are the formulas, worked examples, and guidance on when each matters most.
TL;DR:
- Check cost of revenue footnotes before comparing software or service companies, because that line can include different items than traditional cost of goods sold.
- Review operating expenses for asset impairments, restructuring charges, or litigation settlements, and compare reported operating income with adjusted EBIT when both appear.
- A growing company can post positive gross margin but negative operating margin while funding customer acquisition or research; assess whether spending builds durable growth.
- Compare margins with direct industry peers over several quarters, then pair them with return on capital and free cash flow before judging business quality.
Table of Contents
- What gross margin measures
- How to calculate gross margin step by step
- What operating margin measures
- How to calculate operating margin step by step
- Gross margin vs operating margin: a direct comparison
- What counts as a good margin
- Running margin checks across many stocks
- Key takeaways on margin analysis
- Where margins fit in a broader investment checklist
- Check margins across your whole watchlist with Oracle Investments
- FAQ
- Sources
What gross margin measures
Gross margin shows how much money a company keeps from each dollar of revenue after paying for the direct costs of producing what it sells. The formula is straightforward: (Revenue − Cost of Goods Sold) ÷ Revenue × 100, as defined by Corporate Finance Institute.
Cost of goods sold (COGS) usually includes three types of expenses:
- Direct materials, meaning the raw inputs that go into a product
- Direct labor, meaning wages paid to workers who make the product or deliver the service
- Production overhead tied specifically to goods sold, such as factory utilities or equipment depreciation on the production line
Here is a simple example. Say a company reports $1,000,000 in revenue and $600,000 in COGS. Gross profit is $400,000, and gross margin is 40% ($400,000 ÷ $1,000,000 × 100).
Gross margin is most informative when you want to understand pricing power, unit economics, or how efficiently a company turns raw inputs into finished goods. It tells you little about overhead, marketing spending, or management discipline, which is where operating margin picks up the story.

How to calculate gross margin step by step
Calculating gross margin from an income statement takes five steps, and you can build this directly into a spreadsheet.
- Find total revenue, usually the top line of the income statement
- Find cost of goods sold, sometimes labeled "cost of revenue" or "cost of sales"
- Subtract COGS from revenue to get gross profit
- Divide gross profit by revenue
- Multiply by 100 and format the result as a percentage
In spreadsheet terms, if revenue sits in cell B2 and COGS sits in cell B3, gross profit is =B2-B3 and gross margin is =(B2-B3)/B2. Using the earlier example, that produces $400,000 and a typical gross margin percentage.
Pro Tip: Watch for companies that label this line "cost of revenue" instead of COGS. Software and service businesses often use that term, and it can include different items than a traditional COGS line, so check the footnotes before comparing two companies side by side.
What operating margin measures
Operating margin goes a step further than gross margin by accounting for the full cost of running the business, not just producing the product. The formula is Operating Income (EBIT) ÷ Revenue × 100, where operating income subtracts both COGS and operating expenses from revenue, according to Corporate Finance Institute.
Operating expenses typically include:
- Selling, general, and administrative costs (SG&A)
- Marketing and advertising spending
- Payroll outside of direct production, including salaried staff
- Rent and facility costs
- Depreciation and amortization
Interest expense and taxes are excluded, which is what separates operating margin from net margin.
Using the same company from before: revenue of $1,000,000, COGS of $600,000, and operating expenses of $250,000.

How to calculate operating margin step by step
Operating margin builds directly on the gross margin calculation, so the workflow is quick once you have the income statement open.
- Calculate gross profit (revenue minus COGS), or pull it directly if already reported
- Subtract total operating expenses from gross profit to get operating income, or use the company's reported EBIT figure
- Divide operating income by revenue
- Multiply by 100 for the percentage
In spreadsheet form, with revenue in B2, COGS in B3, and operating expenses in B4: operating income is =B2-B3-B4, and operating margin is =(B2-B3-B4)/B2.
Watch for one-off items such as asset write-downs, restructuring charges, or litigation settlements buried in operating expenses. These can distort a single quarter's operating margin without reflecting the ongoing business, so it is worth checking whether a reported EBIT figure has already been adjusted for them.
Pro Tip: When a company reports "adjusted EBIT" alongside GAAP operating income, calculate both. A large, recurring gap between the two numbers is often a signal worth investigating further, not just a rounding difference.
Gross margin vs operating margin: a direct comparison
The two metrics measure different parts of the business, and knowing which one to check depends on what question you are trying to answer.
- Gross margin includes only revenue and COGS; operating margin includes COGS plus every operating expense, from marketing to rent to depreciation
- Gross margin is almost always higher than operating margin for the same company, since it excludes a larger set of costs
- Operating margin moves more with management decisions, since items like marketing budgets and headcount are discretionary in a way that production costs rarely are, per Corporate Finance Institute
- Product managers and operations teams lean on gross margin to judge pricing and production efficiency, while investors and lenders often weight operating margin more heavily when judging management effectiveness, as noted by Investopedia
A healthy gross margin paired with a weak operating margin is a common red flag. In the worked example above, a gross margin fell to a notably lower operating margin, a gap driven entirely by operating expenses. That pattern often shows up in companies that price their products well but spend heavily on overhead, marketing, or an oversized administrative staff, and it is exactly the kind of divergence that a single-margin view would miss.
A growth-stage company can even show a positive gross margin alongside a negative operating margin if it is investing aggressively in customer acquisition or research, according to Allianz Trade. That is not automatically a problem, but it does mean the spending needs to be evaluated on whether it is building something durable or just buying short-term growth.
What counts as a good margin
Benchmark ranges for both metrics vary enormously by business model, so a single target number is rarely useful on its own. Corporate Finance Institute notes that software companies often post much higher gross margins than retail or hardware businesses, simply because their cost of delivering an additional unit is so much lower.
A few guidelines help frame the comparison:
- Compare a company's margins against others in the same industry, never against a generic average
- Track margin direction over several quarters rather than relying on one snapshot, since a single period can be skewed by a one-time event
- Treat a widening or shrinking trend as more informative than the absolute number itself, a point Investopedia emphasizes when discussing how analysts actually use these ratios
- Use margins as a screening filter, then dig into the footnotes of any company whose numbers look unusually high or low for its sector
Gross, operating, and net margins are complementary rather than competing measures, and Britannica notes they should be read together, within an industry context and across time, rather than in isolation.
Running margin checks across many stocks
A practical workflow looks like this: pull revenue and COGS for gross margin, pull operating income or EBIT for operating margin, compare both against industry peers, then track the trend over several quarters. Doing that by hand across a watchlist of ten or twenty companies takes real time, and comparing peer benchmarks consistently adds another layer of work, a step that tools like the one described by Funding Optimal also emphasize when discussing how performance should be judged against a relevant peer set.
Within an investment analysis tool, you can score more than 260 stocks on fundamentals including profitability, so a margin check sits alongside valuation and financial health scores for the same company, and you can compare several companies side by side instead of rebuilding the calculation each time in a separate spreadsheet.
Key takeaways on margin analysis
The single rule worth remembering: gross margin tells you about product and unit economics, while operating margin tells you about operational and management efficiency.
- Calculate both margins for any company you are researching, not just one
- Compare each margin against industry peers rather than a flat benchmark
- Watch the trend across several quarters, since direction often matters more than any single number
- Pair margin analysis with other measures, such as return on capital employed or free cash flow, before drawing conclusions about quality
Where margins fit in a broader investment checklist
Margins tell you about profitability, but they say nothing about how much capital a business needs to generate that profit or how much cash it actually converts. I weigh gross and operating margin alongside return on capital and free cash flow, checked quarterly rather than annually, since a single bad quarter is noise but a multi-quarter trend is information. Our income statement checklist and owner earnings guide walk through the rest of that process in more depth.
— Matt
Check margins across your whole watchlist with Oracle Investments
We built Oracle Investments to turn the calculations in this article into a fast, repeatable screen instead of a spreadsheet chore. Scores for profitability, valuation, and financial health are shown transparently and rule-based, drawn from reported fundamentals rather than a model's guesswork, across more than 260 stocks you can compare side by side.

If you want margin checks, peer comparisons, and portfolio tracking in one place, learn more about Premium Annual and see how it fits into your own research routine.
This article is general information, not a substitute for advice from a qualified financial advisor. Consult a qualified financial professional about your own circumstances before acting on anything here.
FAQ
What does a 30% operating margin mean?
An operating margin around 30% means a company keeps roughly $0.30 in operating profit for every dollar of revenue after covering both production costs and operating expenses like SG&A and marketing. That is generally considered strong, though what counts as strong depends heavily on the industry, with software businesses often running higher than manufacturers.
What does a 70% gross margin mean?
High gross margins like this are common in software and services, where production costs per additional unit are low, as Corporate Finance Institute notes when comparing business models.
What does a 30% gross margin mean?
That level is typical in industries with heavier input or labor costs, such as retail or manufacturing, and should be judged against sector peers rather than a universal standard.
Is a 2% operating margin good?
Whether it is a concern depends on the industry: razor-thin margins are normal in businesses like grocery retail, but unusual in software or specialty manufacturing, so comparing against direct peers matters more than the number alone.
Sources
- Gross Profit | Corporate Finance Institute
- Gross margin vs. operating margin | Investopedia
- Profit margin types: Gross, operating, & net margin explained | Britannica
