Everyday commerce calculator

Margin Calculator

Calculate profit and margin from revenue and cost, or solve a required selling price from cost and a target margin. Profit-margin and gross-margin arithmetic consolidate here while accounting definitions remain outside the tool.

Enter values and select Calculate.

How to use this calculator

  1. Choose known revenue and cost or target-margin mode.
  2. Enter ordinary non-negative monetary values.
  3. For target mode, enter a margin below 100%.
  4. Compare the primary margin result with the equivalent markup only when defined.

Formula and method

Profit = revenue − cost. Margin = profit ÷ revenue × 100. Target price = cost ÷ (1 − target margin rate).

Worked example

Revenue of $100 and cost of $60 produce $40 profit and a 40% margin. A $60 cost with a 40% target margin requires a $100 selling price.

Assumptions and boundaries

  • Revenue is the denominator for margin.
  • Cost means the cost value supplied by the user, not a prescribed accounting definition.
  • A target margin of 100% or more has no finite non-negative selling price.
  • A loss is valid and displays as negative profit and margin.

Understanding the result

The calculator preserves full finite arithmetic through the calculation and formats ordinary money to two decimal places for display. Percentages can retain additional useful decimal precision. It never evaluates expressions or silently adds tax, fees, exchange rates, or recommendations.

Common mistakes

  • Dividing profit by cost and calling it margin
  • Entering 40 as 0.40
  • Using zero revenue as a percentage base
  • Treating the result as pricing or accounting advice

Methodology note

This deterministic browser-local utility uses only the formulas stated above and the values you supply. It provides arithmetic, not financial, investment, pricing, accounting, tax, or tipping advice.

Check source values and required precision before using a result in a purchase, invoice, business record, or other decision.