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
- revenue number (currency)
Net revenue per unit or period.
- cost number (currency)
Cost of goods sold, direct cost, or per-unit variable cost.
- mode enum default: margin
margin | markup | price-from-margin.
Outputs
- grossMargin
(revenue − cost) / revenue, expressed as a percentage.
- markup
(revenue − cost) / cost, expressed as a percentage.
- grossProfit
revenue − cost in currency terms.
Engine source: src/lib/profit-margin-calculator/engine.ts
3. Formula / scoring logic
gross_margin = (revenue - cost) / revenue
markup = (revenue - cost) / cost
gross_profit = revenue - cost 4. Assumptions
- Revenue and cost are entered in the same currency and time window.
- Cost covers direct/variable cost only. Allocated overhead is the user's responsibility.
- 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
revenue = 100, cost = 60, mode = margin.
Expected output
gross_margin = 40%, markup = 66.67%, gross_profit = 40.
8. Change log
- 2026-04-24 methodology page first published.