Margin Calculator

Calculate profit margin, markup, and gross profit from cost and selling price. Or find the selling price needed to achieve a desired profit margin.

The cost to produce or purchase the item.

The price at which you sell the item.

The cost to produce or purchase the item.

%

The profit margin percentage you want to achieve.

Margin & Markup Formulas

Profit Margin (%) = [(Selling Price − Cost) / Selling Price] × 100 Gross Profit = Selling Price − Cost Markup (%) = [(Selling Price − Cost) / Cost] × 100 Selling Price = Cost / (1 − Margin / 100) Where: Cost = Cost price (what you pay) Selling Price = Revenue (what you charge) Profit = Selling Price − Cost Relationship: Margin = Markup / (1 + Markup) Markup = Margin / (1 − Margin)

Margin and markup are often confused but measure different things. Margin is profit as a percentage of the selling price (revenue), while markup is profit as a percentage of the cost price. A 25% markup equals a 20% margin. Understanding this distinction is critical for pricing decisions and financial reporting.

How to Use the Margin Calculator

1

Choose Your Calculation Mode

Use "Calculate Margin" to find the margin from cost and selling price. Use "Find Selling Price" to determine what price you need to charge to hit a target margin.

2

Enter Your Values

For margin calculation, enter the cost price and selling price. For selling price calculation, enter the cost price and your desired margin percentage.

3

Click Calculate

Get instant results showing profit margin, markup, gross profit, and a visual breakdown of cost vs. profit in the selling price.

4

Analyze the Breakdown

The visual bar shows what portion of the selling price goes to cost and what portion is profit. Use this to understand your pricing structure at a glance.

Example Calculation

Cost 80, Selling Price 100

Given:

  • Cost Price = 80.00
  • Selling Price = 100.00

Step 1: Calculate Gross Profit

Gross Profit = 100.00 − 80.00 = 20.00

Step 2: Calculate Profit Margin

Margin = (20.00 / 100.00) × 100 = 20.00%

Step 3: Calculate Markup

Markup = (20.00 / 80.00) × 100 = 25.00%

Result: Margin = 20.00% | Markup = 25.00%

Gross Profit = 20.00

Of every 1.00 in revenue, 0.80 covers cost and 0.20 is profit.

Reverse: What selling price gives a 20% margin on 80 cost?

Selling Price = 80 / (1 − 0.20) = 80 / 0.80 = 100.00

Understanding the Results

Profit Margin

The percentage of revenue that is profit. A 20% margin means for every 1 of revenue, 0.20 is profit and 0.80 covers costs. This is the key metric in financial statements and investor reports. Higher margins indicate greater profitability and pricing power.

Markup

The percentage added on top of cost to get the selling price. A 25% markup on an 80 cost means you add 20 to get 100. While margin measures profitability relative to revenue, markup measures how much you mark up above cost. They are related but not interchangeable.

Gross Profit

The absolute dollar amount of profit per unit before deducting operating expenses, taxes, and interest. Gross profit = Revenue − Cost of Goods Sold (COGS). This funds all other business operations.

Margin vs. Markup — Don't Mix Them Up

A common mistake is using markup when you mean margin. If you want a 20% profit margin, you don't add 20% to cost (that gives 16.67% margin). You divide cost by 0.80. This calculator handles both correctly and shows you the conversion.

Key Definitions

Profit Margin

Profit expressed as a percentage of selling price (revenue). Measures how much of each dollar of revenue is actual profit.

Gross Margin

Revenue minus cost of goods sold, divided by revenue. Reflects profitability before operating expenses, taxes, and interest.

Markup

The amount added to cost price to determine selling price, expressed as a percentage of cost. Used primarily for pricing decisions.

Cost of Goods Sold

The direct costs of producing goods or services sold. Includes materials, labor, and manufacturing costs. Does not include indirect expenses.

Gross Profit

Revenue minus cost of goods sold. The profit before deducting operating expenses, taxes, depreciation, and interest.

Net Margin

Profit after all expenses (operating, taxes, interest) divided by revenue. Lower than gross margin but shows true bottom-line profitability.

Average Profit Margins by Industry

Industry Gross Margin Net Margin
Software / SaaS60–80%15–25%
Pharmaceuticals60–75%15–20%
Consulting40–60%15–25%
Manufacturing15–30%3–8%
Retail20–30%2–5%
Restaurants55–65%3–9%
Grocery20–25%1–3%

* Ranges are approximate and vary by company, market conditions, and business model.

Frequently Asked Questions

Profit margin is the percentage of revenue that remains as profit after deducting the cost of goods sold. It is calculated as (Revenue − Cost) / Revenue × 100. For example, if you sell an item for 100 and it costs 80, your profit margin is 20%. This means 20 cents of every dollar earned is profit. Profit margin is the primary profitability metric used in financial reporting and investor analysis.
Margin is profit as a percentage of selling price (revenue). Markup is profit as a percentage of cost. For an item costing 80 sold for 100: Margin = 20/100 = 20%, Markup = 20/80 = 25%. The key relationship: Margin = Markup / (1 + Markup) and Markup = Margin / (1 − Margin). Confusing the two is one of the most common pricing mistakes — using a 20% markup when you need a 20% margin results in a much lower actual margin of only 16.67%.
A "good" margin depends entirely on your industry. Software companies typically achieve 60–80% gross margins. Retail operates on thin 2–5% net margins. Restaurants see 3–9% net margins despite 55–65% gross margins due to high operating costs. The best approach is to benchmark against direct competitors in your specific industry and aim to be at or above the median. Also track whether your margin is improving or declining over time.
Use the formula: Selling Price = Cost / (1 − Margin/100). For example, to achieve a 30% margin on a 70 cost: 70 / (1 − 0.30) = 70 / 0.70 = 100. Verify: Profit = 100 − 70 = 30, Margin = 30/100 = 30% ✓. You can also use the "Find Selling Price" tab in this calculator above.
No. Profit margin cannot exceed 100% because profit (Revenue − Cost) cannot exceed Revenue. The maximum possible margin is 100%, which would mean the cost is 0. However, markup can exceed 100% — a 50 item sold for 150 has a 200% markup but only a 66.7% margin.
If cost is in A1 and selling price is in B1:

Margin: =(B1-A1)/B1 then format as percentage.

Markup: =(B1-A1)/A1 then format as percentage.

Gross Profit: =B1-A1

Selling Price from margin (margin in C1): =A1/(1-C1)