StatGardenREF. DESK
Calculators/Finance/Cost Price Calculator
Finance

Cost Price Calculator

Works backward from a selling price and a margin or markup percentage to find the original cost price.

Published 1 September 2026

What this calculator does

Sometimes the selling price and a target margin or markup are known, but the underlying cost price is not, such as when reverse-engineering a competitor’s pricing or checking that a supplier’s quote lines up with an intended margin. This cost price calculator works backward from a selling price and a chosen margin or markup percentage to recover the cost price behind it.

The calculation depends on which percentage is being used, and mixing the two up gives a wrong answer. Margin is the profit expressed as a percentage of the selling price, so cost = price x (1 - margin/100). Markup is the profit expressed as a percentage of the cost itself, so cost = price / (1 + markup/100). The two percentages describe the same profit differently and are never numerically equal except at 0%.

The formula

FormulaCost = Price x (1 - margin/100) or Cost = Price / (1 + markup/100)

For margin, the cost price is the selling price reduced by the margin percentage: cost = price x (1 - margin/100). For markup, the cost price is found by dividing the selling price by one plus the markup percentage: cost = price / (1 + markup/100), since markup is applied on top of cost to reach the price.

TermMeaning
Cost priceWhat the item cost to buy or produce, before any profit is added.
MarginProfit expressed as a percentage of the selling price: (price - cost) / price x 100.
MarkupProfit expressed as a percentage of the cost price: (price - cost) / cost x 100.

The inputs explained

FieldWhat to enter
Percentage typeWhether the percentage you have is a margin (percentage of price) or a markup (percentage of cost).
Selling price ($)The known selling price.
Margin or markup (%)The margin or markup percentage that applies to that price.

When to use it

Checking a supplier or wholesale quote

If a retail price and the intended margin are set by policy, working backward gives the maximum cost price a supplier quote can come in at while still hitting that margin.

Reverse-engineering a competitor’s pricing

Given a competitor’s shelf price and an assumed typical margin or markup for that category, this estimates roughly what they are paying for the item.

Auditing pricing consistency across a product range

Recalculating implied cost price from selling price and a stated margin across many products can flag where the actual pricing has drifted from the intended margin policy.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

What cost price does a $100 selling price imply at different margins?

The same $100 selling price, under a range of margin percentages.

$100 selling price
MarginCost priceProfit per unit
10%$90.00$10.00
20%$80.00$20.00
30%$70.00$30.00
40%$60.00$40.00
50%$50.00$50.00
60%$40.00$60.00
A higher margin percentage on the same selling price implies a lower cost price, since more of that fixed price is being claimed as profit.

Questions

What is the difference between margin and markup?

Margin is profit as a percentage of the selling price; markup is profit as a percentage of the cost price. The same dollar profit gives a lower margin percentage than markup percentage, because the selling price is always larger than the cost price when there is a profit.

Why can’t I just subtract the percentage from the price for margin?

You can, and that is exactly what this calculator does for margin: cost = price x (1 - margin/100). The mistake is applying that same subtraction when the percentage given is actually a markup, which is defined against cost rather than price and needs the different formula.

What happens if I enter a margin of 100% or more?

A margin of 100% or more is not mathematically possible, since it would require the cost price to be zero or negative. The calculator flags this rather than returning a meaningless result.

Can I use this the other way, to find price from cost?

Yes, that direction, plus margin and markup calculated from a known cost and price, is covered by the margin and markup calculator.

To go the other way, working out price, margin and markup from a known cost, see the margin and markup calculator. For a fixed dollar profit split across units sold, see the break-even calculator.