
Profit Margin Formula
Learn the formulas used to calculate profit, profit margin, markup, and cost ratio from revenue and cost.
The Profit Margin Calculator estimates how much money is left after costs and how that profit compares with revenue and cost. Understanding these formulas helps with pricing, product analysis, and basic business performance checks.
- 100% Free
- No Sign-Up Required
- Private & Secure
- Mobile Friendly
Profit Margin
Where:
Subtract cost from revenue to get profit, then divide profit by revenue and multiply by 100 to express it as a percentage.
Variables Explained
| Variable | What It Means | Unit |
|---|---|---|
| revenue - Revenue | The total selling price or total income from the sale, product, service, or period being measured. | currency |
| cost - Cost | The total cost associated with that same sale, product, service, or period. | currency |
| profit - Profit | The amount left after cost is subtracted from revenue. | currency |
| profitMargin - Profit Margin | Profit expressed as a percentage of revenue. | percent |
| markup - Markup | Profit expressed as a percentage of cost. | percent |
| costRatio - Cost Ratio | Cost expressed as a percentage of revenue. | percent |
Step-by-Step Calculation
Calculate profit
Profit is the basic amount earned after paying the related cost.
profit = revenue - cost
Calculate profit margin
Profit margin shows what share of revenue remains as profit.
profitMargin = (profit / max(revenue, 0.000001)) * 100
Calculate markup
Markup shows how much profit is earned relative to cost.
markup = (profit / max(cost, 0.000001)) * 100
Calculate cost ratio
Cost ratio shows how much of revenue is taken up by cost.
costRatio = (cost / max(revenue, 0.000001)) * 100
Example: Calculating margin from revenue and cost
Profit
1,000 - 700
300
Profit margin
(300 / 1,000) × 100
30%
Markup
(300 / 700) × 100
42.86%
Cost ratio
(700 / 1,000) × 100
70%
Final Result
With revenue of $1,000 and cost of $700, profit is $300, profit margin is 30%, markup is 42.86%, and cost ratio is 70%.
Assumptions
- ✓Revenue and cost refer to the same product, service, order, project, or time period.
- ✓The calculation uses simple gross profit relationships based only on the values entered.
- ✓Any taxes, overhead, shipping, discounts, fees, or financing costs are only included if they are already built into the input numbers.
- ✓Results are estimates and depend on the accuracy and consistency of the figures provided.
Limitations
- !The formulas do not distinguish between gross profit, operating profit, and net profit unless the user defines cost accordingly.
- !A high margin does not always mean high total profit if sales volume is low.
- !The calculator does not model break-even points, cash flow timing, or multi-product business performance.
- !Very small or zero revenue values can make percentage results less meaningful in real-world analysis.
Common Mistakes to Avoid
Comparing revenue for one period with cost from a different period.
Mixing direct costs with total business overhead without deciding which profit view is being measured.
Confusing profit margin with markup even though they use different denominators.
Leaving out discounts, refunds, or transaction fees from revenue.
Entering cost higher than revenue and assuming the negative margin is an error when it may reflect a real loss.
Related Formulas
Frequently Asked Questions
What is the formula for profit margin?
Profit margin is calculated as profit divided by revenue, multiplied by 100. Profit itself is revenue minus cost.
What is the formula for profit?
Profit equals revenue minus cost.
What is the difference between margin and markup in the formula?
Margin divides profit by revenue, while markup divides profit by cost. Because the denominator changes, the percentages are different.
How do you calculate cost ratio?
Cost ratio is cost divided by revenue, multiplied by 100. It shows how much of revenue is consumed by cost.
Can profit margin be negative?
Yes. If cost is greater than revenue, profit is negative, which creates a negative profit margin.
Why does the formula use max(revenue, 0.000001)?
It prevents division by zero in the calculation logic. In practical use, a revenue value of zero means margin and cost ratio percentages are not very useful.
Ready to calculate your result?
Use the calculator to get instant results with your own inputs.