Margin Calculator

Calculate profit margin, stock trading margin, and currency exchange margin. Provide any two values in the Profit Margin section to calculate the rest.

i
Modify the values and click Calculate to use
Profit Margin Calculator
Calculate cost, revenue, profit and margin in seconds. Enter any two values and get the rest instantly — useful for pricing products and checking your margins.
$
$
%
$
📊 Result
Cost: —
Profit margin: —
Margin:
Profit:
Markup:
Cost:
Revenue:
Cost: The cost of the product.   Revenue: The income generated by selling the product.   Profit: The money left after deducting cost from revenue.   Margin: The percentage of profit vs. revenue.   Markup: The percentage of profit vs. cost.
i
Modify the values and click Calculate to use
Stock Trading Margin Calculator
Calculate the required amount or maintenance margin needed to make a securities purchase on margin.
$
%
📊 Result
Amount Required:
Total Stock Value:
Borrowed Amount:
Note: U.S. Regulation T allows borrowing up to 50% of the purchase cost as initial margin. FINRA maintenance margin requirements are at least 25%.
Stock Price: The per-share stock price.   Number of Shares: The number of shares you want to purchase.   Margin Requirement: The percentage required by the broker to make the margin purchase.   Amount Required: The minimum amount required in your account to purchase.
i
Modify the values and click Calculate to use
Currency Exchange Margin Calculator
Calculate the minimum amount to maintain in your margin account to make a currency trade.
📊 Result
Amount Required:
Total Value:
Leverage:
Margin %:
Note: A 2% margin requirement is equivalent to 50:1 leverage. Currency traders often use 50:1, 100:1 or higher leverage depending on their broker and jurisdiction.
Exchange Rate: The exchange rate of the currency to purchase, in your home currency.   Margin Ratio: The leverage ratio to use.   Units: The amount of currency to purchase.   Amount Required: The amount required in your home currency to make the purchase.

Margin Calculator: Work Out Profit, Gross & Net Margins in Seconds

Our free profit margin calculator will help you to work out gross, net and profit margin in seconds, set a selling price from a target margin, or convert between margin and markup. Three numbers that are constantly getting confused and leading to real pricing mistakes. Whether you’re pricing a product, looking at last quarter’s numbers or comparing your business to industry benchmarks, this tool has you covered above the fold. Below it, this guide walks through every formula behind the calculator, with plain, original worked examples for gross margin, net margin, markup conversion and even a UK-specific section on VAT-exclusive pricing and corporation tax marginal relief.

How to Calculate Profit Margin (Formulas + Examples)

Profit margin is a percentage measurement of how much of your revenue is profit. That’s the broadest definition of “margin” and it’s the number most people are referring to when they ask how do you calculate margin.

Profit Margin % = (Revenue − Costs) ÷ Revenue × 100

Worked example: You sell a product for $80 and it costs you $50 to make or buy it.

Profit margin = ($80-$50) / $80 x 100 = $30 / $80 x 100 = 37.5%

That means 37.5 cents of every dollar in revenue is profit and the remaining 62.5 cents is your cost.

Reverse Margin Calculation: Setting a Price From a Target Margin

Sometimes you know your cost and your target margin and have to work backwards to get the right selling price. This is one of the most practical uses of a margin calculator and it is a different formula from the one above, not just the same formula flipped around.

Price = Cost ÷ (1 − Target Margin)

Worked example: Your cost is $50, and you want a 40% margin.

Price = $50 ÷ (1 − 0.40) = $50 ÷ 0.60 = $83.33

Notice this is not the same as simply adding 40% to your cost (which would give you $70). That common mistake actually results in a lower margin than intended, which is exactly the kind of pricing mistake the margin-versus-markup section further down this page is there to prevent.

Gross Margin Calculator: Formula and Example

It is not as comprehensive as the total profit margin. This only considers the direct cost of making or buying what you sold, called the Cost of Goods Sold (COGS). It ignores bigger operating costs like rent, marketing or admin salaries.

Gross Margin % = (Revenue − COGS) ÷ Revenue × 100

COGS generally includes the cost of raw materials, direct manufacturing labour and wholesale costs to buy goods that are resold. It doesn’t include indirect costs such as office rent, marketing spend or salaries for staff who aren’t directly producing the product. These are included in the gross margin calculator that follows.

Worked example: A retail business had $120,000 revenue for the quarter. Its COGS (the cost of the goods it resold) is $72,000.

Gross Margin = ($120,000 – $72,000)/$120,000 * 100 = $48,000/$120,000 * 100 = 40%

Such a gross profit margin calculator, like the one above, is especially helpful in retail and product businesses where COGS is generally the largest single expense and the most obvious indicator of whether your pricing is actually covering what you are selling.

Net Margin Calculation: The Full Picture

Net margin calculation goes one step further than gross margin, subtracting all of the costs the business incurs, not just COGS. That includes the operating expenses, interest on debt and taxes. This is why the net margin is almost always a smaller percentage than gross margin for the same business.

Net Margin % = Net Profit ÷ Revenue × 100

Here’s how the same business’s numbers flow through all three margin types, gross, operating, and net, using one continuous example:

Stage

Line Item

Running Profit

Margin

Start

Revenue

$120,000

n/a

Subtract

COGS ($72,000)

Gross Profit = $48,000

40% gross margin

Subtract

Operating expenses, rent/wages/marketing ($30,000)

Operating Profit = $18,000

15% operating margin

Subtract

Interest ($2,000) and tax ($4,000)

Net Profit = $12,000

10% net margin

Notice how the margin shrinks at each stage: 40% gross, down to 15% operating, down to 10% net. Looking only at net margin calculation can make a business look far healthier than it actually is since it ignores everything below the COGS line.

Margin vs Markup: Don’t Mix Them Up

The most common price error and one that is expensive. Both margin calculator and markup compare profit to a number, but they differ in the fact that margin uses revenue and markup uses cost. Confusing the two almost always leads to the wrong selling price.

Markup % = Profit ÷ Cost × 100

Using the same $80 sale price and $50 cost from above:

Markup = ($80 – $50) / $50 x 100 = $30 / $50 x 100 = 60% markup

Compare this to the 37.5% margin on the identical sale. Same numbers, two very different looking percentages, which is exactly why “add a 40% markup” and “hit a 40% margin” result in two different prices.

Converting between margin and markup:

Margin = Markup ÷ (1 + Markup) Markup = Margin ÷ (1 − Margin)

Markup

Equivalent Margin

10%

9.09%

20%

16.67%

30%

23.08%

40%

28.57%

50%

33.33%

60%

37.50%

70%

41.18%

80%

44.44%

90%

47.37%

100%

50.00%

The gap between the two widens as the percentage grows, which is why the confusion gets more expensive at higher markups and margins, not less.

What’s a Good Margin? Business Margin Benchmarks

“Good” is very industry specific, because some businesses are naturally low margin, high volume and some are naturally high margin. Here are some business margin calculators for indicative ranges of net margins by sector from the Damodaran industry margin dataset from NYU Stern, a commonly cited source in academic and industry circles, along with surveys of industries:

Sector

Typical Net Margin Range

Retail

2% to 6%

Food service / restaurants

3% to 9%

SaaS / software (mature companies)

15% to 30%+

Construction

3% to 8%

Professional services (consulting, accounting)

15% to 30%, sometimes higher for specialized firms

These are indicative ranges, not fixed targets and different data providers and years will give somewhat different numbers depending on methodology. The most useful result of a business margin calculator is when compared against your own specific sector and business model, ideally you would use several sources rather than a single universal benchmark.

Margin Calculator UK: VAT and Marginal Relief Notes

Always Calculate Margins on VAT-Exclusive Figures

It’s a common error for a UK margin calculator on a selling price that includes VAT, which quietly inflates the margin and can lead to underpricing.

Worked example (the mistake): A UK business sells an item for £120 including 20% VAT and it costs £60.

Wrong (using the VAT-inclusive price) Margin = (£120 – £60) ÷ £120 x 100 = 50% Correct (using the VAT-exclusive price): VAT-exclusive price = £120 / 1.20 = £100. Margin = (100 – 60) / 100 x 100 = 40%

That’s a 10 percentage point difference from one bad input. Remember that VAT collected is not revenue that the business actually keeps so always strip it out before calculating any margin.

Marginal Relief: A Different Meaning of “Margin”

UK searchers looking for a “marginal relief calculator” are generally after something else: a corporation tax calculation, not a profit margin. For the tax year 2026/27, companies in the UK will pay 19% on profits up to £50,000, 25% on profits over £250,000 and a tapered rate known as “marginal relief” on profits in between, which will give an effective marginal rate of 26.5% on each additional pound of profit earned in that band.

Worked Example: A company makes taxable profits of £75,000.

Tax before relief = £75,000 @ 25% = £18,750 Marginal Relief = (£250,000 – £75,000) x (£75,000 / £75,000) x 3/200 = £175,000 x 0.015 = £2,625 Tax payable = £18,750 – £2,625 = £16,125 (an effective rate of about 21.5%)

That is a completely different calculation than business profit margin, although the word ‘margin’ is used in both. For a dedicated tool use a marginal relief calculator and not this profit margin tool as the underlying maths and inputs are totally different.

Frequently Asked Questions

Q1. How do I calculate margin from cost and selling price? 

To calculate your profit, subtract your cost from your selling price, then divide that by your selling price (not your cost) and multiply by 100. For instance, if the cost is $50 and you sell it for $80, the profit is $30. Then $ 30 / $ 80 * 100 = 37.5 % margin.

Q2. What is the difference between gross margin and net margin? 

Gross profit subtracts only the direct cost of goods sold (COGS) from revenues and leaves out other business expenses. Net margin takes away everything, COGS, operating expenses, interest and taxes which is why net margin is almost always a smaller percentage than gross margin for the same business.

Q3. How do I convert markup to margin? 

Divide the markup by (1 + the markup as a decimal). For example, a 50 percent markup is equivalent to a 33.3 percent margin (50 / (1 + 0.50) = 33.3 percent), so a 50 percent markup and a 33.3 percent margin are the same dollar amount of profit on the same sale.

Q4. What is a good profit margin for a small business? 

It really depends on your industry. Retail businesses tend to have net margins of 2% to 6%. Professional services and software businesses can have net margins of 15% to 30% or more. The cost structures are totally different. Compare your margin to that of truly similar businesses, not to some one-size-fits-all number.

Q5. How do I price a product to hit a target margin? 

Don’t just add a percentage on top of cost. Divide your cost by 1 minus your target margin (as a decimal). For example, a $50 cost with 40% target margin means you need to sell at $50 ÷ (1 – 0.40) = $83.33, not $70.

Q6. Should margins be calculated with or without VAT/sales tax? 

Always, no. VAT or sales tax on a sale is not revenue your business actually retains; it is money you are holding on behalf of the tax authority, so including it in your revenue figure artificially inflates your calculated margin and can result in underpricing.

Conclusion

Whether you’re assessing a single sale, pricing a new product line, or benchmarking your company against industry norms, the same basic formulas apply. Margin is profit divided by revenue, markup is profit divided by cost, and the difference between the two is one of the most common (and costly) pricing errors in business. Use the margin calculator above to run your own numbers in all three modes: margin from cost and price, price from cost and target margin and markup-to-margin conversion.