Skip to main content
Calcora

Business

Margin Calculator

Calculate profit margin, markup, profit, or the selling price needed for a target margin or markup.

Calculate margin or price

Choose a question and enter two values. Margin uses selling price; markup uses cost. The $ symbol is for display only.

What do you want to calculate?
Compare cost and selling price. Margin divides profit by price; markup divides profit by cost.

The cost to acquire or produce the item or service. Zero is supported where meaningful.

Greater than zero. A price below cost is a valid negative-profit case.

Money: up to $100,000,000 with two decimal places. Percentages: up to six decimal places. Taxes and fees are not included.

Private by design

Your values are calculated in your browser and are not sent to Calcora.

How this calculator works

  1. Choose a pricing question

    Calculate margin from cost and price, or find price from a margin or markup.

  2. Enter two values

    Use the same currency throughout. Margin is based on price; markup is based on cost.

  3. Compare the results

    Review cost, selling price, profit, and both percentages. Negative profit is a valid mathematical result.

Margin vs markup

Profit is the selling price minus cost. Profit margin expresses that profit as a percentage of selling price. Markup expresses the same profit as a percentage of cost.

One profit, two different bases

With cost $60.00 and price $100.00, profit is $40.00. Dividing by selling price gives a 40% margin. Dividing by cost gives a markup of approximately 66.67%.

These percentages answer different questions. Neither is universally better; use the denominator that matches the question you are calculating.

How to calculate profit, margin, and markup

Start with the cost to acquire or produce the item or service and the amount charged to the customer. Subtract cost from price to find profit, then divide that profit by the appropriate base.

Profit = selling price − cost
Margin % = profit ÷ selling price × 100
Markup % = profit ÷ cost × 100

Decimal example: cost $14.95, price $22.49

Profit is $7.54. Margin is approximately 33.53%, while markup is approximately 50.43%. Each percentage is calculated from the exact profit and its own denominator.

How to calculate price from a target margin

Divide cost by the share of the selling price that remains after the target margin. Enter the margin as a percentage, not as a markup.

Selling price = cost ÷ (1 − target margin ÷ 100)

Example: $60 cost and 40% target margin

Dividing cost by 0.60 gives a selling price of $100.00, profit of $40.00, and markup of approximately 66.67%.

A 0% target gives price equal to cost. Negative targets price below cost. A 99% target with cost $10 gives $1,000.00; the remaining price factor is 0.01. Exactly 100% makes the denominator zero and is rejected.

This mode requires positive cost. With zero cost and a positive price, margin would be 100%; a zero price would make margin not defined. Neither can achieve a target below 100%.

How to calculate price from markup

Multiply cost by one plus the markup rate. Markup measures the increase or decrease relative to cost.

Selling price = cost × (1 + markup ÷ 100)

Example: $60 cost and 50% markup

The selling price is $90.00, profit is $30.00, and margin is approximately 33.33%. A 50% markup is therefore different from a 50% margin.

A 0% markup leaves price equal to cost. Negative markup prices below cost; −100% gives zero price. Lower markup would produce a negative selling price and is not supported.

Relationship between the percentages

For positive cost and selling price, margin rate = markup rate ÷ (1 + markup rate), and markup rate = margin rate ÷ (1 − margin rate). These equations use normalized rates, so 40% is 0.40.

Losses, zero cost, and rounding

Negative profit

A price below cost is a valid mathematical result. Cost $100 and price $80 give profit −$20.00, margin −25%, and markup −20%. The calculator retains the minus signs without assigning a business judgment.

Zero denominators

With cost $0 and price $100, profit is $100.00 and margin is 100%. Markup is Not defined because its denominator is zero.

Applying any finite markup to zero cost gives zero price and zero profit; both percentage ratios are not defined. At −100% markup and positive cost, price is zero, markup is −100%, and margin is not defined. Undefined metrics remain visible and explained.

Decimal prices and display precision

Exact BigInt fractions retain sub-cent amounts and repeating percentages. Money displays two decimals, rounded half up; percentages normally show up to two, with extra digits for tiny values or values close to 100%. Rounded figures are marked with ≈. Independent rounding can create a one-cent difference when displayed parts are added. Reusing a rounded price can change the percentage slightly.

Assumptions and supported inputs

  • Cost and selling price use the same currency. The $ symbol is for display only.
  • Typed money accepts two decimal places, from $0 to $100,000,000. Percentages accept six decimals.
  • Target margins range from −1000% to less than 100%; typed markup ranges from −100% to 10,000%. Computed results are not clamped to those input ranges.
  • Profit Margin requires a positive selling price. Price from Margin requires positive cost, since zero cost cannot achieve a margin below 100% at a positive price.
  • Zero cost is valid in Profit Margin and Price from Markup. A percentage with a zero denominator is explicitly not defined.
  • All calculations retain exact fractions; only displayed amounts and percentages are rounded.
  • Taxes, platform fees, shipping, commissions, overhead not entered as cost, and revenue forecasts are not included.

Frequently asked questions

How do I calculate profit margin?
Subtract cost from selling price, divide that profit by selling price, and multiply by 100. Selling price must be greater than zero.
What is the difference between margin and markup?
Both use the same profit, but margin divides profit by selling price and markup divides profit by cost. They are not interchangeable.
How do I calculate selling price from a target margin?
Divide cost by 1 minus the target margin divided by 100. This mode supports positive cost and target margins from −1000% to less than 100%. A 100% target makes the denominator zero.
How do I calculate price from markup?
Multiply cost by 1 plus the markup divided by 100. Typed markup can range from −100% to 10,000%. A −100% markup produces a zero selling price.
Can profit margin be negative?
Yes. A selling price below cost gives negative profit and negative margin. For cost $100 and price $80, profit is −$20.00 and margin is −25%.
Can markup be negative?
Yes. Negative markup represents a price below cost. This tool supports typed markup down to −100%, which reduces price to zero; values below that would create a negative price.
Why is markup higher than margin for the same profit?
For positive profit, cost is smaller than selling price, so dividing profit by cost gives a larger percentage. With zero profit both are zero. Negative-profit cases retain their signs and use the same distinct denominators.
What happens if cost is zero?
With a positive selling price, profit equals price and margin is 100%, but markup is not defined. Applying any finite markup to zero cost gives zero price and profit, with both percentage ratios not defined. Price from Margin requires positive cost.
Does this calculator include taxes or fees?
No. Results use only the cost and price entered. Taxes, platform fees, shipping, commissions, units sold, and revenue forecasts are not added.
Does Calcora store my values?
No. Your values are calculated in your browser and are not sent to Calcora. They are not stored, logged, or placed in the page URL.

Related calculators

Explore other calculations in the calculator directory.