How to Calculate Profit Margin (Formula and Examples)

To calculate profit margin, subtract cost from revenue and divide the result by revenue: margin (%) = (revenue − cost) ÷ revenue × 100. Sell something for $120 that costs $80, and you keep $40, which is a 33.33% margin. The free Profit Margin Calculator does this instantly and also works backwards from a target margin to the price you need to charge.
Try it now
Profit Margin Calculator
Loading tool…
The profit margin formula
Three numbers matter, and all of them come from revenue and cost:
Profit = Revenue − Cost
Profit margin = Profit ÷ Revenue × 100
Markup = Profit ÷ Cost × 100
Margin answers "what share of each sale do I keep?" Markup answers "how much did I add on top of cost?" They use the same profit figure but divide by different bases, which is why they never match. The calculator shows both side by side so you don't have to convert by hand. If you want the full breakdown of when to use each, read profit margin vs markup.
To work backwards from a margin you want to hit:
Required revenue = Cost ÷ (1 − Target margin ÷ 100)
How to use the Profit Margin Calculator
The tool has two tabs: Standard and Target margin.
Standard: find margin from revenue and cost
- Open the Standard tab.
- Type your selling price or total sales into Revenue.
- Type the total cost of delivering that sale into Cost.
- Click Calculate.
The Results panel shows Profit, Profit margin, and Markup. Use Copy to put all three on your clipboard as text, or Share to copy a link that pre-fills the revenue and cost. Anyone who opens that link sees your numbers, so only share it with people who should. Reset puts the default values back.
Target margin: find the price you need
- Open the Target margin tab.
- Enter your Cost.
- Enter the margin you want in Target margin (%). It has to be below 100.
- Click Calculate.
The results show Required revenue (the price to charge), the Profit at that price, and the equivalent Markup.
Worked examples
Example 1: a retail product
You sell a product for $120 and it costs you $80 to buy and ship.
- Profit = $120 − $80 = $40
- Margin = $40 ÷ $120 × 100 = 33.33%
- Markup = $40 ÷ $80 × 100 = 50%
Example 2: a freelance project
You bill a client $2,500. Your costs for the job are $1,600: a subcontractor, stock assets, and software you bought specifically for it.
- Profit = $2,500 − $1,600 = $900
- Margin = $900 ÷ $2,500 × 100 = 36%
- Markup = $900 ÷ $1,600 × 100 = 56.25%
Example 3: pricing for a 40% margin
An item costs $60 and you want a 40% margin. On the Target margin tab:
- Required revenue = $60 ÷ (1 − 0.40) = $60 ÷ 0.60 = $100
- Profit = $100 − $60 = $40
- Markup = $40 ÷ $60 × 100 = 66.67%
Example 4: a sale that loses money
You sold a bundle for $50, but materials and fees came to $65. Profit is −$15 and margin is −30%. The calculator accepts this and shows the negative result. That's useful when you check old orders to find the ones that cost you money.
Target margin reference table
This is what you'd need to charge for an item that costs $100. The markup column shows how big the gap between the two measures gets as the margin rises.
| Target margin | Required price | Profit | Equivalent markup |
|---|---|---|---|
| 10% | $111.11 | $11.11 | 11.11% |
| 20% | $125.00 | $25.00 | 25% |
| 25% | $133.33 | $33.33 | 33.33% |
| 30% | $142.86 | $42.86 | 42.86% |
| 40% | $166.67 | $66.67 | 66.67% |
| 50% | $200.00 | $100.00 | 100% |
| 60% | $250.00 | $150.00 | 150% |
Margin can approach 100% but never reach it while cost is above zero. That's why the Target margin tab rejects 100 or higher.
Common mistakes
Adding the margin percentage to cost. If an item costs $70 and you want a 30% margin, $70 × 1.30 = $91 gives you only a 23.08% margin ($21 ÷ $91). The correct price is $70 ÷ 0.70 = $100. Adding a percentage to cost is markup. The markup guide explains when that approach is the right one.
Leaving out costs. Margin is only as honest as your cost figure. Include shipping, payment processing fees, packaging, and any subcontracted work tied to the sale. Overhead such as rent is usually tracked separately as net margin, but be clear which one you're quoting.
Forgetting what discounts do to margin. Suppose a $100 item costs $60, so your margin is 40%. Take 10% off and the price drops to $90, profit to $30, and margin to 33.33%. A 10% price cut wiped out 25% of your profit. Before you run a promotion, check the final price in the Discount Calculator and then run it back through the margin calculator.
Mixing currencies or tax. Put revenue and cost in the same currency, and either include sales tax in both or in neither. The calculator formats results with a dollar sign, but the math works the same for any currency.
Spreadsheet formulas
To do this in Excel or Google Sheets, put revenue in column B and cost in column C:
Profit: =B2-C2
Margin (%): =(B2-C2)/B2
Markup (%): =(B2-C2)/C2
Price for margin: =C2/(1-D2) (D2 = target margin, e.g. 0.4)
Format the margin and markup cells as percentages. Wrap the margin formula in =IF(B2=0,0,(B2-C2)/B2) to avoid divide-by-zero errors on empty rows.
Your numbers stay on your device
The calculator runs entirely in your browser. Revenue and cost figures aren't sent to a server, and nothing is saved between visits. Numbers only leave the page if you click Share, which puts revenue and cost into a link.
When you're ready to bill, turn the price into a PDF with the free Invoice Generator. For the full set of pricing and billing tools, see the free business tools guide for freelancers.
Frequently asked questions
Tools in this guide
Profit Margin Calculator
Calculate profit, margin, and markup from revenue and cost. Includes reverse calculation.
Markup Calculator
Calculate selling price, markup, and margin from cost—or find markup from your price.
Discount Calculator
Apply one or two stacked discounts and see final price and total savings.
Keep reading
- BusinessProfit Margin vs Markup: What's the Difference?Profit margin vs markup explained: the formulas, a conversion table, worked examples, and when to use each so you never underprice by mixing them up.
- BusinessHow to Calculate Markup (Formula, Examples, and Margin Conversion)Learn how to calculate markup and selling price from cost, convert markup to margin, and avoid common pricing mistakes using a free markup calculator.
- BusinessFree Business Tools for Freelancers and Small BusinessesFree business tools for freelancers: an invoice generator plus profit margin, markup, ROI, and discount calculators that run in your browser with no signup.