1. Scope
Converts revenue and cost inputs into gross margin, markup, and profit. It does not model variable versus fixed costs, fully-absorbed manufacturing overhead, tax, or currency effects — those belong to dedicated tools.
2. Inputs and outputs
Inputs
- mode enum default: margin
margin | price. Any other value is treated as margin.
- revenue number (currency)
Margin mode: net revenue per unit or period.
- cost_of_goods number (currency)
Margin mode: direct cost of goods sold.
- operating_expenses number (currency) default: 0
Margin mode: added to cost of goods. The reported margin is really an operating margin when this is non-zero.
- cost number (currency)
Price mode only: unit cost to mark up to a target margin.
- desired_margin_percent percent
Price mode only: the gross margin you want the price to hit.
Outputs
- grossMarginPercent
(revenue − cost) / revenue × 100, where cost = cost_of_goods + operating_expenses in margin mode.
- markupPercent
(revenue − cost) / cost × 100.
- profit
revenue − cost in currency terms.
- revenue
Echoes the input in margin mode; in price mode, the price that hits the target margin.
- cost
cost_of_goods + operating_expenses in margin mode; the entered unit cost in price mode.
Engine source: src/lib/profit-margin-calculator/engine.ts
3. Formula / scoring logic
margin mode:
cost = cost_of_goods + operating_expenses
gross_margin_percent = (revenue - cost) / revenue * 100
markup_percent = (revenue - cost) / cost * 100
profit = revenue - cost
price mode:
revenue = cost / (1 - desired_margin_percent / 100) 4. Assumptions
- Revenue and costs are entered in the same currency and time window.
- In margin mode the engine sums cost_of_goods and operating_expenses into a single cost, so the reported gross margin equals an operating margin whenever operating_expenses is non-zero.
- No tax, discount, or refund is netted out — compute those upstream.
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
- No benchmark layer: the tool does not judge whether the resulting margin is healthy for a given industry. Consult sector references (for example, NYU Stern's margin-by-industry dataset) separately.
- Does not distinguish gross margin from contribution margin or net margin; the label reflects the formula above, not US-GAAP line-item definitions.
- Rounding is display-only; internal math is double-precision.
7. Reproducibility
Input
mode = margin, revenue = 100, cost_of_goods = 60, operating_expenses = 0.
Expected output
grossMarginPercent = 40, markupPercent = 66.67, profit = 40, cost = 60.
8. Change log
- 2026-04-24 methodology page first published.
Worked example
Run live against the same engine this site ships
(/engines/profit-margin-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
- profit_margin_calculator
- cost
- 0
- desired_margin_percent
- 40
- cost_of_goods
- 60000
- operating_expenses
- 25000
- revenue
- 100000
Output
- revenue
- 100000
- cost
- 85000
- profit
- 15000
- grossMarginPercent
- 15
- markupPercent
- 17.65
Frequently asked questions
- What does the Profit Margin Calculator calculate?
- Converts revenue and cost inputs into gross margin, markup, and profit. It does not model variable versus fixed costs, fully-absorbed manufacturing overhead, tax, or currency effects — those belong to dedicated tools.
- What inputs does the Profit Margin Calculator need?
- It takes 6 inputs: mode (default margin), revenue, cost_of_goods, operating_expenses (default 0), cost, desired_margin_percent. Outputs returned: grossMarginPercent, markupPercent, profit, revenue, cost.
- What formula does the Profit Margin Calculator use?
- The exact computation is: margin mode:; cost = cost_of_goods + operating_expenses; gross_margin_percent = (revenue - cost) / revenue * 100; markup_percent = (revenue - cost) / cost * 100; profit = revenue - cost; price mode:; revenue = cost / (1 - desired_margin_percent / 100)
- Can I verify the Profit Margin Calculator with a worked example?
- Yes. With mode = margin, revenue = 100, cost_of_goods = 60, operating_expenses = 0. the tool returns grossMarginPercent = 40, markupPercent = 66.67, profit = 40, cost = 60.
- Does the Profit Margin 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 Calculator not tell me?
- Known limitations: No benchmark layer: the tool does not judge whether the resulting margin is healthy for a given industry. Consult sector references (for example, NYU Stern's margin-by-industry dataset) separately. Does not distinguish gross margin from contribution margin or net margin; the label reflects the formula above, not US-GAAP line-item definitions. Rounding is display-only; internal math is double-precision.