How to Calculate Profit Margin: Formula, Examples, and Pricing Tips

Profit margin tells you what percentage of every sale stays with you once costs are paid. Learning how to calculate profit margin takes one formula: subtract your costs from your selling price, then divide the result by the selling price. A $100 sale that costs $60 to deliver leaves $40 of profit, which works out to a 40% margin. That one number shapes how you price products, judge whether a sales channel is worth using, and spot costs quietly eating into revenue. The same math also reveals how much a discount or a marketplace fee really costs you. The formulas, worked examples, and pricing mistakes below all build from that single calculation.

The short answer: Profit Margin = (Revenue − Costs) ÷ Revenue × 100. Revenue is your selling price before deductions; costs are whatever you subtract in that calculation. Run the formula on a $100 sale with $60 of cost and you get a 40% margin.

Want to check your own numbers? ToolTive's free Profit Margin Calculator handles margin, markup, fees, discounts, and target pricing in one place.

What Is Profit Margin?

Profit margin is profit expressed as a percentage of revenue. It answers a simple question: out of every dollar you bring in, how many cents stay with you?

Because margin is a ratio, it lets you compare performance across products of very different sizes. A $40 profit on a $100 sale and a $400 profit on a $1,000 sale are both 40% margins, even though the dollar amounts differ.

On its own, "profit margin" doesn't specify which costs to include. That's why the term splits into gross, operating, and net margin, each subtracting a different layer of cost. For everyday pricing decisions, most sellers work with either a simple product margin (selling price minus product cost) or gross margin.

What Is the Profit Margin Formula?

The core formula is:

Profit Margin = Profit ÷ Revenue × 100

Profit margin formula showing profit divided by revenue multiplied by 100
The profit margin formula calculates profit as a percentage of revenue.

Two inputs drive the result. Profit equals revenue minus the costs you count in the calculation. Revenue equals the total selling price, or total sales, before any deductions.

The cost side is where definitions vary. Subtract only the cost of goods sold and you get gross margin. Add operating expenses to get operating margin. Subtract everything, including interest and taxes, and you have net margin.

For a single product, revenue is simply the selling price. For a whole business, revenue is total sales over a period, and the same formula applies at each level of the income statement.

How Do You Calculate Profit Margin Step by Step?

Work through the numbers in this order:

  1. Find your revenue. For one unit, that's the selling price. For a business, it's total sales.
  2. Add up the costs that belong in the calculation. A simple product margin uses product cost only; gross margin uses COGS; a fuller view adds fees, shipping, and other selling costs.
  3. Subtract those costs from revenue to get profit.
  4. Divide profit by revenue.
  5. Multiply by 100 to express the result as a percentage.

One rule matters more than the rest: always divide by revenue, never by cost. Dividing by cost gives you markup, a different number that means something different. That mix-up is the most common margin error, and it can quietly distort an entire pricing strategy.

What Is a Profit Margin Example?

Three worked examples show the formula at different levels of realism.

A Simple Product

A product costs $60 and sells for $100:

  • Profit: $100 − $60 = $40
  • Margin: $40 ÷ $100 × 100 = 40%
  • Markup: $40 ÷ $60 × 100 = 66.67%

The same transaction produces two different percentages. Both are correct; they just measure different things.

An Ecommerce Sale with Real Costs

An item sells for $80. Product cost is $30, shipping is $8, payment processing runs 2.9% of the price ($2.32), and advertising allocated to the sale is $10.

  • Total costs: $50.32
  • Profit: $80 − $50.32 = $29.68
  • Margin: $29.68 ÷ $80 × 100 = 37.1%

Counting only the product cost would make the margin look like 62.5%. Shipping, fees, and advertising consume nearly half of that gap. Modelling these cost layers before committing to a price is what keeps ecommerce margins honest.

A Service Project

A project brings in $5,000. Direct costs, covering contractor time, software, and materials, total $1,800.

  • Profit: $3,200 ($5,000 − $1,800)
  • Margin: 64% ($3,200 ÷ $5,000 × 100)

Services often show high margins on direct costs, but operating overhead still reduces what finally reaches net profit.

A clear, professional invoice makes the revenue side of this calculation easier to verify, and ToolTive's free invoice generator can help you create one.

How Do You Calculate Gross Profit Margin?

The gross profit margin formula is:

Gross Profit Margin = (Revenue − COGS) ÷ Revenue × 100

COGS, or cost of goods sold, is what you spend to produce or buy the goods you sell: materials, manufacturing, purchase cost, and direct production labor. It excludes marketing, rent, software subscriptions, and administrative salaries.

A business with $250,000 in revenue and $150,000 in COGS has $100,000 of gross profit, which is a 40% gross margin.

Gross margin measures how efficiently you turn production cost into revenue. It says nothing about overhead, so a product line can carry a strong gross margin while the business still loses money on rent, salaries, and advertising. Analysts therefore read three margins together:

Margin Type What It Subtracts What It Tells You
Gross margin COGS only Efficiency of production or sourcing
Operating margin COGS plus operating expenses Profitability of core operations
Net margin All expenses, interest, and taxes Final profitability after everything

A simple price-minus-cost calculation is closest to gross margin at the unit level. Calling it "net margin" overstates what it measures, a distinction worth keeping straight when you share numbers with lenders or investors.

What Is the Difference Between Profit Margin and Markup?

Margin is based on selling price. Markup is based on cost. Take a cost of $100 and a selling price of $150:

  • Profit: $50
  • Markup: $50 ÷ $100 × 100 = 50%
  • Margin: $50 ÷ $150 × 100 = 33.33%
Profit margin vs markup comparison showing how each percentage is calculated
Profit margin is based on selling price, while markup is based on cost.
Metric Formula Based on Result at $100 cost, $150 price
Markup Profit ÷ Cost × 100 Cost 50%
Margin Profit ÷ Revenue × 100 Selling price 33.33%

A 50% markup does not produce a 50% margin. It produces 33.33%, because the same $50 profit sits on a larger selling-price base. Markup is always the higher figure for any profitable sale, and the gap between the two widens as profit grows.

The confusion causes real pricing damage. A seller who needs a 50% margin but applies a 50% markup prices far too low: a $60 cost marked up 50% lands at $90, which is a 33.33% margin, not 50%. You can run both calculations from the same inputs before you commit to a price.

How Do Fees and Discounts Affect Profit Margin?

Fees

Payment processing, marketplace commissions, shipping, and advertising all reduce the revenue you actually keep. Margin calculations that ignore them overstate profitability.

A $100 sale with $60 of product cost, a 3% payment fee ($3), a 10% marketplace fee ($10), and $7 of shipping leaves $20 of profit. That's a 20% margin, not the 40% a basic calculation would suggest.

Percentage-based fees deserve particular attention because they scale with the selling price. When you discount, the fee shrinks slightly, but your fixed costs don't.

Discounts

A discount changes the actual selling price, so the margin has to be calculated on the reduced price.

An item listed at $100 with a 20% discount actually sells for $80. With cost unchanged at $60:

  • Profit: $80 − $60 = $20
  • Margin: $20 ÷ $80 × 100 = 25%
Example showing how a 20 percent discount reduces profit margin from 40% to 25%
A discount can reduce profit and margin when costs stay the same.

The discount cut the margin from 40% to 25%, a proportionally larger drop than the price cut itself. Once a discount applies, the sale price is the revenue, never the original list price.

How Do You Calculate the Selling Price for a Target Margin?

To hit a target margin, divide cost by the remainder of the margin:

Selling Price = Cost ÷ (1 − Target Margin)

For a $60 cost and a 40% target margin:

Price = $60 ÷ (1 − 0.40) = $60 ÷ 0.60 = $100

How to calculate the selling price needed for a 40 percent target profit margin
A 40% target margin on a $60 cost requires a $100 selling price before percentage-based selling fees.

A common mistake is multiplying cost by (1 + target margin). $60 × 1.40 gives $84, which is a 28.57% margin, well short of the target. The formula divides because the target margin percentage has to sit inside the final price, not on top of the cost.

The simple formula above assumes no percentage-based fees. When fees are charged as a percentage of the selling price, they scale with the price itself, and the required price has to account for that feedback loop. Raising the price to reach your target also raises the fee, so the simple formula understates the price you actually need.

ToolTive's calculator lets you calculate your target selling price with percentage fees included, so the figure you publish already accounts for those fees.

What Are Common Profit Margin Calculation Mistakes?

Six errors account for most incorrect margin numbers:

  1. Using cost as the denominator. Profit divided by cost is markup, not margin. The result always looks better than the true margin.
  2. Confusing markup and margin. Pricing at "50% markup" when the plan assumes a 50% margin means the price lands well below what the business needs.
  3. Ignoring payment and marketplace fees. A 2.9% card fee plus a 15% marketplace commission can erase most of a thin product margin.
  4. Using the original price after a discount. A $100 item sold at $80 has $80 of revenue, full stop.
  5. Calling a simple product margin "net margin." Net margin includes all expenses. A price-minus-cost figure is, at best, close to gross margin.
  6. Rounding too early. Rounding 66.67% to 67% before further calculations compounds the error, especially across hundreds of units.

What Is a Good Profit Margin?

There is no single margin number that works for every business. Groceries run on thin margins and high volume. Software and services often carry much higher margins but face entirely different cost structures. Two businesses with identical margins can have very different financial health depending on volume, overhead, and cash flow.

What counts as good depends on your industry and its typical cost structure, your business model, your sales channel and its attached fees, your operating expenses, and your pricing strategy.

Rather than chasing a universal target, compare your margin against your own history, your direct competitors, and your cost trends over time. For U.S. retail data at the industry level, the U.S. Census Bureau's Annual Retail Trade Survey publishes operating expense and related statistics by sector, which can serve as one reference point for where your industry typically lands.

A margin that holds steady or improves over time usually says more than any single number.

Frequently Asked Questions

What is the formula for profit margin?

Profit Margin = (Revenue − Costs) ÷ Revenue × 100. Subtract the costs included in your calculation from revenue, divide by revenue, and multiply by 100. Which costs belong in the formula depends on the margin type you're calculating: simple product margin, gross margin, operating margin, or net margin.

How do you calculate profit margin percentage?

Take your profit, divide it by revenue (the selling price), then multiply by 100. A $40 profit on a $100 sale is a 40% margin. The multiplication by 100 converts the decimal ratio into a percentage.

What is the difference between profit margin and markup?

Margin divides profit by the selling price; markup divides profit by cost. With a $60 cost and a $100 price, the margin is 40% and the markup is 66.67%. Markup is always the larger number for the same transaction, and the gap widens as margins grow.

Does profit margin include shipping and payment fees?

It depends on the margin type. Gross margin subtracts COGS only. A practical all-in margin for a seller usually subtracts product cost, shipping, payment processing, marketplace fees, and allocated advertising. Net margin subtracts everything, including overhead and taxes.

How do I calculate the selling price needed for a target margin?

Price = Cost ÷ (1 − Target Margin). For a 40% target margin on a $60 cost, the price is $100. If percentage-based selling fees apply, the required price is higher, and ToolTive's calculator accounts for those fees automatically.

What is the difference between gross and net profit margin?

Gross margin subtracts only COGS from revenue. Net margin subtracts all expenses: COGS, operating costs, interest, and taxes. Gross margin measures production or sourcing efficiency; net margin measures final bottom-line profitability.

Can a business have a negative profit margin?

Yes. When costs exceed revenue, profit is negative and so is the margin. A $100 sale that costs $110 to deliver produces a −10% margin. Negative margins appear in early-stage businesses and during aggressive discounting, but sustained negative margins mean every sale loses money. The fix usually starts with repricing or reducing costs rather than selling more, because each additional sale widens the loss.

Putting Margin Math to Work

Margin is one of the few numbers that improves nearly every pricing decision you make. Set a target margin first, then work backward to a selling price. Recheck margin after every fee, discount, or cost change, because small shifts compound quickly. Compare gross, operating, and net margin before assuming a product line is genuinely profitable. When you want to calculate your profit margin, markup, and target pricing without the manual arithmetic, or compare pricing scenarios side by side before a sale, ToolTive's free calculator covers all of it in one place.

You'll find the calculator in ToolTive's business tools section, alongside other free calculators and generators. To browse the complete collection, explore more free tools from ToolTive.