How to calculate margin
Learn how to calculate margin with simple formulas, S$ examples and tips to price for the profit you want.
October 2023 | Published by Xero
Published Wednesday 30 September 2026
Table of contents
Key takeaways
- To calculate margin, subtract cost from the selling price, divide by the selling price and multiply by 100
- Gross margin covers direct costs only, operating margin adds running costs, and net margin includes every expense
- Margin divides profit by the selling price and markup divides it by cost, so a 20% margin equals a 25% markup
- A good margin depends on your industry, so compare yourself with similar businesses and track your own margin over time
What is margin?

How to calculate gross profit margin
Margin is the percentage of your revenue, or a product’s selling price, that you keep as profit after covering costs. A 40% margin means you keep 40 cents of every dollar you bring in.
Margin and profit tell you different things. Profit is a dollar amount, such as S$19,000 for the quarter, while margin shows that amount as a share of revenue. That lets you compare a quiet month with a busy one on equal terms.
Your profit margin comes in three main types, and each one strips out a different layer of costs.

How to calculate net profit margin
- Gross profit margin, which subtracts only the direct costs of your products or services
- Operating profit margin, which also subtracts running costs like rent and wages
- Net profit margin, which subtracts every expense, including tax and interest
Working out all three shows you where your money goes and which costs to tackle first.
How to calculate margin
The core formula is Margin = (Selling price − Cost) ÷ Selling price × 100. Use it to work out the margin on a single product or sale.
Follow these steps to calculate margin for any product.
- Find the selling price of the product, excluding goods and services tax (GST)
- Add up what it costs you to make or buy that product
- Subtract the cost from the selling price to get your profit in dollars
- Divide that profit by the selling price
- Multiply by 100 to get your margin as a percentage
Say you sell a product for S$50 and it costs you S$30.
Profit = S$50 − S$30 = S$20
Margin = S$20 ÷ S$50 × 100 = 40%
You keep 40 cents of every dollar from that sale. To check your numbers in seconds, try Xero’s free margin calculator.
How to calculate gross profit margin
The gross profit margin formula is (Revenue − Cost of goods sold) ÷ Revenue × 100. It shows how much of your revenue is left after paying the direct costs of what you sell.
Your cost of goods sold (COGS) is the direct cost of producing or buying the things you sell. It covers raw materials, direct labour and the wholesale price of stock you resell.
Follow these five steps to calculate your gross profit margin.
- Add up your total revenue for the period
- Add up your COGS 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
Say your Singapore coffee shop brought in S$120,000 in revenue last quarter. Your COGS, including coffee beans, milk, cups and food supplies, came to S$45,000.
Gross profit = S$120,000 − S$45,000 = S$75,000
Gross profit margin = S$75,000 ÷ S$120,000 × 100 = 62.5%
So for every dollar of revenue, you keep 62.5 cents to cover rent, wages and other expenses. If your gross margin shrinks over time, check whether supplier costs have risen or your prices need a review.
How to calculate operating profit margin
The operating profit margin formula is (Gross profit − Operating expenses) ÷ Revenue × 100. It shows how well your day-to-day operations turn revenue into profit, before tax and interest.
Operating expenses are the costs of running your business, such as rent, wages, utilities, marketing and insurance. Tax and interest sit outside this figure.
Use these steps to work out your operating profit margin.
- Calculate your gross profit by subtracting COGS from revenue
- Add up your operating expenses for the same period
- Subtract operating expenses from gross profit to get your operating profit
- Divide operating profit by revenue and multiply by 100
Back at the coffee shop, your quarterly operating expenses were S$15,000 in rent, S$30,000 in wages and S$5,000 for utilities and insurance.
Operating expenses = S$15,000 + S$30,000 + S$5,000 = S$50,000
Operating profit = S$75,000 − S$50,000 = S$25,000
Operating profit margin = S$25,000 ÷ S$120,000 × 100 = 20.8%
Because it leaves out tax and financing costs, operating margin is handy for comparing your performance with similar businesses. You can pair it with other profitability ratios to see how efficiently you run.
How to calculate net profit margin
The net profit margin formula is (Revenue − Total expenses) ÷ Revenue × 100. It shows the share of revenue left after every cost, including COGS, operating expenses, tax and interest.
Follow these steps to calculate your net profit margin.
- Add up your total revenue for the period
- Add up all your expenses, including COGS, rent, wages, utilities, insurance, interest and tax
- Subtract total expenses from revenue to get your net profit
- Divide net profit by revenue
- Multiply by 100 to get a percentage
Here’s what the coffee shop’s full expenses looked like for the quarter.
- S$45,000 for COGS
- S$15,000 for rent
- S$30,000 for wages
- S$5,000 for utilities and insurance
- S$6,000 for tax and interest
Total expenses = S$101,000
Net profit = S$120,000 − S$101,000 = S$19,000
Net profit margin = S$19,000 ÷ S$120,000 × 100 = 15.8%
You keep 15.8 cents of every dollar after all costs, which is your true bottom line. Use it as your headline figure when you measure profitability across your business.
What 10%, 20% and 30% margins mean
A margin percentage tells you how many dollars of profit you keep from every S$100 of revenue. Here’s what common margins look like in practice.
- A 10% margin leaves S$10 profit and S$90 in costs on every S$100 of revenue
- A 20% margin leaves S$20 profit and S$80 in costs on every S$100 of revenue
- A 30% margin leaves S$30 profit and S$70 in costs on every S$100 of revenue
To set a price that hits a target margin, work backwards from your cost. Write the target margin as a decimal, so 20% becomes 0.20.
Price = Cost ÷ (1 − Target margin)
Say a product costs you S$40 and you want a 20% margin.
Price = S$40 ÷ (1 − 0.20) = S$40 ÷ 0.80 = S$50
For a 30% margin on the same product, the price becomes S$40 ÷ 0.70 = S$57.14.
Adding 20% to your cost instead gives you a S$48 price and only a 16.7% margin. That’s why you divide by (1 − margin) rather than adding the percentage to cost.
Margin vs markup
Margin divides your profit by the selling price, while markup divides it by the cost. The same sale gives you two different percentages, so it pays to know which one you’re using.
Say you buy a product for S$60 and sell it for S$100.
Margin = (S$100 − S$60) ÷ S$100 × 100 = 40%
Markup = (S$100 − S$60) ÷ S$60 × 100 = 66.7%
Is a 20% margin the same as a 25% markup? Yes: if a product costs S$80 and sells for S$100, your S$20 profit is 20% of the price and 25% of the cost.
Use these formulas to convert between the two, with percentages written as decimals.
Markup = Margin ÷ (1 − Margin)
Margin = Markup ÷ (1 + Markup)
For example, a 40% margin converts to 0.40 ÷ 0.60, which is a 66.7% markup. For more worked comparisons, see Xero’s explainer on margin vs markup.
What is a good profit margin?
A good profit margin depends on your industry and business model. As a rule of thumb, Brex treats a 5% net margin as low, 10% as healthy and 20% as high.
NYU Stern’s margins by sector data for January 2026 shows these average net margins for US-listed companies.
- 5.61% for general retail
- 1.32% for grocery and food retail
- 9.37% for restaurants and dining
- 5.94% for engineering and construction
- 25.49% for system and application software
- 9.74% for the total market
Singapore small businesses may see different margins from these large US companies. Compare yourself with businesses in your own industry, and ask your accountant what’s realistic for your sector.
Track your own margin over time, too: a steady or rising figure shows your pricing and costs are on track.
Hidden costs that affect your margin
Some costs are easy to miss, and each one lowers the profit you keep. Include these in your cost figures so your margin reflects what you really earn.
- Platform, marketplace and card payment fees
- Delivery and packaging costs
- Returns and refunds
- Discounts and promotions
- Wastage and spoilage, especially for food businesses
For example, if a S$50 sale with S$20 profit carries a S$1.50 payment fee, your margin drops from 40% to 37%.
How to improve your profit margins
Once you know your margins, you can take practical steps to increase profits. Each approach below targets either your costs or the revenue you earn per sale.
Reduce your cost of goods sold
Look for ways to lower the direct cost of what you sell. You could negotiate better rates with suppliers, buy in bulk or find materials of the same quality at a lower price. Savings here flow straight into your gross margin.
Review your pricing
Prices set once and left alone can drift below what your costs require. Factor in the marginal cost of producing one more unit, and check what similar businesses charge.
A small price rise can make a big difference. A 5% rise on a product with a 10% margin lifts profit per sale by 50%, assuming your costs and sales volume stay the same. On a S$100 product costing S$90, profit grows from S$10 to S$15.
Cut unnecessary expenses
Go through your operating expenses line by line. Cancel subscriptions you don’t use, and renegotiate contracts for insurance, internet or office supplies.
Upsell and cross-sell
Raising your average sale value spreads your fixed costs across more revenue. Offer add-ons, bundles or premium versions of what you already sell. Since you’ve already won the customer, the extra sale costs less to make.
Use accounting software to track margins
Accounting software brings your sales and costs together automatically, so you can check your margins whenever you need to. You’ll spot a shrinking margin early and act before it affects your cash flow.
Track your margins with Xero
Knowing your margins helps you price with confidence and keep costs organised. With Xero, you can run profit and loss reports in a few clicks and track your gross, operating and net margins over time.
Xero’s financial reports let you compare performance month to month or year on year. Try Xero today and get one month free to see your margins clearly.
FAQs on how to calculate margin
Here are answers to common questions about calculating margin.
What’s the difference between gross and net profit margin?
Gross profit margin subtracts only your COGS, while net profit margin subtracts every expense. A healthy gross margin paired with a thin net margin usually points to high overheads such as rent or wages.
Does profit margin include taxes?
Net profit margin is calculated after tax, so it accounts for the tax you pay. Gross and operating profit margins are both calculated before tax.
How often should you calculate your profit margin?
Review your margins at least monthly, alongside your profit and loss report. Check more often, such as weekly, when you change prices, switch suppliers or run a promotion.
Can you have a negative profit margin?
Yes, a negative margin means your costs are higher than your revenue, so you’re making a loss. It can happen in a new business or a slow season, and if it lasts, review your pricing and costs.
Does GST affect profit margin calculations?
Use GST-exclusive figures, because if you’re GST-registered, the 9% GST you collect is paid to the Inland Revenue Authority of Singapore (IRAS). The GST on your business purchases is usually claimed as input tax, so it isn’t part of your costs either.
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.