Profit margin calculator
Turn a cost price and a selling price into gross profit, gross margin, markup and net margin, with multi-unit orders, platform fees and a per-unit discount split in integer cents.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Cost and price
Money is computed in integer cents, a whole-order discount is split per unit with the largest remainder method, and ratios are shown rounded to 2 decimals.
Result
40.0040.00%66.67%5.00 × 3 units285.00180.0014.2590.7531.84%30.25 × 3 unitsWhat this tool does
- Check a new listing before it goes live: a 60 yuan cost at a 100 yuan price is a 40% gross margin but a 66.67% markup — see both numbers at once instead of arguing over which one you meant.
- Sanity-check a promotion: a 15 yuan order discount across 3 units is split per unit (leftover cents go to the first units with the largest remainder method) before fees are deducted, so you see the real net margin.
- Measure how much platform or payment fees eat: enter the fee rate and compare net margin with gross margin before switching processors.
- Explain pricing to a supplier or a manager: net profit, net margin and per-unit profit are all computed in integer cents, so the numbers reconcile to the cent.
Example
Input
Cost 60 yuan, price 100 yuan, 3 units, 5% fee rate, 0 yuan fixed fee, 15 yuan order discount
Output
Gross profit 40.00 yuan, gross margin 40.00%, markup 66.67%; discount 5.00 yuan × 3 units; net revenue 285.00 yuan, total cost 180.00 yuan, fees 14.25 yuan, net profit 90.75 yuan, net margin 31.84%, net profit per unit 30.25 yuan × 3
The fee is rounded once on the whole order (285.00 × 5% = 14.25 yuan); rounding each unit separately and adding them up can drift by a cent.
Frequently asked questions
What is the difference between margin and markup?
Margin divides profit by the selling price, markup divides it by the cost. A 60 yuan cost sold at 100 yuan is a 40% margin and a 66.67% markup. Use margin when you reason about discounts, markup when you reason about how much you add on top of cost.
Why compute everything in cents?
Decimal money suffers from floating point error (0.1 + 0.2 style), which can lose a cent once you add many units. This tool converts every amount to integer cents and uses the largest remainder method whenever a total is split, so the parts always add up to the total exactly.
How is the discount split across units?
The discount is divided by the unit count first, and the leftover cents are handed out one at a time to the earliest units. A 15 yuan discount over 3 units is 5.00 each; a 1.00 yuan discount over 3 units becomes 0.34 / 0.33 / 0.33, still summing to exactly 1.00.
How are the displayed percentages rounded?
Ratios keep their exact value internally and are only rounded to 2 decimals for display (31.8421% shows as 31.84%). Multiplying a displayed ratio back by the revenue can therefore differ by up to a cent — that is display rounding, not a calculation error.
Why is net margin so much lower than gross margin?
Gross margin only subtracts cost, while net margin also subtracts platform fees, fixed per-order fees and discounts. A discount cuts net revenue directly and fees scale with it, so the two numbers drift apart quickly — usually the most overlooked part of pricing.
Keywords:profit marginmargin calculatormarkupgross profitnet margin利润率计算器毛利率加价率净利润率电商定价