Skip to content

Profit Margin Calculator: Margin & Markup

Calculate profit margin, markup, gross profit, and selling price from any two values. Shows margin vs markup: a 25% markup equals a 20% margin.

Profit Margin and Markup Calculator

Results

Margin
20.00%

(price − cost) ÷ price, a share of the price

Markup
25.00%

(price − cost) ÷ cost, a share of the cost

Selling price
125.00
Cost
100.00
Gross profit
25.00

Sold above cost

A 25.00% markup on cost is a 20.00% margin on price.
Loading calculator...
📚

Documentation

Profit Margin Calculator

A profit margin calculator works out how much of a sale is profit. Enter any valid pair of cost, selling price, margin, or markup, and it returns all five pricing numbers: cost, selling price, gross profit, margin, and markup.

What the calculator does

The calculator starts from the pair of values that are known. There are four modes:

  • Cost and selling price: the most common case, when both numbers exist.
  • Cost and margin: finds the selling price that hits a target margin.
  • Cost and markup: finds the selling price from a markup on cost.
  • Selling price and margin: works backwards to the cost that a price and margin imply.

Every mode reduces to one cost and one price. Both percentages are then read from that pair, so margin and markup always agree with each other. All results are shown to two decimal places.

Profit margin formula

Gross profit is the selling price minus the cost:

G=PCG = P - C

Margin expresses that profit as a share of the selling price:

M=PCP×100M = \frac{P - C}{P} \times 100

Markup expresses the same profit as a share of the cost:

U=PCC×100U = \frac{P - C}{C} \times 100

where C is the cost of the item, P the selling price and G the gross profit. M is the margin, a percentage whose denominator is the price; U is the markup, a percentage whose denominator is the cost. The numerator is the same profit in both.

When the price is unknown, the calculator solves for it:

  • From cost and margin: P=C1M÷100P = \frac{C}{1 - M \div 100}. The margin must be below 100%.
  • From cost and markup: P=C×(1+U÷100)P = C \times (1 + U \div 100). The markup must be above −100%.
  • From price and margin: C=P×(1M÷100)C = P \times (1 - M \div 100).

Margin vs. markup

Margin and markup describe the same profit with different denominators. Margin divides profit by the price. Markup divides profit by the cost. This is the standard convention in accounting and retail, and it is the one this calculator uses.

The two are easy to confuse because they use the same inputs. For any profitable sale, the markup number is always larger than the margin number, since the cost is smaller than the price. An item that costs $100 and sells for $125 earns $25 of profit. That $25 is 25% of the $100 cost, so the markup is 25%. The same $25 is 20% of the $125 price, so the margin is 20%. A 25% markup and a 20% margin describe the same sale.

Mixing them up is expensive. A shop that wants a 50% margin but applies a 50% markup will price a $40 item at $60. The margin on that price is only 33.33%. The price that gives a 50% margin is $80, which is a 100% markup.

Worked example

Each example below uses one of the calculator's four modes.

Cost and selling price. Cost $100, price $125. Profit is $125 − $100 = $25. Margin is 25 ÷ 125 × 100 = 20%. Markup is 25 ÷ 100 × 100 = 25%.

Cost and margin. Cost $60, target margin 40%. Price is 60 ÷ (1 − 0.40) = $100. Profit is $40. Markup is 40 ÷ 60 × 100 = 66.67%.

Cost and markup. Cost $80, markup 50%. Price is 80 × 1.50 = $120. Profit is $40. Margin is 40 ÷ 120 × 100 = 33.33%.

Selling price and margin. Price $200, margin 35%. Cost is 200 × (1 − 0.35) = $130. Profit is $70. Markup is 70 ÷ 130 × 100 = 53.85%.

Losses and limits

A price below cost is allowed and produces a loss. The profit, margin, and markup all come out negative, and the calculator labels the result as sold below cost. Selling at cost gives a profit of zero and is labeled break-even.

An item that costs $50 and sells for $40 loses $10. The margin is −10 ÷ 40 × 100 = −25%, and the markup is −10 ÷ 50 × 100 = −20%.

Some inputs have no valid answer, and the calculator reports them as invalid rather than guessing:

  • Cost and price must both be greater than 0.
  • A margin of 100% or more would require an infinite or negative price.
  • A markup of −100% or less would require a price of zero or below.

An empty required field shows no result at all. The calculator never treats a blank field as zero.

Converting between margin and markup

Because both percentages come from the same cost and price, each one determines the other:

U=M100M×100U = \frac{M}{100 - M} \times 100

M=U100+U×100M = \frac{U}{100 + U} \times 100

with M the margin and U the markup, as above: the margin denominator carries the price, the markup denominator the cost.

A 20% margin converts to 20 ÷ 80 × 100 = 25% markup. A 50% markup converts to 50 ÷ 150 × 100 = 33.33% margin.

Frequently asked questions

How is profit margin calculated? Subtract the cost from the selling price, divide by the selling price, and multiply by 100. An item bought for $100 and sold for $125 has a margin of (125 − 100) ÷ 125 × 100 = 20%.

What is the difference between margin and markup? Both divide the same profit by a different base. Margin divides by the selling price; markup divides by the cost. Markup is always the larger number on a profitable sale. A 25% markup equals a 20% margin.

What is a good profit margin? It depends on the industry. Grocery stores often run gross margins under 30%, while software companies can exceed 70%. Compare a margin to similar businesses, not to a single universal target.

Why can't the margin be 100%? A 100% margin would mean the entire price is profit, which requires a cost of zero. The formula P=C1M÷100P = \frac{C}{1 - M \div 100} divides by zero at 100%, so the calculator rejects margins of 100% or more.

Can margin be negative? Yes. Selling below cost gives a negative profit, so the margin and markup are negative too. A $50 item sold for $40 has a −25% margin and a −20% markup.

Is this gross margin or net margin? Gross margin. The calculation uses only the cost of the item and its selling price. Net margin would also subtract overhead such as rent, wages, and taxes, which this calculator does not include.