Profit margin calculator
Profit margin is profit divided by revenue, shown as a percentage. Profit is revenue minus the costs you include. Include only cost of goods sold for gross margin; include all costs, including overhead, interest and taxes, for net margin.
Scenarios
Margin —
Margin —
Margin —
Margin comparison
Inputs
- Revenue
- Sales for the period.
- Costs
- The costs for the margin you want: cost of goods sold for gross margin, all costs for net margin.
- Scenario revenue and costs
- Optional alternatives you enter yourself.
Outputs
- Profit
- Revenue − costs.
- Margin
- Profit ÷ revenue × 100. Undefined when revenue is zero.
- Comparison
- Bars for each scenario's margin.
How it is calculated
Profit = revenue − costs
Margin (%) = profit ÷ revenue × 100
Negative profit gives a negative margin. With zero revenue the margin can't be calculated.
Worked example (illustrative)
Illustrative only: revenue $1,000,000 and cost of goods sold $600,000 give $400,000 gross profit and a 40% gross margin. If all costs total $880,000, net profit is $120,000 and net margin 12%.
Assumptions and limitations
- The cost basis is your choice; label the result gross or net accordingly.
- Margin is not markup. A 50% markup is a 33.3% margin.
- Any additional revenue scenario uses only your assumptions; nothing is projected for you.
Questions and answers
How do I calculate profit margin?
Subtract costs from revenue to get profit, divide profit by revenue, and multiply by 100.
What is the difference between gross and net margin?
Gross margin uses only direct costs of producing what you sell. Net margin uses all costs, including overhead, interest and taxes.
What is a good profit margin?
It depends heavily on industry and business model. Compare against your own history and sector benchmarks from a trusted source.
What is the difference between margin and markup?
Margin divides profit by price; markup divides profit by cost. The same deal has a lower margin percentage than markup percentage.
Can a margin be negative?
Yes. When costs exceed revenue, profit and margin are negative.
Why can't margin be calculated at zero revenue?
Margin divides by revenue, and division by zero is undefined.
Sources
Content reviewed October 9, 2026 by the SourceX Partnerships Team. Results are calculated in your browser; nothing you type is stored.