HomeCalculators › Profit Margin

Profit Margin Calculator for Gross Margin, Markup and Selling Price

Use this free profit margin calculator to calculate margin, gross profit, markup, profit percentage, and selling price from cost and revenue. You can also work backward from a target margin or markup when setting a price.

Enter your values

Use the same currency and unit for all values.

Used only for total profit.
Advanced direct costs
Applied to the selling price. This is optional and does not replace a full net profit calculation.
A 100% margin is not possible with a positive cost because selling price would need to be infinite.

What This Profit Margin Calculator Calculates

This calculator is built for the most common pricing question: how much of the selling price remains after the cost used in the calculation? Enter cost and selling price to see profit, margin, markup, cost share, and total profit.

The same calculation also covers common searches for a margin calculator, gross margin calculator, gross profit margin calculator, margin percentage calculator, cost margin calculator, sales margin calculator, and product margin calculator. The key is using matching figures for cost and revenue.

The default mode is best for an existing sale. The target-margin mode works as a reverse margin calculator when you know the margin you want and need the required selling price. The markup mode calculates a selling price from a percentage added to cost.

How to Use the Profit Margin Calculator

  1. Choose your currency. This changes the display symbol, not exchange rates.
  2. Enter the cost per unit and selling price per unit.
  3. Add quantity if you want total profit across several units.
  4. Add optional direct costs such as shipping, packaging, or selling fees.
  5. Select Calculate Profit Margin.
  6. Review profit margin, markup, profit per unit, cost share, and total profit.

Keep cost and selling price on the same basis. Do not enter a per-unit cost with total monthly revenue. If you are using business totals, enter total revenue and the matching total direct cost instead.

How to Calculate Profit Margin

To calculate profit margin, first subtract cost from selling price. Then divide the profit by selling price and multiply by 100. The IRS defines gross profit margin as gross profit divided by sales revenue.

Profit = Selling Price - Cost Profit Margin (%) = Profit ÷ Selling Price × 100 Gross Margin (%) = (Revenue - COGS) ÷ Revenue × 100

This is also the core margin calculation formula used by a gross margin percentage calculator. When the inputs are total revenue and cost of goods sold, the result is gross profit margin. When the inputs are one product’s price and direct cost, it is a product-level margin.

Profit Margin Calculation Example

Cost: $60

Selling price: $100

Profit: $100 – $60 = $40

Profit margin: $40 ÷ $100 × 100 = 40%

Markup: $40 ÷ $60 × 100 = 66.67%

A $40 profit on a $100 sale gives a 40% margin. The markup is higher because markup divides the same $40 profit by the $60 cost instead of the $100 selling price.

Gross Margin Calculator: Revenue, COGS and Gross Profit

A gross margin calculator uses sales revenue and cost of goods sold (COGS). IRS guidance explains gross profit as net receipts minus cost of goods sold. Gross profit margin then expresses that gross profit as a percentage of revenue.

Gross Profit = Revenue - Cost of Goods Sold Gross Profit Margin (%) = Gross Profit ÷ Revenue × 100

You can use the main tool for the same gross-margin calculation by entering revenue as the selling price and COGS as the cost. Use matching totals for the same period.

If a business has $250,000 in revenue and $150,000 in COGS, gross profit is $100,000. The gross profit margin calculation is $100,000 ÷ $250,000 × 100 = 40%.

Margin Percentage Calculator: Find Margin From Cost and Price

A margin percentage calculator answers one simple question: what percentage of revenue remains after the included cost? This is why the denominator is selling price or revenue, not cost.

Margin Percentage = (Selling Price - Cost) ÷ Selling Price × 100

The same formula applies to searches such as percent margin calculator, gross margin percentage calculator, profit margin percentage calculator, and calculate margin percentage, provided the figures represent the same sale or reporting period.

Reverse Margin Calculator: Find Selling Price From Target Margin

When you know the margin you want, solve the formula backward. This is useful for pricing a new item or checking whether a planned selling price meets your target.

Selling Price = Cost ÷ (1 - Target Margin)

Enter the target margin as a decimal in the formula. For example, 40% becomes 0.40. A $60 cost at a 40% target margin needs a $100 selling price because $60 ÷ 0.60 = $100.

This mode also covers price margin calculator and cost-to-selling-price searches such as calculate price from cost and margin, calculate selling price from cost and margin, and price from target margin.

Margin and Markup Calculator: Know the Difference

Margin and markup describe the same profit using different bases. Margin is based on selling price. Markup is based on cost. Xero explains the same distinction in its current margin and markup guidance.

Margin (%) = Profit ÷ Selling Price × 100 Markup (%) = Profit ÷ Cost × 100 Markup from Margin = Margin ÷ (1 - Margin) Margin from Markup = Markup ÷ (1 + Markup)
Target Margin Equivalent Markup Example on $100 Cost
10% 11.11% $111.11 selling price
20% 25.00% $125.00 selling price
25% 33.33% $133.33 selling price
30% 42.86% $142.86 selling price
40% 66.67% $166.67 selling price
50% 100.00% $200.00 selling price

This section covers the intent behind a margin markup calculator, margin vs markup calculator, markup to margin calculator, and margin to markup calculator. A 50% markup is not a 50% margin. A 50% markup on $100 cost creates a $150 price and a 33.33% margin.

Retail, Product, Sales and Business Margin Calculations

The formula does not change just because the business type changes. What changes is the cost included in the calculation.

Product margin calculator

For one product, use the selling price and the direct cost of that item. Optional per-unit shipping, packaging, and selling fees can be included in the advanced fields when they belong to that sale.

Retail margin calculator

A retail margin calculator usually compares the selling price with the retailer’s cost for the item. Use net selling price after discounts if you want to measure the realized margin on a discounted sale.

Sales margin calculator

For a sales margin calculation, use sales revenue and the matching cost base. If you use totals for a month, quarter, or year, keep both inputs for that same period.

Business margin calculator

A business margin can mean gross, operating, or net margin. The main tool above is designed around gross or product-level margin. Broader business-wide margins require broader expense inputs.

What Costs Should You Include in a Margin Calculation?

For gross margin, start with direct costs tied to the goods or services sold. IRS Publication 334 explains that gross profit is found after subtracting cost of goods sold from net receipts for businesses that sell products.

For a product pricing check, direct costs may include purchase cost, materials, production, packaging, shipping, or transaction fees when they are directly tied to the sale. The advanced fields let you test some of these costs.

Do not mix every business expense into a gross margin calculation. Rent, broad administrative payroll, interest, taxes, and other business-wide expenses belong in operating or net profit analysis.

Gross, Operating, Net, Contribution and EBITDA Margins

Search terms such as net profit margin calculator, operating margin calculator, contribution margin calculator, and EBITDA margin calculator use different profit measures. They should not be treated as interchangeable with gross margin.

Margin Type Basic Formula What It Shows
Gross profit margin Gross profit ÷ revenue × 100 Profit after direct cost of goods or services
Operating profit margin Operating profit ÷ revenue × 100 Profit after direct costs and operating expenses
Net profit margin Net profit ÷ revenue × 100 Profit after all relevant expenses
Contribution margin ratio (Revenue – variable costs) ÷ revenue × 100 Amount available for fixed costs and profit
EBITDA margin EBITDA ÷ revenue × 100 Operating earnings before interest, tax, depreciation and amortization

Xero’s 2026 guidance separates gross, operating, and net profit margins because each removes a different layer of costs. Its contribution margin guidance uses revenue minus variable costs, while EBITDA margin uses EBITDA divided by total revenue.

For now, use the calculator above for gross, product, retail, and sales margin calculations. For net, operating, contribution, or EBITDA margin, use the formulas above with the correct figures from your financial records.

Profit Margin Formula in Excel or Google Sheets

If cost is in cell A2 and selling price is in B2, a margin calculator Excel formula is:

=(B2-A2)/B2

Format the result cell as a percentage. For markup, use:

=(B2-A2)/A2

To calculate a selling price from a target margin stored in C2, use:

=A2/(1-C2)

These formulas work the same way in Excel and Google Sheets when the margin cell is stored as a percentage such as 40%.

Common Profit Margin Calculation Mistakes

  • Using markup when the target is actually a margin.
  • Adding 30% to cost and assuming that creates a 30% margin.
  • Mixing per-unit cost with total revenue.
  • Ignoring direct transaction costs that materially affect a sale.
  • Using gross margin as if it were net profit margin.
  • Comparing margins from businesses with very different cost structures.
  • Using a 100% target margin with a positive cost, which has no finite selling price.
  • Including sales tax as revenue or profit without checking how your records treat it.

Profit Margin FAQs

What is the formula for profit margin?

Profit margin equals profit divided by selling price or revenue, multiplied by 100. Profit is selling price minus the cost included in the calculation.

How do I calculate gross margin?

Subtract cost of goods sold from revenue to find gross profit. Divide gross profit by revenue and multiply by 100.

Is gross margin the same as profit margin?

Gross margin is one type of profit margin. It uses gross profit after direct costs. Operating and net margins deduct more expense categories.

What is the difference between margin and markup?

Margin divides profit by selling price. Markup divides profit by cost. A 50% markup on a $100 cost gives a $150 selling price and a 33.33% margin.

How do I find selling price from a target margin?

Divide cost by one minus the target margin expressed as a decimal. For a $60 cost and 40% margin, $60 ÷ 0.60 gives a $100 selling price.

Can profit margin be negative?

Yes. If the included costs are higher than revenue, profit is negative and the calculated margin is negative.

Can a standard gross margin exceed 100%?

With positive revenue and nonnegative cost, gross margin cannot exceed 100%. Markup can exceed 100% because markup is measured against cost.

What is a good profit margin?

There is no single percentage that fits every business. Compare the same type of margin with similar businesses in your industry, market, and business model. Gross and net margin should not be benchmarked as if they were the same measure.

Can I use this calculator for services?

Yes, if you can identify the revenue and matching direct service cost. The IRS also recognizes gross services margin using the price of services and directly attributable transactional costs.

Does the currency affect the margin percentage?

No. The percentage calculation is currency-independent as long as every money input uses the same currency and the same unit basis.

Sources and Calculation Methodology

Formulas and accounting distinctions on this page were reviewed on September 9, 2026. Official and established accounting sources were prioritized for definitions and calculation methods.