How to Calculate Profit Margin: Formula, Examples and Charts
By ToolNimba Editorial Team June 20, 2026 8 min read
Quick answer
To calculate profit margin, subtract your cost from your revenue, divide by the revenue, then multiply by 100. The formula is margin = (revenue - cost) / revenue x 100. If you sell an item for 100 dollars that cost you 60 dollars, the profit is 40 dollars and the margin is 40 / 100 = 40 percent. Margin always measures profit as a share of the selling price, not the cost.
Profit margin is the single most important number for knowing whether a sale, a product or a whole business actually makes money. It turns a raw profit figure into a percentage you can compare across products, months and competitors. A 40 dollar profit sounds great until you learn the sale was 5,000 dollars, which works out to less than one percent. This guide walks through the formula, three worked examples, the difference between the gross, operating and net margin, how margin differs from markup, and the mistakes that quietly distort the number.
The profit margin formula
The formula is short and worth memorising: profit margin = (revenue - cost) / revenue x 100. Revenue is the money you take in from the sale, cost is what you paid to produce or buy what you sold, and the difference between them is your profit. Dividing that profit by revenue tells you what fraction of every sales dollar you actually keep, and multiplying by 100 turns it into a clean percentage.
The detail that trips people up is the denominator. Margin always divides profit by revenue, never by cost. That is what makes it profit as a share of the selling price. Because the denominator is the larger number, a margin can never exceed 100 percent. If you ever calculate a margin above 100 percent, you have almost certainly divided by cost by mistake, which is markup, a different number we cover further down.
The core idea
Profit margin answers one question: of every dollar a customer pays you, how many cents do you keep as profit? A 30 percent margin means you keep 30 cents of every dollar and 70 cents covered your costs.
How to calculate profit margin step by step
Here is the full sequence using a product that sells for 250 dollars and costs 175 dollars to make.
- Write down the revenue, the price the customer pays. Here it is 250 dollars.
- Write down the cost, what you paid to produce or buy the item. Here it is 175 dollars.
- Subtract cost from revenue to get the profit: 250 - 175 = 75 dollars.
- Divide the profit by the revenue: 75 / 250 = 0.30.
- Multiply by 100 to get the percentage: 0.30 x 100 = 30 percent.
The profit margin is 30 percent. That same five step process works for a single item, an order, a product line or a full year of sales. Just make sure the revenue and cost figures cover exactly the same set of transactions, otherwise the percentage will not mean anything. If percentages are not your strong point, our guide on how to calculate percentage breaks down the underlying math in more detail.
Profit margin reference chart
Because margin depends on both the price and the cost, it helps to see how the percentage moves as those two numbers change. The chart below shows the profit and margin for a fixed selling price of 100 dollars at several cost levels, which makes the relationship easy to read at a glance.
Profit and margin at a 100 dollar selling price
| Cost | Profit (revenue - cost) | Profit margin |
|---|---|---|
| 90 dollars | 10 dollars | 10 percent |
| 75 dollars | 25 dollars | 25 percent |
| 60 dollars | 40 dollars | 40 percent |
| 50 dollars | 50 dollars | 50 percent |
| 30 dollars | 70 dollars | 70 percent |
| 10 dollars | 90 dollars | 90 percent |
Notice that the margin percentage and the profit dollars line up neatly here only because the price is exactly 100 dollars. At any other price the profit and the margin part ways. That is the whole point of using a percentage: it lets you compare a 25 percent margin on a 10 dollar coffee with a 25 percent margin on a 40,000 dollar car, even though the dollar profits are wildly different.
Gross, operating and net profit margin
In a real business there is not one margin but three, and they differ only in which costs you subtract before dividing by revenue. Each one answers a slightly different question, and seeing all three together tells you where the money goes.
Gross profit margin
Gross margin subtracts only the direct cost of the goods sold, the materials and labour that go straight into the product. It tells you how profitable your core product is before overhead. The formula is (revenue - cost of goods sold) / revenue x 100.
Operating profit margin
Operating margin also subtracts running costs like rent, salaries, marketing and utilities. It shows how well the business runs day to day, after the costs of actually operating but before interest and tax.
Net profit margin
Net margin subtracts everything, including interest and taxes, so it is the bottom line: the share of revenue that ends up as actual take home profit. When people say a company has a 12 percent margin without specifying which, they usually mean net margin. To go deeper on that final figure, see our guide on how to calculate net income.
- Gross margin subtracts cost of goods sold only. Best for judging a single product.
- Operating margin also subtracts overhead and running costs. Best for judging operations.
- Net margin subtracts all costs including interest and tax. Best for judging the whole business.
Margin is not the same as markup
This is the mistake that costs real money. Margin divides profit by revenue, while markup divides profit by cost. They describe the same sale but produce different percentages, and confusing them leads to underpricing. Take an item that costs 60 dollars and sells for 100 dollars. The 40 dollar profit is a 40 percent margin (40 / 100) but a 67 percent markup (40 / 60).
Markup is what you add on top of cost to reach a price; margin is what you keep out of that price. A 50 percent markup is only a 33 percent margin, not a 50 percent margin. If you set prices using a markup percentage but then report it as your margin, you will believe you are more profitable than you really are. For pricing from the cost side, our guide on how to calculate markup shows the other half of this relationship.
Margin versus markup on a 60 dollar cost
| Selling price | Profit | Markup (profit / cost) | Margin (profit / revenue) |
|---|---|---|---|
| 75 dollars | 15 dollars | 25 percent | 20 percent |
| 90 dollars | 30 dollars | 50 percent | 33 percent |
| 100 dollars | 40 dollars | 67 percent | 40 percent |
| 120 dollars | 60 dollars | 100 percent | 50 percent |
Common mistakes to avoid
The formula is simple, but a few habits quietly produce the wrong number. Check yourself against this list before you trust a margin.
- Dividing by cost instead of revenue. That gives markup, not margin, and inflates the percentage. The denominator is always revenue.
- Leaving out hidden costs. Shipping, payment processing fees, returns and packaging all eat into real margin. Include them in cost or your margin is fiction.
- Mixing up the margin types. A healthy gross margin can hide a tiny net margin once overhead and tax are subtracted. Always say which margin you mean.
- Comparing across different industries. Grocery stores live on 2 to 3 percent net margins while software can run above 30 percent. A good margin only makes sense within an industry.
- Forgetting that discounts cut margin fast. A 20 percent discount does not just shave 20 percent off profit; it can wipe out most of a thin margin entirely.
- Confusing profit with margin. Profit is a dollar amount, margin is a percentage. A big profit on a huge sale can still be a terrible margin.
Good to know: what counts as a good margin
There is no single good margin, because it depends entirely on the industry and the cost structure. As a loose rule of thumb often used for small businesses, a net margin around 5 percent is considered low, 10 percent is healthy, and 20 percent or more is strong. But context rules everything. Retailers and restaurants operate on thin margins and make money through volume, while consultancies and software firms carry far higher margins because their cost of delivery is low.
The more useful habit is to track your own margin over time and watch the direction it moves. A margin that slips month after month is an early warning that costs are creeping up or prices are not keeping pace, long before the problem shows up in your bank balance. Pairing margin with related ideas like opportunity cost gives you a fuller picture of whether a product is truly worth selling.
Check your margin after a discount
Discounts are where margins quietly disappear, so it pays to see the new price and saving before you commit to a sale. Enter your original price and the discount percentage below to see exactly what the customer pays, then recheck your margin against your cost to make sure the deal still makes money.
๐ท๏ธ Try the free tool Discount Calculator Free discount calculator finds your sale price, dollars saved, and effective percent off. Stack two coupons, reverse a discount, and add sales tax in seconds.Profit margin comes down to one move: subtract cost from revenue, divide by revenue, and multiply by 100. Keep the denominator as revenue, fold in every real cost, and be clear about whether you mean gross, operating or net. With that habit, you can price a product, judge a sale and compare a whole business with a number you can actually trust.
Frequently asked questions
How do you calculate profit margin?
Subtract your cost from your revenue to get the profit, divide that profit by the revenue, then multiply by 100. For an item sold at 100 dollars that cost 60 dollars, the profit is 40 dollars and the margin is 40 divided by 100, which equals 40 percent.
What is the difference between margin and markup?
Margin divides profit by the selling price, while markup divides profit by the cost. The same sale gives different percentages: a 60 dollar item sold for 100 dollars has a 40 percent margin but a 67 percent markup. Confusing the two leads businesses to underprice their products.
What is a good profit margin?
It depends heavily on the industry. As a rough guide for small businesses, a net margin near 5 percent is low, 10 percent is healthy, and 20 percent or higher is strong. Grocery stores run on a few percent, while software firms often exceed 30 percent.
Can profit margin be more than 100 percent?
No. Because margin divides profit by revenue and revenue is always the larger number, the result can never exceed 100 percent. If you get a figure above 100 percent, you have divided by cost by mistake, which gives markup rather than margin.
What is the difference between gross and net profit margin?
Gross margin subtracts only the direct cost of goods sold, showing how profitable the product is before overhead. Net margin subtracts every cost, including operating expenses, interest and tax, so it reflects the actual take home profit as a share of revenue.
How does a discount affect profit margin?
A discount comes straight out of your profit, so it shrinks margin faster than it shrinks price. On a thin margin, even a small discount can erase most of the profit. Always recheck the discounted price against your cost before running a sale.