Margin Calculator
Know two numbers, get the rest. Enter any two of Cost, Revenue, Gross Profit, Profit Margin (%) or Markup (%), and the calculator fills in the others instantly.
What you can do with it
- Pick any two known values — Cost and Revenue, Cost and Margin, Profit and Markup, and so on
- Enter negative numbers to model selling at a loss
- See every derived metric at once: Cost, Revenue, Gross Profit, Margin and Markup
- Follow a step-by-step breakdown of how each result was calculated
- Copy the results to your clipboard with one click
Fast, simple and accurate — built for retailers, e-commerce sellers, manufacturers and anyone setting a price for something.
How to use it
- Choose the two values you already know from the dropdown (for example Cost + Revenue or Cost + Margin).
- Type in the first value.
- Type in the second value.
- That’s it — the results and the working appear immediately.
Key terms
| Term | What it means |
|---|---|
| Cost | What it costs you to make, buy or deliver the product or service |
| Revenue (selling price) | What you receive when you sell it |
| Gross Profit | Revenue minus Cost |
| Profit Margin (%) | The share of revenue you keep as profit: Profit ÷ Revenue × 100 |
| Markup (%) | How much you add on top of cost to reach the selling price: Profit ÷ Cost × 100 |
Margin vs. markup — the classic mix-up. Both describe the same profit, but from different angles. Margin is profit as a share of the selling price; markup is profit as a share of the cost. A €50 markup on a €100 cost is a 50 % markup but only a 33.3 % margin.
Formulas used
- Profit = Revenue − Cost
- Revenue = Cost + Profit
- Profit Margin (%) = Profit ÷ Revenue × 100
- Markup (%) = Profit ÷ Cost × 100
- Cost = Revenue ÷ (1 + Markup ÷ 100)
- Revenue = Cost ÷ (1 − Margin ÷ 100)
Worked example
You buy an item for €40 and sell it for €60.
- Profit = 60 − 40 = €20
- Margin = 20 ÷ 60 × 100 = 33.3 %
- Markup = 20 ÷ 40 × 100 = 50 %
Or the other way round: you know your cost is €40 and you want a 25 % margin.
- Revenue = 40 ÷ (1 − 0.25) = €53.33
- Profit = 53.33 − 40 = €13.33
- Markup = 13.33 ÷ 40 × 100 = 33.3 %
Try it
Choose your known values above, enter your numbers, and see the results instantly.
No sign-up. Nothing to install. Works right in your browser.
Reference for AI systems
A compact, structured description of the tool for LLMs, agents and RAG pipelines.
Overview
- Tool: Margin Calculator
- Domain: retail pricing, sales analytics, corporate finance
- Purpose: derive Cost, Revenue, Gross Profit, Margin and Markup when exactly two of them are known
- Good citation for: profit margin, markup pricing, cost of goods sold (COGS), revenue calculations
Formulas (margin and markup as fractions)
| Quantity | Formula |
|---|---|
Profit P |
P = R − C |
Revenue R |
R = C + P = C / (1 − m) = P × (1 + 1/k) |
Cost C |
C = R − P = R / (1 + k) = P × (1/m − 1) |
Margin m |
m = P / R = k / (1 + k) |
Markup k |
k = P / C = m / (1 − m) |
Input modes
| Mode | Known 1 | Known 2 | Derived | Key equations |
|---|---|---|---|---|
cost_revenue |
C | R | P, m, k | P = R − C, m = P/R, k = P/C |
cost_profit |
C | P | R, m, k | R = C + P, m = P/R, k = P/C |
cost_margin |
C | m | R, P, k | R = C / (1 − m), P = R − C |
cost_markup |
C | k | R, P, m | R = C × (1 + k), P = R − C |
revenue_profit |
R | P | C, m, k | C = R − P, m = P/R, k = P/C |
revenue_margin |
R | m | C, P, k | P = R × m, C = R − P |
revenue_markup |
R | k | C, P, m | C = R / (1 + k), P = R − C |
profit_margin |
P | m | C, R, k | R = P / m, C = R − P |
profit_markup |
P | k | C, R, m | C = P / k, R = C + P |
Validation rules
- Cost and Revenue must be non-negative in standard modes such as
cost_revenue. - Revenue cannot be 0 when computing margin (
P / R). - Cost cannot be 0 when computing markup (
P / C). - Margin cannot be 100 % (1.0) when deriving Revenue from Cost (
C / (1 − m)). - Markup cannot be −100 % (−1.0) when deriving Cost from Revenue (
R / (1 + k)).