Profit Margin Calculator
Enter any two values — cost, revenue, profit, or margin — and the other two update instantly. Use cost of goods sold for a gross margin calculation, or total relevant costs for a broader profit margin estimate.
Profit margin
40.00%
$40.00 profit on $100.00 revenue
- Revenue
- $100.00
- Cost / COGS
- $60.00
- Profit
- $40.00
- Markup on cost
- 66.67%
Calculation
Margin divides profit by revenue. Markup divides the same profit by cost.
$100.00 − $60.00 = $40.00
$40.00 ÷ $100.00 × 100 = 40.00%
This is arithmetic on the values you enter. For company analysis, check which costs the reported margin includes before comparing businesses.
Put the margin into an investor context
A margin is useful only when its definition and assumptions match the company you are analyzing.
Use a DCF model to connect operating assumptions, growth, reinvestment, and discounting instead of treating one margin percentage as a valuation.
Open the DCF calculatorHow to use the profit margin calculator
Enter the two numbers you know
Start with any pair. Cost and revenue is the common gross margin route, but you can also work backward from a target margin and profit, revenue, or cost.
Change direction by editing a result
Every field remains editable. When you edit a calculated value, it becomes one of the two inputs and the calculator solves the remaining fields from the new pair.
Read margin and markup separately
Profit margin uses revenue as its denominator. Markup uses cost. The percentages answer different questions even though both begin with the same dollar profit.
How to calculate profit margin
Subtract cost from revenue to find profit. Then divide profit by revenue and multiply by 100. If revenue is $100 and cost is $60, profit is $40 and the profit margin is 40%.
Profit margin = (revenue − cost) ÷ revenue × 100
How to calculate gross margin
For gross margin, use net sales as revenue and cost of goods sold, or COGS, as cost. Gross profit excludes operating expenses, interest, and tax, so gross margin should not be labeled net profit margin.
Gross margin = (net sales − COGS) ÷ net sales × 100
Margin is not markup
Margin measures profit against revenue; markup measures profit against cost. A product that costs $60 and sells for $100 has a 40% margin but a 66.67% markup. Substituting one for the other can produce the wrong selling price.
Markup = (revenue − cost) ÷ cost × 100
Using margins in stock analysis
Investors commonly compare gross, operating, and net margins across time and against similar companies. Use the same accounting definition and period for every comparison. A higher margin is not automatically better if it comes from a temporary mix shift, reduced investment, unusual gains, or a different business model.
Profit and gross margin examples
The same four numbers can be solved from different starting points.
- From revenue and cost. $100 revenue minus $60 cost equals $40 profit. $40 ÷ $100 gives a 40% margin.
- From cost and target margin. With $60 cost and a 40% target margin, revenue must be $60 ÷ (1 − 0.40) = $100.
- From revenue and margin. On $250,000 revenue at a 30% margin, profit is $75,000 and the included cost is $175,000.
- Loss margin. $100 revenue with $120 of cost produces a −$20 profit and a −20% margin.
Profit margin questions
Formulas, gross margin, markup, and the limits of comparing company margins.
Basics
How do you calculate profit margin?
Subtract costs from revenue to get profit. Divide that profit by revenue and multiply by 100. For $100 of revenue and $60 of cost, profit is $40 and profit margin is 40%.
What is the profit formula?
Profit equals revenue minus cost. The meaning of the result depends on which costs you include: COGS gives gross profit, operating costs give operating profit, and all relevant expenses give net profit.
How do I calculate revenue from profit and margin?
Convert margin to a decimal and divide profit by it. A $40 profit at a 40% margin implies $40 ÷ 0.40 = $100 of revenue. Profit and margin must have compatible signs, and a zero margin cannot determine revenue from profit alone.
How do I calculate cost from revenue and margin?
Multiply revenue by one minus the margin rate. At $100 of revenue and a 40% margin, cost is $100 × (1 − 0.40) = $60.
Can a profit margin be negative?
Yes. A negative margin means included costs exceed revenue. Revenue of $100 and cost of $120 creates a −$20 profit and a −20% margin.
Can profit margin be more than 100%?
Not when revenue and cost are both nonnegative and profit is revenue minus cost. A 100% margin already implies zero included cost. Metrics built from gains, subsidies, negative costs, or different accounting definitions may behave differently.
Gross margin
How do you calculate gross margin?
Subtract cost of goods sold from net sales to get gross profit. Then divide gross profit by net sales and multiply by 100. Use consistent periods and the company's reported classification of COGS.
What is the difference between gross profit and gross margin?
Gross profit is a currency amount: net sales minus COGS. Gross margin expresses that gross profit as a percentage of net sales, which makes different periods or businesses easier to compare.
What should I include in COGS?
Use the costs the business classifies as directly tied to producing or delivering the goods or services sold. Classification varies by industry and accounting policy, so use the reported financial statements when analyzing a public company.
What is the difference between gross margin and net margin?
Gross margin subtracts COGS from sales. Net margin uses net income after operating expenses, interest, taxes, and other included items. They describe different layers of profitability and should not be compared as if they were the same metric.
What is the difference between gross margin and operating margin?
Operating margin goes further down the income statement by subtracting operating expenses from gross profit. It reflects the economics of running the business before financing and tax, subject to the company's reporting definitions.
Can I use gross margin for a service business?
Yes when the business reports a meaningful cost of revenue or cost of services. Compare companies only after checking that they classify delivery labor, hosting, support, and similar costs in comparable ways.
Margin vs markup
What is the difference between margin and markup?
Margin divides profit by revenue; markup divides profit by cost. With a $60 cost and $100 selling price, margin is 40% while markup is 66.67%.
How do I convert markup to margin?
Convert markup to a decimal, then divide it by one plus itself. A 50% markup becomes 0.50 ÷ 1.50 = 33.33% margin.
How do I convert margin to markup?
Convert margin to a decimal, then divide it by one minus itself. A 40% margin becomes 0.40 ÷ 0.60 = 66.67% markup.
How do I find selling price from cost and target margin?
Divide cost by one minus the target margin expressed as a decimal. A $60 cost at a 40% target margin needs a $100 selling price. Using a 40% markup instead would produce only an $84 price.
Why is markup undefined when cost is zero?
Markup divides profit by cost, so zero cost creates division by zero. Margin can still be calculated from positive revenue, but the calculator displays a dash for markup rather than inventing a percentage.
Company analysis
What is a good profit margin?
There is no universal good margin. Capital intensity, competition, recurring revenue, product mix, accounting choices, and the stage of the business all matter. Compare the same metric over time and against genuinely similar companies.
How should investors compare company margins?
Use the same margin definition, reporting period, currency treatment, and business segment where possible. Review several periods and read the financial-statement notes for reclassifications or unusual items.
Is a higher margin always better for investors?
No. A higher margin can reflect pricing power and efficiency, but it can also be temporary or result from underinvesting, favorable product mix, asset sales, or accounting changes. Growth, cash conversion, durability, and reinvestment needs provide necessary context.
Does CalcStocks store the values I enter?
No. The calculation runs in your browser and inputs are not sent to a server. A copied link can contain the two values you chose, so review it before sharing if the figures are sensitive.
Is the calculator investment or accounting advice?
No. It performs arithmetic on your inputs. It does not verify financial statements, choose an accounting definition, value a stock, or recommend an investment.
More stock calculators
Continue from business profitability into valuation and market context.
DCF Calculator
Two-stage discounted cash flow with a fade period, a reverse DCF that shows the growth the price already implies, and a full sensitivity grid.
Benjamin Graham Formula Calculator
Graham's growth formula, the bond-yield revised version, and the Graham Number — all three on one page, clearly labelled as the different things they are.
CAPE Ratio Calculator
Cyclically adjusted P/E from your own earnings history, with each year inflation-adjusted — shown next to the plain one-year P/E so the difference is visible.
Method and limitations
The calculator uses profit = revenue − cost, margin = profit ÷ revenue, and markup = profit ÷ cost. Calculations run locally in your browser. The interface accepts any valid pair and algebraically solves the same equations in reverse.
For financial-statement analysis, labels matter more than the arithmetic: gross, operating, pretax, and net margins include different costs. Confirm the company's definition and use consistent periods before comparing results.