On this page
Formula
Margin = (Revenue − Cost) ÷ Revenue × 100; Markup = (Revenue − Cost) ÷ Cost × 100; Price = Cost ÷ (1 − Margin ÷ 100)
- Revenue
- the selling price of one item, or total sales (net of returns and discounts) for a period
- Cost
- cost of goods sold for gross margin, or all costs for net margin
- Margin
- profit as a percentage of revenue
- Markup
- profit as a percentage of cost
What the calculator works out
The profit margin calculator has two modes.
Margin from cost and price takes what something cost you and what you sold it for, and returns:
- Profit margin, the profit as a percentage of the selling price.
- Profit or loss in dollars.
- Markup on cost, the profit as a percentage of the cost.
Price from target margin takes a cost and the margin you want, and returns the selling price that delivers it, along with the profit per sale and the equivalent markup.
It works for a single product, a job or a whole period of sales. Enter one item’s cost and price for a per-unit margin, or a month’s revenue and cost of goods sold for a gross margin on the business.
The profit margin formula
Profit margin compares profit with revenue:
Margin = (Revenue − Cost) ÷ Revenue × 100
Markup compares the same profit with cost:
Markup = (Revenue − Cost) ÷ Cost × 100
To find the price for a target margin, which is what the profit margin calculator does in its second mode, rearrange the first formula:
Price = Cost ÷ (1 − Margin), with the margin as a decimal.
The two percentages are linked. A margin m (as a decimal) equals a markup of m ÷ (1 − m), and a markup k equals a margin of k ÷ (1 + k).
Calculating profit margin by hand
Say a product costs you $18 and you sell it for $30.
- Profit: $30 − $18 = $12.
- Margin: $12 ÷ $30 = 0.40, or 40%.
- Markup: $12 ÷ $18 = 0.6667, or 66.67%.
Now work backward. A different item costs $24 and you want a 35% margin.
- Convert the margin to a decimal: 0.35.
- Price: $24 ÷ (1 − 0.35) = $24 ÷ 0.65 = $36.92.
- Check: the profit is $12.92, and $12.92 ÷ $36.92 ≈ 35%.
Margin and markup conversion chart
| Margin | Markup | Price as a multiple of cost |
|---|---|---|
| 10% | 11.11% | 1.1111× |
| 20% | 25% | 1.25× |
| 25% | 33.33% | 1.3333× |
| 30% | 42.86% | 1.4286× |
| 33.33% | 50% | 1.5× |
| 40% | 66.67% | 1.6667× |
| 50% | 100% | 2× |
| 60% | 150% | 2.5× |
| 75% | 300% | 4× |
The gap between the columns widens quickly. “Keystone” pricing, doubling the cost, is a 100% markup but a 50% margin.
Gross, operating and net margin
The same formula gives different margins depending on which costs you subtract. The profit margin calculator handles all three: change what you enter as cost.
Take a business with $400,000 of annual sales.
- Gross margin. Cost of goods sold is $240,000, leaving $160,000 of gross profit. Gross margin = 160,000 ÷ 400,000 = 40%.
- Operating margin. Rent, wages and other operating expenses are another $100,000, leaving $60,000 of operating income. Operating margin = 15%.
- Net margin. Interest and income taxes take another $20,000, leaving $40,000 of net income. Net margin = 10%.
Gross margin tells you whether your pricing covers the direct cost of what you sell. Operating margin shows how efficiently the whole business runs. Net margin is the bottom line after everything, including financing and taxes.
Real-life uses
- Pricing new products. Start from a target margin that covers overheads and profit, then use the price mode to set the shelf price.
- Checking discounts. A 20% discount on a 40% margin item cuts the margin to 25%, not 20%. Work out the sale price with the discount calculator, then check the new margin here.
- Comparing suppliers. A cheaper supplier raises margin at the same price; the profit margin calculator shows by how much.
- Quoting jobs. Service businesses can enter labor and materials as the cost and the quoted price as revenue.
- Reviewing a period. Enter a month’s or a year’s revenue and cost of goods sold to track gross margin over time.
For the return on money invested rather than on sales, use the ROI calculator.
Common mistakes
- Mixing up margin and markup. Adding 30% to cost gives a 23.08% margin. If your target is a margin, use the price mode instead of adding a percentage to cost.
- Including sales tax in revenue. Sales tax is collected on behalf of the government. Leave it out, or your margin will look higher than it is. The sales tax calculator separates it.
- Forgetting part of the cost. Shipping, payment processing fees and packaging are easy to leave out of a per-item cost.
- Comparing gross margin with someone else’s net margin. Check which costs each figure includes.
Glossary
- Revenue. Money from sales, net of returns and discounts.
- Cost of goods sold (COGS). The direct cost of the products sold, such as materials, purchase price and direct labor.
- Gross profit. Revenue minus cost of goods sold.
- Markup. The amount added to cost to set a price, as a percentage of cost.
- Margin. Profit as a percentage of the selling price or revenue.
Worked examples
Margin and markup on a retail item
An item that costs $35 to buy is sold for $50.
Inputs (Margin from cost and price): Cost = $35; Selling price or revenue = $50
Profit = $50.00 − $35.00 = $15.00 Margin = $15.00 ÷ $50.00 × 100 = 30% Markup = $15.00 ÷ $35.00 × 100 = 42.86%
Answer: Selling at $50.00 with a cost of $35.00 gives a 30% margin and a 42.86% markup.
Gross margin for a month of sales
A small business had $12,500 in revenue and $8,200 in cost of goods sold for the month.
Inputs (Margin from cost and price): Cost = $8200; Selling price or revenue = $12500
Profit = $12,500.00 − $8,200.00 = $4,300.00 Margin = $4,300.00 ÷ $12,500.00 × 100 = 34.4% Markup = $4,300.00 ÷ $8,200.00 × 100 = 52.44%
Answer: Selling at $12,500.00 with a cost of $8,200.00 gives a 34.4% margin and a 52.44% markup.
Pricing to hit a 40% margin
A product costs $45 and the business wants a 40% gross margin on every sale.
Inputs (Price from target margin): Cost = $45; Target margin = 40 %
Price = $45.00 ÷ (1 − 40%) = $45.00 ÷ 60% = $75.00 Markup = $30.00 ÷ $45.00 × 100 = 66.67%
Answer: To earn a 40% margin on a $45.00 cost, charge $75.00 (a 66.67% markup).
Selling below cost
Clearance stock that cost $120 is sold for $100, so the margin is negative.
Inputs (Margin from cost and price): Cost = $120; Selling price or revenue = $100
Profit = $100.00 − $120.00 = −$20.00 Margin = −$20.00 ÷ $100.00 × 100 = −20% Markup = −$20.00 ÷ $120.00 × 100 = −16.67%
Answer: Selling at $100.00 with a cost of $120.00 gives a −20% margin and a −16.67% markup.
Assumptions and limitations
- Revenue must be greater than $0. Cost can be $0, which gives a 100% margin and an undefined markup.
- Revenue should be net of sales tax, returns and discounts. Sales tax collected for the government is not revenue.
- The calculator does not split costs itself. Enter cost of goods sold for gross margin, cost of goods plus operating expenses for operating margin, or all costs including interest and taxes for net margin.
- In the target-margin mode the margin must be at least 0% and below 100%, because profit can never be larger than the price.
- Results are rounded to the cent and to two decimal places for percentages.
Frequently asked questions
How do I calculate profit margin?
Subtract cost from revenue to get profit, divide the profit by revenue and multiply by 100. An item that costs $18 and sells for $30 has a $12 profit and a 12 ÷ 30 × 100 = 40% margin.
What is the difference between margin and markup?
Both use the same profit, but margin divides it by the selling price and markup divides it by the cost. On the $18 item sold for $30, the margin is 40% and the markup is 66.67%. Markup is always the larger number when there is a profit.
How do I price a product to get a specific margin?
Divide the cost by 1 minus the target margin as a decimal. For a 35% margin on a $24 cost, the price is $24 ÷ 0.65 = $36.92. Use the price-from-target-margin mode to do this automatically.
Why does a 30% markup not give a 30% margin?
Because markup is measured against the smaller cost figure. A $70 item marked up 30% sells for $91, but the $21 profit is only 23.08% of $91. To earn a 30% margin you need a markup of 42.86%.
What is a good profit margin?
It depends heavily on the industry. Grocery stores often run thin net margins, while software companies can run much higher ones. Compare your margin with businesses in the same industry and with your own past results rather than with a single universal number.
Can a profit margin be negative?
Yes. If costs are higher than revenue, the profit is a loss and the margin is negative. The calculator shows a negative margin and labels the result as a loss.
Can the margin be more than 100%?
No. Margin is profit as a share of revenue, and profit can never exceed revenue unless costs are negative. Markup has no upper limit, so a 300% markup is possible and equals a 75% margin.
Sources
- Beginners' Guide to Financial Statements — U.S. Securities and Exchange Commission. Checked October 10, 2026.
- Publication 334, Tax Guide for Small Business — Chapter 7, Figuring Gross Profit — Internal Revenue Service. Checked October 10, 2026.
- Gross margin — Wikipedia. Checked October 10, 2026.
- Markup (business) — Wikipedia. Checked October 10, 2026.