Margin Calculator
Calculate gross margin, markup, profit per unit, and total profit—or work backward from cost and a target margin to find the required selling price.
How to use the margin calculator
Margin and markup formulas
This calculator measures gross profit before operating expenses, interest, and taxes unless those amounts are included in the cost input. It does not automatically deduct payment processing fees, discounts, returns, or tax.
Gross margin % = Gross profit ÷ Selling price × 100
Markup % = Gross profit ÷ Cost × 100
Required selling price = Cost ÷ (1 − Target margin as a decimal)
A target margin of 100% is mathematically impossible when cost is above zero because the required price would have no finite value.
Margin and markup examples
| Cost | Selling price | Profit | Margin | Markup |
|---|---|---|---|---|
| $60 | $100 | $40 | 40% | 66.67% |
| $75 | $100 | $25 | 25% | 33.33% |
| $80 | $100 | $20 | 20% | 25% |
| $80 | $160 | $80 | 50% | 100% |
Methodology, assumptions and sources
The calculator uses the unrounded input values throughout and rounds only displayed money and percentages. “Cost” is treated as the direct cost assigned by the user, so the result is a gross margin unless the user deliberately enters fully loaded cost.
Sources:
- CFA Institute — Financial Analysis Techniques — profitability-ratio context.
- OpenStax — Brand metrics and gross profit margin — gross margin definition and formula.
Last reviewed: August 2026. Results are arithmetic estimates, not accounting, tax, or pricing advice.