How to Calculate Profit Margin: Gross and Net Margin Formulas
How to calculate profit margin step by step: gross, operating and net margin formulas, a worked example, per-invoice margins and pricing for a target margin.
Quick answer: To calculate profit margin, divide profit by revenue and multiply by 100. Gross margin = (revenue minus cost of goods sold) divided by revenue. Net margin = net profit divided by revenue. For example, $33,000 of net profit on $180,000 of revenue gives a net profit margin of 18.3%.
Knowing how to calculate profit margin tells you how much of every dollar you invoice actually stays in the business. Revenue can grow while margins quietly shrink, so this is one of the most useful numbers a small business owner can track. This guide covers the gross, operating and net margin formulas, a full worked example, how to check the margin on a single invoice, and how to price new work for a target margin. If the difference between revenue and profit is new to you, read revenue vs profit first.
The numbers in this guide come from two places: the invoices you send and your profit and loss report. The free invoice generator helps with the first by keeping prices, tax and totals on separate lines, which makes margin calculations straightforward.
What is profit margin?
Profit margin is profit expressed as a percentage of revenue. A 25% margin means that for every $100 of sales, $25 is left as profit at the level you are measuring. Because it is a ratio, margin lets you compare months of different sizes, compare jobs with each other, and spot problems that raw dollar figures hide.
There are three common margins, each using a different line from the income statement. They form a ladder: gross margin is always the highest, operating margin sits in the middle, and net margin is lowest, because each step down subtracts more costs.
| Margin | Formula | Costs subtracted | What it tells you |
|---|---|---|---|
| Gross margin | (Revenue minus COGS) divided by Revenue x 100 | Direct costs only: materials, subcontractors, direct labor | Whether your pricing covers the cost of delivering the work |
| Operating margin | Operating profit divided by Revenue x 100 | Direct costs plus overheads: rent, software, marketing, admin salaries | How efficiently the business runs day to day |
| Net margin | Net profit divided by Revenue x 100 | Everything, including interest and income taxes | How much of each sales dollar the owner actually keeps |
Why margins differ so much between business types
There is no universal "good" profit margin, because the cost structure of each business model is different. A consultant, copywriter or bookkeeper sells mostly their own time and has very few direct costs, so gross margin can be high, and the real pressure is on overheads and the owner's pay. A retailer, caterer or contractor buys materials or stock for every sale, so gross margin is naturally lower and small changes in supplier prices move it quickly. A business that relies heavily on subcontractors sits somewhere in between.
That is why the most useful comparisons are your own margins over time, and margins of businesses with a similar model and size. Industry benchmark reports exist, but they mix very different firms, so treat any single figure as a rough reference point rather than a target.
For a deeper comparison of the two most common measures, see gross profit vs net profit.
Gross profit margin formula
Gross margin = (Revenue minus Cost of goods sold) divided by Revenue x 100
Cost of goods sold (COGS), sometimes called cost of sales or direct costs, includes only the costs that rise and fall with each job or product. For a product business that means inventory, materials and freight in. For a service business it usually means subcontractors, direct staff time, and materials used on client work. Our guide to cost of goods sold explains what belongs in it.
Gross margin is the number to watch when setting prices. If it is too thin, no amount of overhead cutting will make the business healthy.
Net profit margin formula
Net margin = Net profit divided by Revenue x 100
Net profit is the bottom line of your profit and loss statement: revenue minus COGS, minus operating expenses, minus interest and income taxes. It is the truest measure of overall profitability, but it is also affected by financing choices and tax, so many owners track operating margin alongside it.
Operating margin in between
Operating margin = Operating profit divided by Revenue x 100, where operating profit is gross profit minus operating expenses. It excludes interest and taxes, which makes it handy for comparing performance from year to year even if your loan or tax position changes.
How to calculate profit margin step by step
- Pick the period. Use a full month, quarter or year so revenue and costs line up.
- Find net revenue. Start with total invoiced sales, then subtract credit notes, refunds and discounts. Exclude sales tax or VAT collected, because that money is not yours.
- Total your direct costs. Add up COGS for the same period.
- Calculate gross profit and gross margin. Revenue minus COGS, then divide by revenue.
- Subtract operating expenses. This gives operating profit. Divide by revenue for operating margin.
- Subtract interest and taxes. This gives net profit. Divide by revenue for net margin.
- Compare. Look at the same margins for previous periods to see whether you are improving.
Set up a simple monthly margin tracker
You do not need special software. A spreadsheet with one row per month and columns for revenue, COGS, gross profit, gross margin, operating expenses, operating profit, operating margin and net margin is enough. Fill it from your profit and loss report on the same day each month, add a column for notes such as "large one-off job" or "annual software renewal", and look at a rolling three-month average so one unusual month does not cause panic or false comfort.
If you use cash-basis books, margins can swing month to month based on when customers pay. Our guide to cash vs accrual accounting explains why accrual figures give a steadier picture.
Worked example: a small design agency's year
Here is a full calculation for a hypothetical design agency with one owner, a part-time assistant and freelance subcontractors.
| Line | Amount | Margin |
|---|---|---|
| Revenue (invoiced, excluding sales tax) | $180,000 | 100% |
| Cost of goods sold: subcontractors, print, stock assets | ($72,000) | |
| Gross profit | $108,000 | 60.0% |
| Rent | ($18,000) | |
| Software and subscriptions | ($6,000) | |
| Marketing | ($9,000) | |
| Assistant wages and admin | ($30,000) | |
| Operating profit | $45,000 | 25.0% |
| Interest on equipment loan | ($3,000) | |
| Income taxes | ($9,000) | |
| Net profit | $33,000 | 18.3% |
The arithmetic: $180,000 minus $72,000 = $108,000, and $108,000 divided by $180,000 = 60%. Operating expenses total $18,000 + $6,000 + $9,000 + $30,000 = $63,000, so operating profit is $108,000 minus $63,000 = $45,000, and $45,000 divided by $180,000 = 25%. Finally, $45,000 minus $3,000 minus $9,000 = $33,000, and $33,000 divided by $180,000 = 18.33%.
Comparing two years side by side
Margins become far more useful once you have a second period to compare. Suppose the following year the agency grows revenue to $200,000, but subcontractor rates rise and COGS reaches $88,000. Gross profit is $200,000 minus $88,000 = $112,000, a gross margin of 56%. Revenue grew by 11%, and gross profit still rose by $4,000, yet each dollar of sales now keeps four cents less. If overheads also rose to $70,000, operating profit would be $112,000 minus $70,000 = $42,000, or 21%, lower than the year before in both dollars and percentage. Without the margin calculation, the owner might celebrate the higher sales and miss the squeeze.
What the agency learns: its 60% gross margin is healthy for service work, but overheads consume 35 percentage points of it. A 10% rise in rent and software would barely move gross margin, yet it would cut operating margin noticeably. That is why tracking all three levels matters.
How to calculate the margin on a single invoice
Annual margins tell you how the business did. Per-job margins tell you which work to chase. Before sending a quote or a large invoice, run the gross margin on that job alone.
Example: the agency invoices a brand refresh at $2,500 plus sales tax. Direct costs were $650 for a freelance illustrator and $400 for printing, a total of $1,050. Gross profit is $2,500 minus $1,050 = $1,450, so the job's gross margin is $1,450 divided by $2,500 = 58%, slightly below the agency's 60% average. Note that the sales tax on the invoice is ignored: use the sales tax calculator to separate tax from the price if your totals include it.
If a job type consistently comes in below your average margin, that is a pricing problem, not a volume problem. Our guides on how to raise prices and value-based pricing cover what to do next.
Margin vs markup: the most expensive confusion
Markup is profit as a percentage of cost; margin is profit as a percentage of price. They are not interchangeable.
| Cost | Price | Profit | Markup (profit / cost) | Margin (profit / price) |
|---|---|---|---|---|
| $100 | $125 | $25 | 25% | 20% |
| $100 | $150 | $50 | 50% | 33.3% |
| $100 | $200 | $100 | 100% | 50% |
| $100 | $250 | $150 | 150% | 60% |
An owner who wants a 50% margin but adds a 50% markup ends up at 33.3%. Our full guide to markup vs margin includes conversion formulas.
Pricing for a target margin
To find the price that hits a target margin, use: Price = Cost divided by (1 minus target margin).
For the $1,050 job above, a 60% target gives $1,050 divided by 0.40 = $2,625. Check: $2,625 minus $1,050 = $1,575, and $1,575 divided by $2,625 = 60%. By contrast, adding 60% to cost gives $1,680, a margin of only 37.5%.
How to improve your profit margin
- Raise prices on low-margin work. Small increases on your weakest jobs often do more than chasing new clients.
- Reprice by value, not hours, for work where your expertise delivers a measurable result.
- Cut direct costs. Renegotiate subcontractor rates, reduce rework and scope creep, and bill for out-of-scope requests.
- Control overheads. Review subscriptions and fixed costs; our guide to fixed vs variable costs helps you see which ones scale.
- Bill everything you are owed. Reimbursable expenses, rush fees and late fees left off invoices come straight out of margin.
- Collect faster. Unpaid invoices do not change accrual margin, but bad debts do. Our sibling guide to the allowance for doubtful accounts shows how losses hit profit.
The U.S. Small Business Administration's guide to managing your finances recommends regularly comparing money in and money out to keep profit and loss in balance, which is exactly what margin tracking does.
Common profit margin mistakes
- Including sales tax in revenue, which inflates revenue and distorts every margin.
- Leaving the owner's time out of costs. A sole proprietor's 60% margin may hide the fact that no salary has been paid. See how to pay yourself as a business owner.
- Mixing periods, such as a month of revenue against a quarter of costs.
- Using markup and margin interchangeably when quoting.
Invoice clearly to track margins accurately
Learning how to calculate profit margin is only useful if your revenue figures are clean. Invoices that separate the price, discounts and tax make it simple to pull net revenue for any job or period. Create yours with the invoice generator, pick a layout from the invoice templates, and run the margin on every job before you hit send. It is free, needs no account, and exports a print-ready PDF invoice.
Frequently asked questions
What is the formula for profit margin?
Profit margin is profit divided by revenue, multiplied by 100 to give a percentage. The profit figure you use determines the type of margin. Gross margin uses revenue minus cost of goods sold. Operating margin uses operating profit after overheads. Net margin uses net profit after every expense, including interest and taxes. For example, $33,000 of net profit on $180,000 of revenue is a net margin of about 18.3%.
How do I calculate gross profit margin?
Subtract the direct cost of delivering your products or services from revenue to get gross profit, then divide gross profit by revenue and multiply by 100. If you billed $180,000 and spent $72,000 on materials, subcontractors and other direct costs, gross profit is $108,000 and gross margin is $108,000 divided by $180,000, which is 60%. Gross margin shows how much each sales dollar leaves to cover overheads and profit.
How do I calculate net profit margin?
Take total revenue, subtract every expense for the period, including cost of goods sold, overheads, interest and income taxes, to get net profit. Divide net profit by revenue and multiply by 100. A business with $180,000 of revenue and $147,000 of total costs has $33,000 of net profit, and a net margin of 18.3%. Net margin is the most complete measure of how profitable the business is overall.
What is a good profit margin for a small business?
There is no single good number, because margins vary widely by industry. Service businesses with few direct costs, such as consulting or design, usually have much higher gross margins than retailers, restaurants or construction firms that buy materials. The most useful benchmark is your own trend over time and comparisons with businesses of a similar type and size. A falling margin is a signal to review pricing or costs.
What is the difference between margin and markup?
Margin is profit as a percentage of the selling price; markup is profit as a percentage of cost. If something costs $100 and sells for $150, the profit is $50. Markup is $50 divided by $100, or 50%. Margin is $50 divided by $150, or 33.3%. Markup is always the larger number for the same sale, which is why confusing the two can leave your prices too low.
How do I set a price to hit a target profit margin?
Divide your cost by one minus the target margin expressed as a decimal. If a job costs $1,050 to deliver and you want a 60% gross margin, the price is $1,050 divided by 0.40, which is $2,625. Check it: $2,625 minus $1,050 is $1,575 of gross profit, and $1,575 divided by $2,625 is 60%. Do not simply add 60% to cost, which gives a much lower margin.
Should sales tax be included when calculating profit margin?
No. Sales tax or VAT collected from customers is money you hold for the government, not revenue, so exclude it from the revenue figure. If an invoice totals $2,700 including $200 of tax, use $2,500 as revenue in your margin calculation. Including the tax would overstate revenue and make your margin look different from what your profit and loss statement shows.
Can profit margin be negative?
Yes. If costs exceed revenue, profit is negative and so is the margin. A negative gross margin means you are losing money on each sale before overheads, which usually points to underpricing or rising direct costs. A positive gross margin with a negative net margin means individual jobs are profitable but overheads are too high for current sales volume. Each situation calls for a different fix.
How often should I calculate my profit margins?
Monthly is a practical rhythm for most small businesses, using your profit and loss statement. Also calculate gross margin on each quote or large invoice before you send it, so you catch underpriced work early. Comparing the same month across years helps if your business is seasonal. Quarterly reviews with your accountant can then focus on trends rather than one-off swings.
Invoice Creator Editorial Team
Guides on invoicing, cash flow and small-business finance from Invoice Creator, operated by Next Software Development Company. Content is reviewed for accuracy against the fields our own invoice generator produces.
Try the invoice generator