Short answer
Profit margin is profit divided by revenue, times 100. Gross margin uses revenue minus direct costs. Net margin also subtracts overhead and tax. Example month: $24,000.00 of revenue less $9,600.00 of direct costs is $14,400.00, a 60% gross margin. Less $10,800.00 of overhead leaves $3,600.00, a 15% net margin before tax.
- Margin always divides by revenue (the price). Dividing profit by cost gives markup, a different number.
- Gross margin = (revenue - direct costs) / revenue. Example month: 60%.
- Net margin = (revenue - all costs) / revenue. The same month keeps 15% before tax.
- A $778.46 price on $506.00 of full cost implies a 35% margin; $650 implies 22.15%.
- Every figure here is an example assumption. Type your own into the calculator.
On this page
- How do you calculate profit margin?
- Profit margin calculator (free, no signup)
- Worked example: gross margin and net margin for one month
- Gross margin vs net margin on a single job
- What profit margin does your price imply?
- How do I calculate a 20%, 30% or 40% profit margin?
- Profit margin formula in Excel and Google Sheets
- Common profit margin mistakes
- Is a 40% profit margin high?
- Calculator, spreadsheet or P&L template: which do you need?
- Step-by-step
- FAQ
How do you calculate profit margin?
Subtract costs from revenue to get profit, divide the profit by revenue, and multiply by 100. Which costs you subtract decides which margin you have: gross, operating or net.
| Margin | Formula | Example month |
|---|---|---|
| Gross margin | (Revenue - direct costs) / revenue | ($24,000.00 - $9,600.00) / $24,000.00 = 60% |
| Operating margin | (Gross profit - operating expenses) / revenue | ($14,400.00 - $10,800.00) / $24,000.00 = 15% |
| Net margin | (Operating profit - tax) / revenue | 15% with no tax line; 11.25% after a 25% reserve |
Direct costs (also called cost of goods sold, or COGS) are what you spend only because the work happened: materials, subcontractors, and the wages of the people doing the job. Operating expenses are the bills that arrive anyway: rent, insurance, software, the phone, the truck payment.
Most online margin calculators ask for one cost and one price. That answers the question for a product on a shelf. A service business has two layers of cost, so it has two margins, and the gap between them is where the money goes. I build spreadsheet maths; I am not an accountant, and this is not tax advice.
Profit margin calculator (free, no signup)
Type revenue, direct costs and operating expenses for a month, a quarter or a single job. The calculator returns gross profit, gross margin, operating profit and operating margin. It starts on the example month used in this guide.
To use it as a gross margin calculator only, leave operating expenses at 0. The gross and operating figures will then match. For net margin after tax, subtract your tax reserve from operating profit and divide by revenue. Nothing you type leaves your browser.
Worked example: gross margin and net margin for one month
On $24,000.00 of revenue, $9,600.00 of direct costs and $10,800.00 of operating expenses, the month has a 60% gross margin and a 15% net margin before tax. Every input is an assumption; replace each one with your own books.
Worked example: One month for an example service business (assumed figures, no tax line)
| Item | Value |
|---|---|
| Tax reserve % (input) | 0% |
| Revenue (input) | $24,000.00 |
| Cost of goods / direct costs (input) | $9,600.00 |
| Operating expenses (input) | $10,800.00 |
| Gross profit | $14,400.00 |
| Gross margin | 60% |
| Operating profit | $3,600.00 |
| Operating margin | 15% |
| Tax | $0.00 |
| Net profit | $3,600.00 |
| Net margin | 15% |
Computed with the same formulas as the free calculators on this site. Change any input in the calculator above to see your own numbers.
Read the two numbers together. The work itself keeps 60 cents of every sales dollar. Overhead then takes 45 cents ($10,800.00 / $24,000.00), which leaves 15 cents. A gross margin calculator alone would have reported 60% and stopped there.
Tax moves the net figure again. If you set aside 25% of operating profit as a reserve (an assumed rate, not advice; yours depends on your structure and income), the reserve is $900, net profit is $2,700 and net margin is 11.25%.
The same two rows also give the sales you need before any profit appears. Break-even revenue is operating expenses divided by gross margin: $10,800.00 / 0.60 = $18,000. This month cleared it by $6,000. The break-even calculator guide turns that into jobs per month.
Gross margin vs net margin on a single job
A job has both margins too. Gross margin counts only the job's labour and materials. Net margin also counts the job's share of overhead. Quote from the net figure, because overhead is paid whether or not you remember it.
Worked example: One 8-hour job priced for a 35% margin (assumed inputs - use your own)
| Item | Value |
|---|---|
| Workers (input) | 1 |
| Hourly wage paid (input) | $25.00 |
| Labour burden % (input) | 30% |
| Materials (input) | $180.00 |
| Overhead for the year (input) | $14,520.00 |
| People in the field (input) | 1 |
| Billable days a year (input) | 220 |
| Target margin % (input) | 35% |
| Jobs a week (input) | 3 |
| Hours on the job (input) | 8 |
| Loaded labour rate (per hour) | $32.50 |
| Crew-hours | 8 |
| Labour cost | $260.00 |
| Overhead per sellable hour | $8.25 |
| Overhead share | $66.00 |
| Break-even cost | $506.00 |
| Price to quote | $778.46 |
| Profit on the job | $272.46 |
| Price if you MARK UP instead | $683.10 |
| Margin you actually keep with markup | 25.93% |
| Lost per job by marking up | $95.36 |
| Lost per year by marking up | $14,876.40 |
Computed with the same formulas as the free calculators on this site. Change any input in the calculator above to see your own numbers.
The job costs $260.00 of loaded labour and $180.00 of materials, so its direct cost is $440.00. Its overhead share is $66.00 (8 hours at $8.25 per sellable hour). Full cost is $506.00. Priced at $778.46, here is the same job as a three-line profit check:
Worked example: The same job read as a mini P&L: price, direct cost, overhead share
| Item | Value |
|---|---|
| Tax reserve % (input) | 0% |
| Revenue (input) | $778.46 |
| Cost of goods / direct costs (input) | $440.00 |
| Operating expenses (input) | $66.00 |
| Gross profit | $338.46 |
| Gross margin | 43.48% |
| Operating profit | $272.46 |
| Operating margin | 35% |
| Tax | $0.00 |
| Net profit | $272.46 |
| Net margin | 35% |
Computed with the same formulas as the free calculators on this site. Change any input in the calculator above to see your own numbers.
The job shows a 43.48% gross margin and a 35% net margin. If you only tracked direct costs you would believe you kept 43 cents on the dollar. You kept 35. The 8.48 points between them is the overhead share ($66.00 / $778.46).
Two inputs carry most of the risk. The labour figure must be the loaded rate, not the wage; the labor burden calculator guide builds it line by line. The overhead share comes from dividing a year of overhead by the hours you can sell; the overhead and profit calculator guide shows that division.
What profit margin does your price imply?
Take the price, subtract the full cost, and divide by the price. On a full cost of $506.00, a $650 price implies a 22.15% margin and a $700 price implies 27.71%. This is the check to run on a price you were about to send.
| Price | Profit after all costs | Net margin | Gross margin |
|---|---|---|---|
| $600.00 | $94.00 | 15.67% | 26.67% |
| $650.00 | $144.00 | 22.15% | 32.31% |
| $700.00 | $194.00 | 27.71% | 37.14% |
| $778.46 | $272.46 | 35.00% | 43.48% |
| $850.00 | $344.00 | 40.47% | 48.24% |
| $1,000.00 | $494.00 | 49.40% | 56.00% |
The curve is not a straight line. Going from $600 to $700 adds 12.04 points of margin. Going from $850 to $1,000, a bigger price rise, adds 8.93 points. Each extra dollar of price is pure profit, but it is divided by a larger price.
It also shows what a discount costs. Knock $78.46 off the $778.46 price to land on a round $700 and profit falls from $272.46 to $194.00. That is a 10.08% price cut and a 28.80% profit cut.
How do I calculate a 20%, 30% or 40% profit margin?
Divide the full cost by one minus the margin. For a 20% margin divide by 0.80, for 30% by 0.70, for 40% by 0.60. Multiplying the cost by 1.20, 1.30 or 1.40 is a markup and always gives a lower price.
| Target margin | Divide cost by | Price | Same price as a markup on cost |
|---|---|---|---|
| 10% | 0.90 | $562.22 | 11.11% |
| 20% | 0.80 | $632.50 | 25.00% |
| 25% | 0.75 | $674.67 | 33.33% |
| 30% | 0.70 | $722.86 | 42.86% |
| 35% | 0.65 | $778.46 | 53.85% |
| 40% | 0.60 | $843.33 | 66.67% |
| 50% | 0.50 | $1,012.00 | 100.00% |
Check any row by working backwards: ($843.33 - $506.00) / $843.33 = 40.00%. The last column is the reason people underprice. Adding 35% to $506.00 gives $683.10, which keeps 25.93%, not 35%. I keep this section short on purpose; the markup vs margin calculator guide has the full conversion chart.
Profit margin formula in Excel and Google Sheets
Put revenue, direct costs and operating expenses in three cells and let four formulas do the rest. The same syntax works in Excel and Google Sheets. Format the margin cells as percentages.
Gross profit
=B2-B3B2 = revenue, B3 = direct costs (COGS). Returns 14,400 for the example month.
Gross margin %
=IFERROR((B2-B3)/B2,0)Format as a percentage. Returns 60.00% for the example month.
Net margin % before tax
=IFERROR((B2-B3-B4)/B2,0)B4 = operating expenses. Returns 15.00% for the example month.
Margin a price implies
=IFERROR((B6-B7)/B6,0)B6 = the price you plan to quote, B7 = full cost including overhead share. 650 and 506 return 22.15%.
Price for a target margin
=B7/(1-B8)B8 = target margin as a decimal or percentage cell. 506 and 35% return 778.46.
Wrap each division in IFERROR so an empty month shows 0% instead of an error. For a year-to-date margin, divide the year-to-date profit by the year-to-date revenue. Never average the monthly percentages: a big month and a small month do not carry equal weight.
Common profit margin mistakes
The usual error is dividing by the wrong number. Margin divides by revenue. Divide by cost and you have a markup, which reads higher and makes a thin job look healthy.
- Calling gross margin "profit margin". The example month has a 60% gross margin and a 15% net margin. Say which one you mean, especially when comparing with a published figure.
- Leaving your own labour out of direct costs. If the owner does the work and no wage is counted, gross margin is overstated by the whole value of those hours.
- Using the wage instead of the loaded rate. In the example job a $25.00 wage costs $32.50 an hour once the assumed 30% burden is added.
- Treating a loan repayment or an owner draw as an expense. Interest is an expense. Principal and draws are cash going out, not costs of the month. Ask your accountant how your entity handles owner pay.
- Averaging percentages. Divide totals by totals.
Is a 40% profit margin high?
It depends on which margin. A 40% gross margin can leave nothing if overhead takes 40% of revenue. A 40% net margin means 40 cents of every sales dollar is left after every cost, so all costs together must stay under 60% of revenue. There is no single good number.
I will not quote an industry average here, because a small firm's figures are not comparable with published ones and the ranges are wide. If you want to see how wide, NYU Stern's margins by sector table lists gross and net margins for US industry groups. Those are large listed companies, so read it as context, not as a target.
A more useful test uses your own numbers. Your gross margin has to be larger than overhead as a share of revenue. In the example month overhead is 45% of revenue, so any gross margin under 45% is a loss. At 60% the month keeps the 15 points in between.
Calculator, spreadsheet or P&L template: which do you need?
For one number, the calculator on this page is enough and you do not need to buy anything. A spreadsheet earns its place when you want the same check every month, with the break-even line and the bank balance beside it.
| Option | Suits | Watch for |
|---|---|---|
| The calculator on this page | A quick gross and net margin check | Forgets your numbers when you close the tab |
| Free job pricing calculator | Pricing one job from hours, wage, materials and overhead at a target margin | One job at a time |
| Four formulas in a blank sheet | Seeing every cell | Your time to build and check it |
| Paid P&L template | A monthly margin check with break-even revenue and a 12-month cash view | Manual entry; no bank feeds |
| Accounting software | Bank feeds, invoicing, tax reports | Usually a monthly subscription |
Small Business P&L + Cash Flow Tracker
The spreadsheet version of this guide for Excel & Google Sheets: type your numbers into the highlighted cells and the formulas do the rest. One-time $14.99, no subscription, instant download.
See the monthly P&L template →Buy now — $14.99All 7 templates — $49Instant access by email after checkout via Payhip. Want to try the maths first? Use the free job pricing calculator — no signup.
The monthly P&L template is $14.99 one-time for Excel and Google Sheets. You enter one month of revenue and costs and it returns gross profit, gross margin, net profit, net margin and break-even revenue. Its Cash Flow tab then carries opening cash, cash in, cash out and closing cash across 12 months. It does not connect to a bank or produce tax reports. The profit and loss template guide shows how to build the same layout yourself for free.
What to put in your margin sheet: revenue; direct costs with labour at the loaded rate; gross profit and gross margin; operating expenses; operating profit and margin; a tax reserve if you keep one; and break-even revenue. If you would rather start from a finished file, the profit and loss spreadsheet has those rows built.
Step-by-step: Profit Margin Calculator: Gross Margin, Net Margin and the Margin Your Price Implies
- Total the revenue. Add up what you invoiced or were paid for the period, or take the price of the single job you are checking.
- Total the direct costs. Add materials, subcontractors and labour at the loaded rate. These are costs you only have because the work happened.
- Calculate gross margin. Subtract direct costs from revenue and divide by revenue. Example: ($24,000.00 - $9,600.00) / $24,000.00 = 60%.
- Subtract operating expenses. Take rent, insurance, software, vehicles and admin off gross profit. For a single job, subtract its overhead share instead.
- Calculate net margin. Divide what is left by revenue. Example: $3,600.00 / $24,000.00 = 15% before tax. Subtract a tax reserve first if you keep one.
- Compare with your target. If the margin is below target, find the price that hits it: full cost divided by one minus the target margin.
Skip the setup: Small Business P&L + Cash Flow Tracker
The spreadsheet version of this guide for Excel & Google Sheets: type your numbers into the highlighted cells and the formulas do the rest. One-time $14.99, no subscription, instant download.
See the Small Business P&L + Cash Flow Tracker →Buy now — $14.99All 7 templates — $49Instant access by email after checkout via Payhip. Want to try the maths first? Use the free calculator — no signup.
Frequently asked questions
How do you calculate profit margin?
Subtract costs from revenue, divide the result by revenue and multiply by 100. Subtract only direct costs for gross margin, or every cost for net margin. Example: $24,000 of revenue with $9,600 of direct costs and $10,800 of overhead gives a 60% gross margin and a 15% net margin before tax.
How do I calculate net profit margin?
Net profit margin is revenue minus every cost (direct costs, operating expenses and tax), divided by revenue. In this guide's example month, $24,000 minus $9,600 minus $10,800 leaves $3,600, which is 15%. With a 25% tax reserve of $900, net profit is $2,700 and net margin is 11.25%.
How do you calculate gross margin?
Gross margin is revenue minus direct costs, divided by revenue. Direct costs are materials, subcontractors and the labour that does the work. Example: $24,000 of revenue less $9,600 of direct costs is $14,400 of gross profit, and $14,400 divided by $24,000 is a 60% gross margin.
What is 30% margin on $100?
On a $100 sale, a 30% margin is $30 of profit and $70 of cost. If $100 is your cost and you want a 30% margin, divide by 0.70: the price is $142.86 and the profit is $42.86. Adding 30% to the cost gives $130, which is only a 23.08% margin.
How do I calculate a 40% gross margin?
Divide your direct cost by 0.60. A job with $440 of direct cost needs a price of $733.33 for a 40% gross margin, because $293.33 of gross profit divided by $733.33 is 40%. Remember that overhead still has to come out of that gross profit.
Is a 40% profit margin high?
It depends on whether it is gross or net. A 40% gross margin leaves nothing if overhead takes 40% of revenue. A 40% net margin means all costs together stay under 60% of revenue. Compare your gross margin with your own overhead as a share of revenue instead of with an average.
What is the difference between gross margin and net margin?
Gross margin subtracts only the direct costs of doing the work. Net margin subtracts everything, including overhead and tax. On this guide's example job, the price of $778.46 gives a 43.48% gross margin and a 35% net margin once the $66 overhead share is counted.
How do I calculate profit margin in Excel?
With revenue in B2, direct costs in B3 and operating expenses in B4, gross margin is =(B2-B3)/B2 and net margin before tax is =(B2-B3-B4)/B2. Format both cells as percentages. Wrap each in IFERROR so an empty month shows 0% rather than an error.
Sources
- NYU Stern (Aswath Damodaran): Margins by Sector (US), data as of January 2026 — Where to look up published gross and net margins by US industry group. No figure from it is quoted in this guide.
