Profit Margin Calculator
Enter what you charge and what the work cost you to get profit, profit margin and markup, then find the price that reaches a target margin. Margin is profit ÷ revenue; markup is profit ÷ cost. On a $5,000 invoice with $3,000 of costs, that is a 40% margin and a 66.7% markup.
Best for: Freelancers, agencies and small businesses checking a quote or invoice before it goes out.
Profit
$2,000.00
Profit Margin
40.0%
Markup
66.7%
Price for a target margin
Price to charge
$5,000.00
Profit $2,000.00, equal to a 66.7% markup
Amounts display with a $ sign, but the arithmetic is the same in any currency. Calculations run in your browser; nothing is sent or saved.
How the calculator works
Three formulas, all from the same two numbers:
- Profit = revenue - cost
- Profit margin = profit ÷ revenue × 100
- Markup = profit ÷ cost × 100
- Price for a target margin = cost ÷ (1 - target margin)
Edge cases are shown rather than hidden. Revenue of 0 makes margin undefined, a cost of 0 makes markup undefined, and both show as "Unavailable". A cost above revenue is a loss, so margin and markup turn negative and display in red. Negative amounts are rejected because a negative price or cost is almost always a typing error.
Margin vs markup: why the same profit gives two percentages
Margin is measured against the price, markup against the cost. Buy for $100, sell for $150: profit is $50, markup is 50% (50 ÷ 100), margin is 33.3% (50 ÷ 150). Confusing the two is the most common pricing mistake on quotes, because a markup always looks bigger than the margin it produces.
| Markup on cost | Price on $1,000 cost | Resulting margin |
|---|---|---|
| 20% | $1,200 | 16.7% |
| 25% | $1,250 | 20.0% |
| 50% | $1,500 | 33.3% |
| 66.7% | $1,667 | 40.0% |
| 100% | $2,000 | 50.0% |
| 200% | $3,000 | 66.7% |
Conversions: margin = markup ÷ (1 + markup); markup = margin ÷ (1 - margin), with both as decimals. A margin can never reach 100%, but a markup can be any size.
Worked example: pricing an invoice for a 40% margin
Illustrative example: a web designer is quoting a site build. Their costs are a $1,200 subcontracted developer, $300 of fonts and plugins, and 20 hours of their own time, which they value at $50 an hour ($1,000). Total cost: $2,500. They want a 40% margin.
- Right way: $2,500 ÷ (1 - 0.40) = $4,166.67. Profit is $1,666.67, which is 40% of the price (and a 66.7% markup).
- Common mistake: $2,500 × 1.40 = $3,500. Profit is $1,000, which is only a 28.6% margin.
- Planning a discount? If the client will get 10% off, the pre-discount price must be $4,166.67 ÷ 0.90 = $4,629.63 so the discounted total still lands on $4,166.67.
- Tax goes on top. Sales tax or VAT is calculated after the discount and is not revenue, so leave it out of the margin calculation.
That order (subtotal, then one percentage discount, then tax on the discounted subtotal) is how InvoiceQuickly's invoice editor calculates totals, so the figures carry straight over. To present the price before the work starts, send it as a quote using an estimate template.
Gross margin or net margin: which costs should you enter?
The calculator has one cost box, so the margin it returns depends on what you put in it. Gross margin uses only the direct costs of a job; net margin uses every expense.
Illustrative example: a consultant bills $90,000 in a year. Direct costs (subcontractors and project travel) are $18,000, so the gross margin is ($90,000 - $18,000) ÷ $90,000 = 80%. Overheads (software, insurance, accountant, equipment) add $12,000, so net margin before tax is ($90,000 - $30,000) ÷ $90,000 = 66.7%.
For a sole trader, that 66.7% is not spare profit: it is also the owner's pay. If you do not count your own time as a cost, your "margin" mixes salary and profit, which is why freelance margins look far higher than company margins. For a per-project view, include your hours at an hourly value, as in the worked example above. Our guide on calculating profit margin for service businesses goes further.
What margins do companies actually earn?
Benchmarks only help if you know where they come from. The figures below are from Aswath Damodaran's Margins by Sector (US) dataset at NYU Stern, updated January 2026. They cover US publicly listed companies, so they understate what a small service business with few overheads can earn and are not a target for freelancers.
| Industry | Firms | Gross margin | Net margin |
|---|---|---|---|
| Software (System & Application) | 309 | 71.72% | 25.49% |
| Publishing & Newspapers | 19 | 50.44% | 8.19% |
| Information Services | 15 | 34.08% | 6.53% |
| Business & Consumer Services | 155 | 33.38% | 7.03% |
| Retail (General) | 23 | 33.18% | 5.61% |
| Restaurant/Dining | 64 | 32.24% | 9.37% |
| Computer Services | 64 | 24.26% | 4.45% |
| Engineering/Construction | 48 | 15.46% | 5.94% |
| Total market (all US firms in the dataset) | 5,994 | 37.76% | 9.74% |
Source: Aswath Damodaran, NYU Stern School of Business, Margins by Sector (US), data as of January 2026, accessed 27 October 2026. Read across a row, not down: software's 71.72% gross margin falls to 25.49% net once operating costs are included. For more context see profit margin benchmarks.
Ways to raise a thin margin
Margin moves when price rises or cost falls. For service work the levers are usually:
- Price from cost and target margin, not from what the last client paid. Re-run the target-margin box whenever a subcontractor or software cost changes.
- Price revisions and scope changes. Every unpriced extra round of edits is cost with no revenue.
- Check discounts against margin first. A 10% discount on a 40% margin job removes a quarter of the profit ($416.67 of $1,666.67 in the example above). Model early payment terms with the discount calculator.
- Raise rates for new clients first. See how to raise freelance rates.
When this isn't the right fit
You need a full profit and loss statement with cost of goods sold, overhead allocation and tax. This calculator handles one revenue figure and one cost figure; use your accounting software or an accountant for the full picture.
You are pricing a subscription product. Recurring metrics such as customer lifetime value, acquisition cost and churn matter more than the margin on a single invoice.
You are valuing a business. Margin is one input; valuation needs cash-flow and comparable-company analysis from a qualified adviser.
Frequently asked questions
What is the formula for profit margin?
Profit margin = (revenue - cost) ÷ revenue × 100. On a $5,000 invoice with $3,000 of costs, profit is $2,000 and the margin is 2,000 ÷ 5,000 = 40%. Use revenue before sales tax or VAT, because tax you collect is passed on to the tax authority.
How is profit margin different from markup?
Margin divides profit by the selling price; markup divides the same profit by cost. Buying at $100 and selling at $150 is a 50% markup but a 33.3% margin. Markup is always the larger number when there is a profit, which is why quoting a markup when you meant a margin underprices the job.
How do I price an invoice to hit a target margin?
Divide your total cost by (1 - target margin). For $2,500 of costs and a 40% margin, the price is 2,500 ÷ 0.60 = $4,166.67. Adding 40% to cost instead gives $3,500, which is only a 28.6% margin.
What is the difference between gross margin and net margin?
Gross margin subtracts only the direct costs of the job (materials, subcontractors, cost of goods sold). Net margin subtracts every expense, including overhead such as software, insurance, rent and accounting fees. This calculator returns whichever one matches the costs you enter.
What is a good profit margin?
It depends on the industry and on what you count as cost. In NYU Stern's January 2026 dataset of US-listed companies, net margins ranged from 4.45% (computer services) to 25.49% (software), with a 9.74% market average. Those are large public companies, not freelancers, so use them for context rather than as a target.
Why does the calculator show Unavailable?
Margin is undefined when revenue is 0, and markup is undefined when cost is 0, because both would divide by zero. Negative amounts are rejected; enter a loss as a cost higher than revenue and the margin will show as a negative percentage.
Related tools and guides
- Discount Calculator: what an early payment discount costs you
- What Is a Healthy Profit Margin?: context by business type
- Pricing Freelance Services: hourly, project and value pricing
- Freelance Invoicing Guide: turning the price into an invoice
- All free invoicing tools