ThisCalculator

Business

Margin Calculation: Formula, Examples, and Meaning

Updated · Standard formula, shown below

Profit margin 40.00 %
Profit
40.00 $
Result
Markup
66.67 %
Result
Selling price
100 $
You entered

Margin Calculation: Formula, Examples, and Meaning

Margin is calculated by dividing profit by the selling price and multiplying by 100: margin (%) = (selling price − cost) ÷ selling price × 100. Enter a selling price and its cost to calculate the profit margin; the calculator also shows the profit amount and markup percentage for comparison.

Formula

Profit margin (%) = (selling price − cost) ÷ selling price × 100. In symbols, M = (S − C) / S × 100, where M is profit margin as a percentage, S is the selling price in dollars, and C is the cost in dollars. The result is a percentage: it describes the profit as a share of the selling price.

The related outputs use these formulas:

  • Profit = S − C. Profit is the difference between selling price and cost, expressed in dollars.
  • Markup (%) = (S − C) ÷ C × 100. Markup compares profit with cost, rather than with selling price.

Use the same currency and compatible cost definitions for both inputs. The calculator accepts nonnegative values, but a selling price of zero makes margin undefined because the formula would divide by zero. The standard formula also describes a loss if cost exceeds selling price, yielding a negative margin.

Worked Example

Using the calculator’s default values, the selling price is $100 and the cost is $60.

  1. Find profit: $100 − $60 = $40.
  2. Divide profit by selling price: $40 ÷ $100 = 0.4.
  3. Convert to a percentage: 0.4 × 100 = 40.00% profit margin.
  4. For comparison, markup is ($40 ÷ $60) × 100 = 66.67%.

The calculator therefore reports a margin of 40.00%, profit of $40.00, and markup of 66.67%. The dollar figures can represent another currency, provided both inputs use the same one.

What Margin Means

Margin tells you what portion of the selling price remains as profit under the cost definition you chose. In the example, the $40 profit is 40% of the $100 selling price. That does not mean the business keeps $40 as final take-home profit: other expenses may still need to be paid.

The word “cost” needs care. For a simple product calculation, it might mean the amount paid to acquire or make one unit. A broader business margin may include additional expenses, depending on whether it is gross, operating, or net margin. The arithmetic is similar, but the profit numerator and cost or expense data differ. For a meaningful comparison, define the measure consistently and use complete, comparable figures.

Margin is not the same as the dollar amount of profit. A high margin on a small sale can produce less profit in dollars than a low margin on a large sale. Margin also does not, by itself, describe cash flow, sales volume, or overall financial performance.

Margin Versus Markup

Margin and markup both compare profit with another amount, but they use different denominators. Margin divides profit by selling price; markup divides profit by cost. This is why the percentages differ even when they come from the same sale.

With a $60 cost and $100 selling price, the profit is $40. Margin is $40 ÷ $100 = 40%, while markup is $40 ÷ $60 = 66.67%. Calling the markup “margin” overstates the margin. A useful check is to ask, “Is profit being compared with the sale price or with the cost?”

Using Margin to Find a Selling Price

If you know the cost and want a particular target margin, rearrange the formula instead of adding that percentage to cost:

Selling price = cost ÷ (1 − target margin as a decimal).

For example, with a cost of $60 and a target margin of 40%, the price is $60 ÷ (1 − 0.40) = $100. A 40% markup on the same cost would instead produce a price of $84, whose margin is about 28.57%. This distinction is important when a target is stated as a margin.

This calculation is a mathematical relationship, not a recommendation for what to charge. It assumes the chosen cost figure is complete for the purpose and does not account for demand, competition, taxes, fees, or other business considerations.

Common Errors and Limits

  • Using cost as the denominator: that calculates markup, not margin.
  • Mixing units or currencies: convert quantities where necessary and express both money inputs in the same currency.
  • Leaving out relevant costs: a margin based only on purchase cost is not the same as a margin that includes overhead or other expenses.
  • Rounding too early: keep full precision in intermediate steps, then round the final percentage. This calculator displays two decimal places.
  • Assuming margin is always positive: when cost exceeds selling price, the result is a negative margin, indicating a loss on the stated calculation.
  • Using a zero selling price: margin cannot be calculated when the denominator is zero.

The formula is a simple ratio. It cannot determine which costs belong in a particular accounting measure, and results may not be comparable if different people include different expenses. To compare products or periods fairly, use the same definitions and accounting basis.

Frequently Asked Questions

How do you calculate margin?
Subtract cost from selling price, divide the result by selling price, and multiply by 100. For example, a $40 profit on a $100 sale is a 40% margin.

Is margin calculated on cost or selling price?
Profit margin is calculated on selling price. Dividing profit by cost gives markup instead.

What is the difference between margin and markup?
Both use profit, but margin divides it by selling price while markup divides it by cost. For the same sale, markup is generally a larger percentage when there is a positive profit.

How do I calculate selling price from a target margin?
Divide cost by one minus the target margin written as a decimal. For a 40% target, use cost ÷ 0.60.

Can a margin be negative?
Yes. If cost is greater than selling price, profit is negative and the calculated margin is below zero, indicating a loss under the selected cost definition.

Related

Formula used
in s | Selling price | $ | 100 | 0
in c | Cost | $ | 60 | 0
out margin | Profit margin | % | (s - c) / s * 100 | 2
out profit | Profit | $ | s - c | 2
out markup | Markup | % | (s - c) / c * 100 | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.