1. Scope
A directional converter between margin, markup, and discount. Depending on the mode it solves FROM a target percent TO a price (or from prices to a discount). It does not compute multi-step trade discounts or cumulative retailer markups across a chain.
2. Inputs and outputs
Inputs
- mode enum default: margin_to_price
margin_to_price | markup_to_price | discount_to_sale | sale_to_discount.
- cost number (currency)
- margin_percent percent
Required for margin_to_price.
- markup_percent percent
Required for markup_to_price.
- list_price number (currency)
Required for discount_to_sale and sale_to_discount.
- discount_percent percent
Required for discount_to_sale.
- sale_price number (currency)
Required for sale_to_discount.
Outputs
- salePrice
The computed sale price (or the entered one in sale_to_discount).
- grossProfit
salePrice − cost.
- marginPercent
(salePrice − cost) / salePrice × 100.
- markupPercent
(salePrice − cost) / cost × 100.
- discountPercent / formulaTrace / warnings
Discount off list, the formula used, and any sanity warnings.
Engine source: src/lib/margin-markup-discount-calculator/engine.ts
3. Formula / scoring logic
margin_to_price : sale_price = cost / (1 - margin_percent/100)
markup_to_price : sale_price = cost * (1 + markup_percent/100)
discount_to_sale : sale_price = list_price * (1 - discount_percent/100)
sale_to_discount : discount_percent = (list_price - sale_price) / list_price * 100 4. Assumptions
- Each mode requires its own inputs; other percent/price fields are ignored.
- Discount is applied to a single list price — multi-tier trade discounts (distributor → retailer → consumer) are not modelled.
5. Data sources
This tool relies on user inputs and standard arithmetic; no external benchmark data is bundled. When a question depends on an industry reference (for example, typical churn rates or hourly-wage medians), the linked adjacent tools cite their primary sources on their own methodology pages.
6. Known limitations
- Ignores tax and fee layers (VAT, platform fees). Net those out before entry.
- Rounding is cosmetic. The underlying math is double-precision.
7. Reproducibility
Input
mode = margin_to_price, cost = $40, margin_percent = 35.
Expected output
salePrice = $61.54, grossProfit = $21.54, marginPercent = 35, markupPercent = 53.85.
8. Change log
- 2026-04-24 methodology page first published.
Worked example
Run live against the same engine this site ships
(/engines/margin-markup-discount-calculator.js).
The inputs and outputs below are recomputed on every build and
independently re-verified in CI — they are never hand-authored.
Input
- tool
- margin_markup_discount
- mode
- margin_to_price
- cost
- 40
- margin_percent
- 35
Output
- mode
- margin_to_price
- cost
- 40
- salePrice
- 61.54
- grossProfit
- 21.54
- marginPercent
- 35
- markupPercent
- 53.85
- formulaTrace
- sale_price = cost / (1 - margin_percent/100)
- assumptionsEcho.mode
- margin_to_price
- assumptionsEcho.cost
- 40
- assumptionsEcho.inputMarginPercent
- 35
Frequently asked questions
- What does the Profit Margin / Markup / Discount Calculator calculate?
- A directional converter between margin, markup, and discount. Depending on the mode it solves FROM a target percent TO a price (or from prices to a discount). It does not compute multi-step trade discounts or cumulative retailer markups across a chain.
- What inputs does the Profit Margin / Markup / Discount Calculator need?
- It takes 7 inputs: mode (default margin_to_price), cost, margin_percent, markup_percent, list_price, discount_percent, sale_price. Outputs returned: salePrice, grossProfit, marginPercent, markupPercent, discountPercent / formulaTrace / warnings.
- What formula does the Profit Margin / Markup / Discount Calculator use?
- The exact computation is: margin_to_price : sale_price = cost / (1 - margin_percent/100); markup_to_price : sale_price = cost * (1 + markup_percent/100); discount_to_sale : sale_price = list_price * (1 - discount_percent/100); sale_to_discount : discount_percent = (list_price - sale_price) / list_price * 100
- Can I verify the Profit Margin / Markup / Discount Calculator with a worked example?
- Yes. With mode = margin_to_price, cost = $40, margin_percent = 35. the tool returns salePrice = $61.54, grossProfit = $21.54, marginPercent = 35, markupPercent = 53.85.
- Does the Profit Margin / Markup / Discount Calculator bundle any external benchmark data?
- No. It runs standard arithmetic on the values you enter; no external benchmark dataset is bundled. Industry references, where relevant, are cited on the adjacent tools' methodology pages.
- What can the Profit Margin / Markup / Discount Calculator not tell me?
- Known limitations: Ignores tax and fee layers (VAT, platform fees). Net those out before entry. Rounding is cosmetic. The underlying math is double-precision.