Get MTD for Income Tax ready
80% off your first 6 months + a £25 voucher offer

Get a £25 voucher when you send your first quarterly update to HMRC through Xero by the 7 August 2026 deadline. Voucher offer ends 7 August. Terms apply

Quarterly update due in

How to calculate margin

Learn how to calculate margin with simple formulas, worked examples and practical tips for your business.

October 2023 | Published by Xero

Published Thursday 23 July 2026

Table of contents

Key takeaways

  • Margin measures the percentage of revenue that turns into profit, and it's one of the most useful metrics for understanding your business's financial health
  • There are 3 main types of profit margin: gross, operating and net, each giving you a different view of where your money goes
  • Margin and markup are often confused, but they use different base figures; margin is calculated from revenue, while markup is calculated from cost
  • Tracking your margins regularly helps you spot trends, set better prices and make more informed decisions about your business

What is margin?

Gross profit margin formula shows gross profit divided by sales revenue, times 100, equals gross profit margin.

How to calculate gross profit margin

If you're running a small business, understanding how to calculate profit margin is essential for making smart pricing and spending decisions. Margin tells you what percentage of your revenue is left as profit after costs are deducted.

In simple terms, margin is profit divided by revenue, expressed as a percentage. A higher margin means you're keeping more of each pound you earn. A lower margin means more of your revenue is going towards costs.

There are several types of profit margin, and each one gives you a different picture of your business's performance. The 3 most common are gross profit margin, operating profit margin and net profit margin.

Formula for net profit margin shows that net profit divided by revenue, times 100, equals net profit margin.

How to calculate net profit margin

Types of profit margin

Each type of profit margin strips out a different layer of costs, so you can see exactly where your money goes. Here's how the 3 main types work.

Gross profit margin

Gross profit margin shows the percentage of revenue left after you subtract your direct costs of producing goods or delivering services. These direct costs are often called cost of sales (COS) or cost of goods sold (COGS).

The formula is:

Gross profit margin = ((Revenue − Cost of sales) / Revenue) × 100

If your gross profit margin is low, it means your production or delivery costs are eating into your revenue. This is the first margin to check because it affects how much is left to cover your other business expenses.

Operating profit margin

Operating profit margin goes a step further. It deducts your operating expenses, such as rent, utilities, salaries and marketing, from your gross profit. This gives you a clearer view of how efficiently you're running your day-to-day operations.

The formula is:

Operating profit margin = ((Revenue − Cost of sales − Operating expenses) / Revenue) × 100

This margin is useful for comparing how well your business performs before interest and tax are factored in.

Net profit margin

Net profit margin is the bottom line. It shows the percentage of revenue that remains as profit after all expenses, including tax and interest, have been deducted.

The formula is:

Net profit margin = ( / Revenue) × 100

This is the most complete measure of your business's profitability. It tells you how much actual profit you're making from every pound of revenue.

How to calculate margin step by step

Here's a worked example showing how to calculate margin for a small UK business. Suppose you run a business that sells handmade candles.

  1. Start with your revenue. Let's say you earned £50,000 in a quarter.
  2. Subtract your cost of sales. If the materials, packaging and direct labour cost you £20,000, your gross profit is £50,000 − £20,000 = £30,000.
  3. Divide gross profit by revenue. That's £30,000 / £50,000 = 0.6.
  4. Multiply by 100 to get the percentage. 0.6 × 100 = 60%.

Your gross profit margin is 60%. That means for every £1 of revenue, you keep 60p after covering direct costs.

To find your net profit margin, you'd also subtract operating expenses and tax. If those totalled £18,000, your net profit would be £12,000. Net profit margin = (£12,000 / £50,000) × 100 = 24%.

How to calculate selling price using margin

Sometimes you'll want to work backwards: you know your costs and your target margin, and you need to figure out the right selling price. This is a common task when pricing new products or reviewing your current pricing strategy.

The formula is:

Selling price = Cost / (1 − Target margin as a decimal)

For example, if a product costs you £15 to make and you want a 40% gross margin:

  1. Convert your target margin to a decimal: 40% = 0.4.
  2. Subtract it from 1: 1 − 0.4 = 0.6.
  3. Divide the cost by the result: £15 / 0.6 = £25.

You'd need to set a selling price of £25 to achieve a 40% gross profit margin on that product.

Margin vs markup: what is the difference?

Margin and markup are closely related, and it's easy to mix them up. Both measure the relationship between cost and selling price, but they use different base figures, which leads to different percentages.

Margin is calculated as a percentage of the selling price (revenue). Markup is calculated as a percentage of the cost. This distinction matters because using the wrong one can lead to pricing errors that eat into your profits.

Here's a worked example. A product costs £40 and sells for £60:

  • Profit: £60 − £40 = £20
  • Margin: (£20 / £60) × 100 = 33.3%
  • Markup: (£20 / £40) × 100 = 50%

The same £20 profit gives you a 33.3% margin but a 50% markup. If you're setting prices, use margin when you want to know how much of each sale is profit. Use markup when you want to know how much you've added on top of your costs.

What is a good profit margin?

There's no single answer to what counts as a good profit margin, because it varies significantly between industries. A service-based business with low overheads might aim for a net profit margin of 15% to 20%, while a retail or manufacturing business dealing with physical stock might consider 5% to 10% a solid result.

In the UK, typical gross profit margins for small businesses often fall between 50% and 70% for service businesses, and 30% to 50% for product-based businesses. However, these are broad ranges and your specific figures will depend on your sector, pricing strategy and cost structure.

Rather than comparing yourself to a universal benchmark, track your own margins over time. If they're trending upward, you're likely managing costs well and pricing effectively. If they're dropping, it's a signal to investigate what's changed.

How to improve your profit margin

If your margins aren't where you'd like them to be, there are several practical steps you can take. Here are 4 strategies that work well for small businesses.

Review your pricing. If your costs have risen but your prices haven't, your margins will shrink. Regularly compare your prices to your costs and to what competitors are charging. Even small price adjustments can have a noticeable impact on profitability.

Reduce your cost of sales. Look at your direct costs and consider whether you can negotiate better rates with suppliers, reduce waste or find more cost-effective materials without compromising quality.

Cut unnecessary overheads. Review your operating expenses for subscriptions, services or processes you're paying for but not fully using. Automating tasks like invoicing and bank reconciliation can also save time and reduce admin costs.

Focus on higher-margin products or services. Not everything you sell will deliver the same margin. Identify which products or services are most profitable and consider shifting your focus towards them.

How to calculate margin in Excel

If you use spreadsheets to manage your finances, calculating margin in Excel is straightforward. Here's how to set it up.

  1. Enter your revenue in cell A1 (for example, 50000).
  2. Enter your cost of sales in cell B1 (for example, 20000).
  3. In cell C1, enter the formula =(A1-B1)/A1 to calculate the margin as a decimal.
  4. Format cell C1 as a percentage by right-clicking, selecting "Format Cells" and choosing "Percentage".
  5. The cell will now display your gross profit margin as a percentage.

You can also try the Xero margin calculator for quick results, or replicate this across multiple rows to calculate margins for different products, services or time periods. For net profit margin, add a column for total expenses and adjust the formula to =(A1-B1-D1)/A1, where D1 contains your operating expenses and tax.

Track your margins with Xero

Calculating margin manually or in spreadsheets works, but it takes time and introduces the risk of errors. Cloud accounting software can automate the process and give you real-time visibility into your profit margins.

Xero pulls in your bank transactions, tracks your income and expenses, and generates profit and loss reports so you can see your margins at a glance. With features like customisable reporting and Analytics Plus, you can dig deeper into margin trends across products, services or time periods. Get one month free.

FAQs on calculating margin

Here are some frequently asked questions about calculating margin.

What is a good profit margin for a small business in the UK?

It depends on your industry, but most small businesses in the UK aim for a net profit margin between 5% and 20%. Service businesses tend to have higher margins than those selling physical products due to lower direct costs.

How do I convert margin to markup?

Divide your margin percentage by (1 minus the margin percentage). For example, a 25% margin equals a markup of 0.25 / 0.75 = 33.3%. This conversion is useful when you need to switch between pricing approaches.

Can my profit margin be negative?

Yes, a negative margin means your costs exceed your revenue, so you're making a loss. If this happens, review your pricing, cost of sales and operating expenses to identify where the problem lies.

Should I track gross margin or net margin?

Track both, as they tell you different things. Gross margin shows whether your pricing covers direct costs, while net margin reveals your overall profitability after all expenses. Monitoring both helps you pinpoint exactly where to make improvements.

Handy resources

Advisor directory

You can search for experts in our advisor directory

Find an advisor

Explore our guides

Find guides with expert advice and tools to help manage and grow your business

Browse all guides

Financial reporting

Keep track of your performance with accounting reports

Find out more

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.