Business
Margin Calculator
Calculate profit margin, markup, profit, or the selling price needed for a target margin or markup.
How this calculator works
Choose a pricing question
Calculate margin from cost and price, or find price from a margin or markup.
Enter two values
Use the same currency throughout. Margin is based on price; markup is based on cost.
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?
What is the difference between margin and markup?
How do I calculate selling price from a target margin?
How do I calculate price from markup?
Can profit margin be negative?
Can markup be negative?
Why is markup higher than margin for the same profit?
What happens if cost is zero?
Does this calculator include taxes or fees?
Does Calcora store my values?
Related calculators
- Discount Calculator
Everyday
Explore other calculations in the calculator directory.