How does the margin and markup calculator work?
Both measures use the same difference between the selling price and the purchase price, but relate it to a different base. Margin relates the difference to the selling price, and markup to the purchase price. That is why the percentages are usually different for the same amounts. Choosing a mode changes the main result, not the prices entered.
Margin = (selling price − purchase price) / selling price × 100%. Markup = (selling price − purchase price) / purchase price × 100%. With a purchase at PLN 80 and a sale at PLN 100, the difference is PLN 20. The margin is 20 / 100 = 20%, while the markup is 20 / 80 = 25%. So adding 20% to the purchase price is not the same as achieving a 20% margin.
In Selling price mode, we use the formula: price = purchase price / (1 − m / 100), where m is the target margin as a percentage. For a purchase price of PLN 80 and a 20% margin, we divide 80 by 0.8 and get a price of PLN 100. This is the price that follows only from the purchase price and margin entered, without additional assumptions about demand or competition.
The price difference is not the business’s net profit. The calculator does not know the costs of delivery, commission, storage, staff, taxes or other expenses. It does not deduct them from the result. Enter comparable amounts in both fields, in the same currency and on the same basis, for example both net.
Step-by-step example — purchase at PLN 100, sale at PLN 150
- The price difference is 150 − 100 = PLN 50.
- The margin is 50 / 150 × 100%, or about 33.33%.
- The markup is 50 / 100 × 100% = 50%.
- If you want a 30% margin instead, switch to Selling price.
- For a purchase price of PLN 100, the price from the target margin is 100 / 0.7, or about PLN 142.86, and the price difference about PLN 42.86.
We show amounts and percentages to two decimal places, but do not round intermediate operations. The displayed price of PLN 142.86 is a rounded presentation of the model result. If you then enter it as the selling price, the calculation will start from this new amount. We do not promise identical raw results after repeatedly copying rounded values.
Sources and how up to date the calculations are
The marginFromPrices, markupFromPrices and salePriceFromMargin formulas were compared with the code of the Margin / markup module in Procentownik 1.10.24. Code check: 30 October 2026. We do not use tax rates, exchange rates or external offers here. The result depends on your data and the chosen direction of calculation.
The field ranges are technical limits of the form, not profitability standards or recommended margin levels. The tool does not match the price to an industry and does not assess whether a sale is profitable once all expenses are taken into account. With more precise input, the calculations keep the value you entered.
Frequently asked questions
What is the difference between margin and markup?
The base for margin is the selling price, and the base for markup is the purchase price. For a purchase at PLN 100 and a sale at PLN 150, the difference of PLN 50 means a margin of about 33.33% and a markup of 50%. These are two descriptions of the same prices, not two different amounts.
Can I calculate the price from a target margin?
Yes. Choose Selling price and enter a positive purchase price and a margin below 100%, within the form’s range. With a purchase price of PLN 100 and a 50% margin, the price is PLN 200. Adding PLN 50 to the purchase price would give a 50% markup, not a 50% margin.
What does a negative margin or markup mean?
It means the selling price is lower than the purchase price. For a purchase at PLN 100 and a sale at PLN 80, the difference is −PLN 20, the margin −25% and the markup −20%. This is the result of comparing these two prices, without analysing other income and costs.
Why does a percentage result not always make sense with a zero price?
Margin requires a non-zero selling price, and markup a non-zero purchase price. With a purchase at PLN 0 and a sale at PLN 100, the margin is 100%, but the markup is undefined. With a purchase at PLN 100 and a sale at PLN 0, the markup is −100%, but the margin is undefined. We do not replace division by zero with a result of 0%.
Why is a target margin of 100% rejected?
The formula for the price from a margin involves dividing by 1 − m / 100. At 100%, the denominator is zero. With a positive purchase price, there is no finite selling price that gives exactly that margin. The form accepts up to 99.999% as a technical input limit.
Are my prices saved on a server?
The calculations run in your browser, without sending the form values to the studio. Copy result puts a summary, including the mode, the data and the relevant formula, on your clipboard. You decide where to paste it later.

