How to calculate margin
Learn how to calculate gross, net, and operating profit margin, with formulas, worked examples, and ways to improve.
Published Monday 19 October 2026
Table of contents
Key takeaways
- Profit margin measures the percentage of revenue left after costs, and it comes in three main types: gross, net, and operating
- Calculating your margins regularly helps you spot trends, set smarter prices, and make confident financial decisions for your business
- A good profit margin depends on your industry, country, and business model, and margins vary widely by sector (data as of January 2026)
- You can improve your margins by reducing costs, reviewing your pricing strategy, cutting unnecessary expenses, and using accounting software to track performance over time
What is profit margin?
Profit margin is one of the most useful numbers in your business. It tells you what percentage of your revenue you actually keep as profit after paying your costs.
In simple terms, it shows how efficiently your business turns sales into profit. A higher margin means you're keeping more of every dollar you earn. A lower margin means costs are eating into your revenue.
There are three main types of profit margin, and each one gives you a different view of your business finances:
- Gross profit margin shows what's left after you subtract the direct costs of making or delivering your product or service
- Net profit margin accounts for all your expenses, including tax, rent, wages, and interest payments
- Operating profit margin sits between the two; it includes operating expenses like rent and wages but leaves out tax and interest
Understanding all three helps you pinpoint exactly where your money is going and where you can improve. Whether you run a cafe, a trade business, or a consulting firm, knowing your margins puts you in control of your financial performance.
How to calculate gross profit margin

How to calculate gross profit margin
Gross profit margin tells you how much revenue is left after covering the direct costs of producing your goods or services. These direct costs are often called cost of goods sold (COGS), and they include things like raw materials, manufacturing costs, or the wholesale price of products you resell.
Here's the formula:
Gross profit margin = (Revenue − Cost of goods sold) / Revenue × 100
Follow these steps to calculate it:
- Add up your total revenue for the period.
- Add up your cost of goods sold for the same period.
- Subtract COGS from revenue to get your gross profit.
- Divide your gross profit by revenue.
- Multiply by 100 to get a percentage.
Here's an illustrative example. Say your coffee shop brought in $120,000 in revenue last quarter. Your COGS (coffee beans, milk, cups, food supplies) totaled $45,000.
Gross profit = $120,000 − $45,000 = $75,000
Gross profit margin = $75,000 / $120,000 × 100 = 62.5%
That means for every dollar of revenue, you kept 62.5 cents after covering the direct costs of your products. That 62.5% is your gross profit, and it's available to cover your other business expenses like rent, wages, and utilities.
Gross profit margin is especially useful for understanding whether your pricing covers your production costs. If your gross margin is shrinking over time, it could mean your supplier costs are rising or you need to adjust your prices.
How to calculate net profit margin

How to calculate net profit margin
Net profit margin gives you the full picture. It shows what percentage of revenue remains after you've paid every single expense, including COGS, operating costs, interest, and tax.
Net profit margin = (Revenue − All expenses) / Revenue × 100
Follow these steps to calculate it:
- Add up your total revenue for the period.
- Add up all your expenses: COGS, rent, wages, utilities, insurance, interest, tax, and any other costs.
- Subtract total expenses from revenue to get your net profit.
- Divide net profit by revenue.
- Multiply by 100 to get a percentage.
Using the same illustrative coffee shop example, your expenses for the quarter are COGS of $45,000, rent of $15,000, wages of $30,000, utilities and insurance of $5,000, and tax and interest of $6,000.
Total expenses = $45,000 + $15,000 + $30,000 + $5,000 + $6,000 = $101,000
Net profit = $120,000 − $101,000 = $19,000
Net profit margin = $19,000 / $120,000 × 100 = 15.8%
This means you kept 15.8 cents of every dollar earned after all costs. That's the true bottom line of your business.
Net profit margin is a number many business owners focus on, because it shows what you're actually taking home. It's also one of the figures banks and investors may look at when assessing the financial health of your business. For a broader view, learn how to measure profitability across your entire operation.
How to calculate operating profit margin
Operating profit margin shows how efficiently your core business operations run, before factoring in tax and interest payments. It's useful when you want to assess your day-to-day business performance without the noise of financing costs or tax obligations.
Operating profit margin = (Gross profit − Operating expenses) / Revenue × 100
Operating expenses include things like rent, wages, utilities, marketing, and insurance. They don't include tax or interest payments.
Continuing the illustrative coffee shop example:
Operating expenses = $15,000 (rent) + $30,000 (wages) + $5,000 (utilities and insurance) = $50,000
Operating profit = $75,000 (gross profit) − $50,000 = $25,000
Operating profit margin = $25,000 / $120,000 × 100 = 20.8%
This metric is particularly helpful when comparing your business against competitors, because it removes differences in tax situations and financing structures. It focuses purely on how well you run your operations.
What is a good profit margin?
There's no single number that counts as a "good" profit margin. Figures vary widely by industry, country, and business model.
NYU Stern's Margins by Sector data (as of January 2026) puts the average net margin at 9.74% for the total market. General retail averages 5.61%, while restaurants and dining average 9.37%. These are averages for US publicly traded companies, so small businesses and businesses in other countries can see different results.
Rather than chasing a specific number, focus on comparing your margin against businesses in your own industry. Your national statistics office, industry association, or accountant can point you to benchmark data that fits your business.
It's also worth tracking your margins over time. A steady or rising margin shows your business is on the right track. A declining margin signals that costs may be creeping up or pricing needs a review.
Margin vs markup
Margin and markup are related but they measure different things. Confusing the two can lead to pricing mistakes.
- Margin is the percentage of the selling price that is profit
- Markup is the percentage added to the cost price to reach the selling price
Here's a quick example. You buy a product for $60 and sell it for $100.
Margin = ($100 − $60) / $100 × 100 = 40%
Markup = ($100 − $60) / $60 × 100 = 66.7%
Same product, same profit in dollars, but very different percentages. The key difference is the base: margin uses the selling price, markup uses the cost price.
If you set your prices using a 40% markup but think you're getting a 40% margin, you'll end up with less profit than expected. Always be clear about which calculation you're using when setting prices or analyzing your financials. For a deeper comparison, see margin vs markup.
A simple way to remember: margin is always lower than markup for the same dollar profit, because margin divides by the larger number (selling price) while markup divides by the smaller number (cost price).
How to improve your profit margins
Once you know your margins, you can take steps to grow them. Here are some practical strategies that work for small businesses.
Reduce your cost of goods sold
Look at your direct costs and find ways to bring them down. You could negotiate better rates with suppliers, buy in bulk, or find alternative materials that don't compromise quality. Even small savings on COGS can have a big impact on your gross margin.
Review your pricing
If you haven't reviewed your prices recently, now's a good time. Prices set once and never revisited can fall behind rising costs. Research what competitors charge, factor in your costs, and adjust your prices to reflect the value you provide.
Even a small price increase can significantly improve your margins. For example, raising prices by just 5% on a product with a 10% margin increases your profit by 50%, assuming your costs and sales volume stay the same.
Cut unnecessary expenses
Go through your operating expenses line by line. Cancel subscriptions you don't use. Renegotiate contracts for things like insurance, internet, or office supplies. Small reductions across multiple expenses add up quickly.
Upsell and cross-sell
Increasing your average transaction value can help boost your margins. Offer complementary products or premium versions of what you already sell. Since you've already acquired the customer, the additional revenue comes at a lower cost.
Use accounting software to track margins
You can't improve what you don't measure. Use accounting software to monitor your margins in real time, so you can spot issues early and make adjustments before they become bigger problems. You can also use a free margin calculator to quickly check your numbers.
Track your profit margins with Xero
Keeping on top of your profit margins doesn't have to be complicated. Xero's reporting features let you generate profit and loss reports in a few clicks, so you can see exactly where your money is going. You can compare your profit and loss across periods, such as month to month or year over year, to see how your gross and net profit are trending.
With everything in one place, you can make faster, more confident decisions about pricing, costs, and growth. Get one month free and start tracking your margins today.
FAQs on how to calculate margin
Here are answers to frequently asked questions about profit margins.
What is the difference between gross and net profit margin?
Gross profit margin only subtracts the direct costs of producing your goods or services (COGS). Net profit margin subtracts all expenses, including operating costs, tax, and interest, giving you the true bottom-line percentage.
How often should you calculate your profit margin?
At a minimum, review your profit margins monthly. If your business has seasonal fluctuations or you're making changes to pricing or costs, checking weekly or every two weeks helps you stay on top of trends.
Can you have a negative profit margin?
Yes, a negative profit margin means your costs exceed your revenue and your business is making a loss. It can happen during startup phases or seasonal dips, and if it continues, it's a signal to review your pricing or reduce costs.
Do sales taxes like VAT or GST affect profit margin calculations?
Where you collect value-added tax (VAT), goods and services tax (GST), or sales tax for a tax authority, use tax-exclusive figures for revenue and expenses. Names and rules vary by country, so check your local rules.
What's the easiest way to track profit margins over time?
Use cloud accounting software like Xero to automatically generate profit and loss reports. This saves you from manual spreadsheet calculations and gives you an up-to-date view of your margins whenever you need it.
Related terms
Learn more about how to calculate margin
Handy resources
Advisor directory
You can search for experts in our advisor directory
Explore our guides
Find guides with expert advice and tools to help manage and grow your business
Financial reporting
Keep track of your performance with accounting reports
Disclaimer
This glossary is for small business owners. The definitions are written with their requirements in mind. More detailed definitions can be found in accounting textbooks or from an accounting professional. Xero does not provide accounting, tax, business or legal advice.