Skip to content
Calculadora Capital

What is profit margin and how is it calculated?

Profit margin is the part of the selling price left after paying the cost. It is not the same as markup, and confusing the two leads to mispriced products.

4 min readReviewed By Thorben Rasmus IdelReviewed by Nahar Geva

TL;DR

Profit margin is the profit on a sale measured as a percentage of the selling price: margin = (price − cost) ÷ price. Do not confuse it with markup, which measures the same profit against the cost (markup = profit ÷ cost) and is always a larger number: a 40% margin is a 66.67% markup. To set a price from a margin, do not add the margin to the cost: divide the cost by (1 − margin). And always use amounts excluding VAT, because VAT is not yours.

What is profit margin?

Profit margin is the part of the selling price that is left after paying the cost of a product or service. It is measured as a percentage of the selling price1:

Profit margin = (selling price − cost) ÷ selling price

In other words: of every euro the customer pays, how much you keep after covering the cost of what you sold. You can estimate it for any product in our profit margin calculator.

Profit margin vs markup

There are two ways of looking at the same profit, and this is where many people go wrong. Margin measures profit against the selling price; markup measures profit against the cost:

IndicatorFormulaBase
Profit margin(price − cost) ÷ priceselling price
Markup(price − cost) ÷ costcost

Because the price is always higher than the cost, the markup is always larger than the margin. A product that costs €60 and sells for €100 makes €40 of profit: that is a 40% margin (40 ÷ 100) but a 66.67% markup (40 ÷ 60). Same profit, different numbers, so when someone says they “work with 40%”, you need to know whether they mean margin or markup.

How to set a selling price from the margin

If you know the margin you want, do not add that percentage to the cost. You get the price like this:

Selling price = cost ÷ (1 − margin)

For a 40% margin on a €60 cost: price = 60 ÷ (1 − 0.40) = 60 ÷ 0.60 = €100. If you instead add 40% to the cost (60 × 1.40 = €84), you end up with a margin of only 28.6%, well below what you wanted. The profit margin calculator does this both ways: from price to margin, and from margin to price.

Worked example

A shop buys an item for €60 (excluding VAT) and sells it for €100 (excluding VAT):

  • profit per unit = 100 − 60 = €40;
  • profit margin = 40 ÷ 100 = 40%;
  • markup = 40 ÷ 60 = 66.67%.

If the shop wanted to keep a 40% margin on an item whose cost rose to €75, the new price would be 75 ÷ 0.60 = €125.

Gross margin and net margin

The margin this calculator gives is the gross margin of a product: what is left after paying only the direct cost of that product. The business’s net margin is lower, because you still have to cover overheads: rent, salaries, electricity, software, taxes. Use each product’s gross margin as a starting point and check that, across all your sales, it covers those overheads and still leaves a profit.

Margin, VAT and self-employment

Always work out the margin with amounts excluding VAT. VAT is not yours: it is charged to the customer and handed to the State, so it is not profit. To add or remove VAT from an amount, use the VAT calculator. And if you are self-employed (recibos verdes), remember that the margin measures the profit on each sale, but what you hand to the tax office also depends on income tax and Social Security; estimate those in the recibos verdes calculator.

What this calculation does not include

The calculator works out the gross margin of a product from the cost and price you enter. It does not calculate the business’s net margin (overheads are missing), it does not determine the real cost of each product (shipping, waste, returns) and it does not handle VAT or taxes on profit. Use the estimate to price with confidence and check the business’s accounts with your accountant.

Common mistakes

  • Confusing margin with markup

    They use different bases: margin is profit over the price, markup is profit over the cost. Adding “40% margin” to the cost actually leaves a margin of only 28.6%. Decide which one you use and be consistent.

  • Setting the price by adding the margin to the cost

    Cost + 40% does not give a 40% margin. For a 40% margin, divide the cost by (1 − 0.40): 60 ÷ 0.60 = €100, not 60 × 1.40 = €84.

  • Calculating the margin with VAT included

    Use amounts excluding VAT for both cost and price. VAT is not your revenue, it is the State’s; including it inflates the apparent margin. For VAT, use the VAT calculator.

Frequently asked questions

What is profit margin?
It is the part of the selling price left after paying the cost of the product, expressed as a percentage of the price: margin = (price − cost) ÷ price. For example, selling for €100 something that costs €60 gives a 40% margin.
How do you calculate profit margin?
Subtract the cost from the selling price to get the profit and divide it by the selling price. With a €60 cost and a €100 price, the profit is €40 and the margin is 40 ÷ 100 = 40%.
What is the difference between margin and markup?
Margin measures profit against the selling price; markup measures the same profit against the cost. Because the price is higher than the cost, markup is always larger: a 40% margin is a 66.67% markup.
How do I work out the selling price from the margin I want?
Divide the cost by (1 − margin). For a 40% margin on a €60 cost, the price is 60 ÷ 0.60 = €100. Simply adding 40% to the cost would give a lower margin.
Is margin calculated with or without VAT?
Without VAT. VAT is charged to the customer and handed to the State, so it is neither profit nor part of the margin calculation. Use the cost and price excluding VAT.
What is a good profit margin?
It depends on the sector: retail tends to have low margins and selling services higher ones. What matters is that your products’ gross margin is enough to cover the business’s overheads and still leave a profit.

Sources

  1. 1.Todos Contam: financial education portalBanco de Portugal · retrieved 23 Jun 2026
  2. 2.IAPMEI: support for small and medium-sized businessesIAPMEI, Agency for Competitiveness and Innovation · retrieved 23 Jun 2026

Author / Reviewed by

Author

Thorben Rasmus Idel

Co-founder & writer

Co-founder of Calculadora Capital and the writer behind the methodology on every calculator and article. An entrepreneur and active investor, Thorben founded Idel Versandhandel GmbH, an international trading company operating across 16 countries, and invests across stocks, ETFs and cryptocurrency. He writes the methodology and verifies the math behind each page, drawing on hands-on business and investing experience to keep the tools and explanations grounded in how money, markets and taxes actually work for everyday people in Portugal.

Reviewed by

Nahar Geva

Co-founder & reviewer

Co-founder of Calculadora Capital and the independent reviewer behind every calculator and article. An entrepreneur and active investor, Nahar brings a data- and product-driven mindset together with hands-on experience in the markets — investing across stocks and ETFs as well as cryptocurrency and other digital assets, alongside broader personal finance and real estate. On each page Nahar reviews the methodology and double-checks the math and figures, pressure-testing how the tools and explanations hold up against the way money, markets and taxes actually work for everyday investors.

Published: Updated: Reviewed: