How to calculate margin
Margin is profit divided by revenue, times 100. Here's how to work out gross and net margin.
October 2023 | Published by Xero
Published Thursday 23 July 2026
Table of contents
Key takeaways
- Margin shows how much of your revenue turns into profit, expressed as a percentage.
- To calculate margin, divide your profit by your revenue, then multiply by 100.
- The two main types are gross profit margin and net profit margin, and each tells you something different about your business.
- A healthy margin depends on your industry, so compare yourself to similar businesses rather than a single benchmark.
What is margin?

How to calculate gross profit margin
Margin is your profit divided by your revenue, multiplied by 100, and shown as a percentage. It tells you how much of every dollar you earn is left over as profit after your costs.
There are two main types you'll come across. Gross profit margin looks at profit after the direct cost of making your product or service, and net profit margin looks at profit after every expense and tax.
How to calculate gross profit margin

How to calculate net profit margin
Gross profit margin shows how much profit you keep after paying for the direct costs of what you sell. You work it out by subtracting your cost of goods sold from your revenue, dividing by revenue, then multiplying by 100.
Say your business brings in $100,000 in revenue and your cost of goods sold is $60,000. Your gross profit is $40,000, so your gross profit margin is ($40,000 ÷ $100,000) × 100, which gives you 40%.
How to calculate net profit margin
Net profit margin shows how much profit is left after every cost, including operating expenses and taxes. You calculate it by subtracting all expenses and taxes from your revenue, dividing by revenue, then multiplying by 100.
Using the same $100,000 in revenue, imagine your total expenses and taxes come to $85,000. Your net profit is $15,000, so your net profit margin is ($15,000 ÷ $100,000) × 100, which works out to 15%.
Operating profit margin
Operating profit margin sits between the gross and net figures, showing profit from your core operations. It's useful when you want to see how well the business runs before interest and taxes come into play.
To find it, divide your operating profit by your revenue, then multiply by 100. Operating profit is your revenue minus operating expenses, but it excludes interest and taxes.
Margin vs markup
Margin and markup both compare profit to a number, but they use different starting points. Margin is based on your selling price, while markup is based on your cost.
Say a product costs you $60 and you sell it for $100. Your margin is $40 ÷ $100, which is 40%, but your markup is $40 ÷ $60, which is about 67%. If you want to dig into the two side by side, read our guide on margin vs markup.
What is a good profit margin?
A good profit margin depends on your industry, so there's no single number that works for everyone. A service business with low direct costs often runs a higher margin than a retailer that buys and resells physical goods.
Rather than chasing a fixed target, compare your margin to similar businesses in your field and track it over time. A steady or rising margin usually signals that your pricing and costs are working together well.
How to improve your profit margin
You can lift your margin by earning more from each sale or spending less to make it. Keeping a close eye on managing cash flow also helps you spot where money leaks out, and our guide on profit margin covers the wider picture.
Here are some practical levers to work through:
- Raise prices where the market and your value allow
- Reduce cost of goods sold by negotiating with suppliers or cutting waste
- Cut unnecessary overheads that don't support growth
- Review pricing regularly to keep pace with your costs
Track your margins with Xero
Knowing your margins helps you price with confidence and keep more of what you earn. With clear reporting and real-time insights, you can watch your profit margins move as your business grows and act before small problems turn into big ones.
See how it fits your business and Get one month free.
FAQs on margin
Here are answers to some frequently asked questions about margin to help you put the numbers to work.
What is the margin formula?
The margin formula is profit divided by revenue, multiplied by 100. The result is a percentage that shows how much of your revenue becomes profit.
Is margin the same as gross profit?
No, gross profit is a dollar amount, while margin is a percentage. Gross profit margin turns that dollar figure into a percentage of your revenue.
What is the difference between margin and markup?
Margin is calculated against your selling price, and markup is calculated against your cost. That's why the same profit produces two different percentages.
What is a good profit margin?
It varies by industry, so compare your margin to similar businesses rather than one benchmark. Tracking your own margin over time is often more useful than any fixed target.
Related terms
Learn more about 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.