Find the gross margin and markup on a job from its cost and price, the price that hits a target margin, or your business’s net margin from revenue and all costs.
For freelancers and small service businesses · updated October 2026
Gross margin counts only the cost you enter. Overhead and taxes come out of the gross profit.
How to use this profit margin calculator
The calculator has three modes. Pick the one that matches the question you’re asking.
- Cost + price: enter what a job or item costs you and what you charge. You get the gross margin, the gross profit in dollars and the markup.
- Target margin: enter the gross margin you want to keep and, optionally, your cost. You get the price to charge and the markup that gets you there.
- Net margin: enter your revenue for a period, your direct costs, your overhead and (optionally) income taxes. You get both gross and net margin.
- Use Copy this line to keep a one-line summary for your records or to share with your bookkeeper.
Use the first two modes when you price a single job. Use the net margin mode at the end of a month, quarter or year to see what the business actually kept.
How to calculate profit margin
Profit margin is profit as a percentage of the selling price. Gross margin uses only the direct cost of the job or item: materials, parts, subcontractors and any labor you pay for that job.
Worked example: one job
A job costs you $400 in materials and subcontracted work, and you charge the client $500.
- Gross profit: $500 − $400 = $100
- Gross margin: $100 ÷ $500 = 20%
- Markup: $100 ÷ $400 = 25%
Finding the price for a target margin
To keep a set margin, divide your cost by one minus the margin. Don’t add the margin percentage to the cost: that gives you a markup, and a lower margin than you wanted.
For a 30% margin on the same $400 cost: $400 ÷ 0.70 = $571.43. You keep $171.43, which is 30% of the price and a 42.86% markup on the cost.
Gross margin vs net margin
Gross margin tells you whether each job is priced well. Net margin tells you whether the business makes money after everything else is paid: rent, software, insurance, phone, vehicle, card fees and, if you include them, income taxes.
Worked example: a year of a small service business
- Revenue: $120,000
- Direct costs (materials, subcontractors): $48,000
- Gross profit: $72,000, a 60% gross margin
- Overhead and other expenses: $36,000
- Net profit before tax: $36,000, a 30% net margin
If you work alone, that net profit is also what you earn before income and self-employment tax. A healthy-looking margin can still be a low wage if the revenue is small, so check the dollars as well as the percentage. The break-even calculator shows the revenue you need just to cover overhead.
Margin vs markup
Markup and margin share the same profit but divide it by different numbers: markup by cost, margin by price. So the margin is always smaller than the markup on the same job. A 25% markup is a 20% margin, and a 50% margin needs a 100% markup.
This table shows the markup each target margin needs, and the price on a $400 cost:
| Target gross margin | Markup needed | Price on a $400 cost |
|---|---|---|
| 10% | 11.11% | $444.44 |
| 15% | 17.65% | $470.59 |
| 20% | 25% | $500.00 |
| 25% | 33.33% | $533.33 |
| 30% | 42.86% | $571.43 |
| 35% | 53.85% | $615.38 |
| 40% | 66.67% | $666.67 |
| 50% | 100% | $800.00 |
| 60% | 150% | $1,000.00 |
If you think in markups, for example when adding a percentage to materials, the markup calculator runs the same math from the other side, with the same $400 example.
Average profit margin by industry
NYU Stern professor Aswath Damodaran publishes margins for US public companies by industry. The January 2026 figures below are a useful reference point, but read them with care: these are large listed companies, and each firm counts costs its own way.
| Industry (US public companies) | Gross margin | Net margin |
|---|---|---|
| Advertising | 36.2% | −0.3% |
| Business & consumer services | 33.4% | 7.0% |
| Computer services | 24.3% | 4.5% |
| Education | 45.8% | 8.8% |
| Engineering & construction | 15.5% | 5.9% |
| Environmental & waste services | 36.3% | 8.2% |
| Homebuilding | 22.7% | 9.5% |
| Restaurants & dining | 32.2% | 9.4% |
| Retail (general) | 33.2% | 5.6% |
| Software (system & application) | 71.7% | 25.5% |
| All US public companies | 37.8% | 9.7% |
The more useful benchmark is your own history. Run the net margin mode for last year and this year, and see which way it is moving.
How to improve your profit margin
- Price from the margin, not the cost. Decide the margin you need, then use Price = Cost ÷ (1 − margin) for every quote.
- Charge for the small stuff. Trip charges, rush fees and minimum job sizes protect the margin on short visits.
- Mark up materials and subcontractors. Reselling at cost adds revenue but no profit, which pulls your overall margin down.
- Watch the fees. Card processing comes straight out of your margin. The Stripe fee calculator shows what you keep from each payment.
- Cut overhead you don’t use. Unused subscriptions are pure net-margin loss.
- Raise prices on a schedule. If your costs rise every year and your prices don’t, your margin shrinks quietly.
Common profit margin mistakes
- Adding the margin to the cost. $400 + 20% = $480 is a 20% markup and only a 16.67% margin. A real 20% margin is $500.
- Leaving costs out. Gross margin without the subcontractor or the materials isn’t a margin. Put every direct cost of the job in.
- Comparing gross to net. A 60% gross margin and a 30% net margin can describe the same business. Compare like with like.
- Ignoring your own time. If you don’t pay yourself as a cost, remember that your profit is your pay.
- Judging one job alone. A low-margin job that fills a gap in your week can still be worth it. Look at monthly totals too.
Put the right price on your invoice
Once you know the price that gives you the margin you want, bill that price. List the work and materials as line items (quantity × rate) so the client sees what they’re paying for, and add any sales tax on top.
Onigiri’s invoices use quantity × rate line items with tax rates and discounts, and you can send them by email, as a link or as a PDF. With PRO you also get income tracking and can save your standard services as item templates, so your prices stay consistent from one invoice to the next. The free plan covers 3 invoices a month, and the invoice generator makes a one-off PDF without sign-up.
Frequently asked questions
How do you calculate profit margin?
Subtract your cost from the price, divide by the price and multiply by 100. A job that costs $400 and sells for $500 has a 20% profit margin.
What is the formula for gross margin?
Gross margin = (revenue − direct costs) ÷ revenue × 100. Direct costs are what the job itself costs you, such as materials, parts and subcontractors.
How do I find the price for a target margin?
Divide your cost by one minus the margin. For a 30% margin on a $400 cost, charge $400 ÷ 0.70 = $571.43.
What is the difference between gross and net profit margin?
Gross margin subtracts only direct job costs from revenue. Net margin also subtracts overhead such as rent, software and insurance, and often income taxes, so it is always the lower of the two.
Is a 20% margin the same as a 20% markup?
No. A 20% markup on a $400 cost gives a $480 price and a 16.67% margin. A 20% margin needs a 25% markup, which means a $500 price.
What is a good profit margin for a small business?
It depends on the industry. Damodaran’s January 2026 data puts the average net margin of US public companies at 9.7%, with business and consumer services at 7.0%. Compare yourself with your own past results first.
Can a profit margin be negative?
Yes. If your costs are higher than your price or revenue, the margin is negative, which means you lost money on that job or in that period.

Jul 16, 2024
Setting Freelance Rates: A Guide to Pricing Your Services Competitively and Fairly
Get tips and insights to set competitive and fair pricing for your services

May 17, 2024
What is an itemized invoice? Meaning, structure and example
What an itemized invoice is, what to include, and a worked example with line items, discount and total. Plus tips for line items clients approve fast.

Jan 30, 2024
Flat rate vs hourly rate: what should you choose?
Explore the key differences between flat rate and hourly rate to determine the optimal choice for your business or project.
Bill the price you planned
Line items, tax rates and discounts on every invoice. PRO adds income tracking for $12/month.
