Percentage Calculator: Working Backwards From a Net Payout to the Real Gross
Last month my marketplace payout was $2,046.30. The platform keeps a 15% cut of every sale, and my accountant needed the gross sales figure for the quarterly report. My first instinct was the one most people reach for: multiply by 1.15.
$2,046.30 × 1.15 = $2,353.25.
That number was wrong, and it took an awkward email thread to find out. The real gross was $2,407.41. The gap is $54.16, and that is not the kind of thing you want your accountant to catch before you do.
Why multiplying by 1.15 fails
When a platform "takes 15%", the 15% comes out of the gross:
gross × 0.85 = net So gross = net ÷ 0.85. Multiplying by 1.15 answers a different question: "what amount, plus 15% of itself, lands at the payout?" That is a markup, and its base is the net, not the gross. Two different bases, two different answers: the rate differs by less than a percentage point's worth of arithmetic, yet the results drift $54.16 apart.
The same math shows up everywhere once you look for it: reverse VAT on an invoice (GOV.UK's VAT guidance lists the current rates), contractor fees, take-home pay after a deduction. Divide by (1 − rate). Never multiply by (1 + rate).
Method 1: Python with decimal
Here is the script I ended up keeping. Python 3.11.8, standard library only:
# reverse_gross.py — Python 3.11.8 from decimal import Decimal, ROUND_HALF_UP def gross_from_net(net: Decimal, fee_rate: Decimal) -> Decimal: # fee_rate as a fraction: 0.15 means "the platform keeps 15%" return (net / (1 - fee_rate)).quantize(Decimal("0.01"), ROUND_HALF_UP) payout = Decimal("2046.30") fee_rate = Decimal("0.15") gross = gross_from_net(payout, fee_rate) platform_fee = (gross * fee_rate).quantize(Decimal("0.01"), ROUND_HALF_UP) print(f"gross: {gross}") print(f"fee (15%): {platform_fee}") print(f"check: {gross - platform_fee}") Running it gives:
gross: 2407.41 fee (15%): 361.11 check: 2046.30 The check line is the whole trick. Subtracting the fee from the computed gross and landing exactly on the payout proves the direction of the math. If that line prints anything other than 2046.30, you multiplied instead of divided.
Why Decimal instead of plain floats? Floats cannot represent 0.85 or even 0.1 exactly, and the errors surface in money math as off-by-a-cent line items. The official decimal module docs cover this better than I can. Floats usually get this particular calculation right, but I have stopped gambling on "usually" in anything that ends up on an invoice.
Method 2: a spreadsheet cell
When the numbers live in a sheet anyway, one formula does it. In LibreOffice Calc, Excel, and Google Sheets alike:
=B4 / (1 - B2) with B2 holding the fee rate, formatted as a percentage (15%), and B4 the payout. One real trap I hit: a supplier sent me a sheet where the rate cell contained the number 15 instead of 0.15. The formula then computed 2046.30 / (1 - 15) = −146.16. A negative gross looks absurd, which is lucky — it shouts. If the rate had been 1.5 instead of 0.015, the result would have been a plausible-looking wrong number, and nothing would have shouted at all.
So whenever I inherit someone else's sheet, I click the rate cell and check whether it is genuinely a percentage. The formatting lies; the underlying value does not.
Method 3: in the browser, no script
Sometimes I am not at my own machine, or the number is on a paper invoice and writing a script is just ceremony. That is when I open a free online percentage calculator. It has three modes, and two of them map directly onto this problem.
First, check the fee: in "X% of Y" mode, take 15% of 2407.41 and it returns 361.11, exactly the platform fee I expected. Then flip it around: in the "X is what percent of Y" mode, 2046.30 against 2407.41 returns 85%, which confirms the payout is precisely the gross minus the 15% cut. Two independent checks, ten seconds, nothing installed or uploaded. The percentage change mode is handy afterward too, when I want to see how much this month's fee drag moved versus last month.
Everything runs client-side, which I appreciate when the invoice on screen belongs to a client, not to me.
Three traps worth memorizing
1. Fee base versus markup base. Covered above, but it earns its own entry because it cost me $54.16 once. A 15% fee on gross: divide the net by 0.85. A 15% markup on your cost: multiply the net by 1.15. Same "15%", different base, different answer.
2. Margin is not markup. A client once asked me to price a batch of license keys at a "30% margin" over a $70 cost. I priced them at $91 (70 × 1.3 — that is markup). The finance team meant margin: price = 70 ÷ 0.7 = $100, so the profit is 30% of the selling price. At $91 the realized margin was 21.8%, not 30%. We renegotiated before the contract shipped, but only because I re-ran the math. If someone says margin, divide. If they say markup, multiply.
3. Banker's rounding will bite round(). This one is pure Python, and the output below is from 3.11.8:
>>> round(2.675, 2) 2.67 >>> from decimal import Decimal, ROUND_HALF_UP >>> Decimal("2.675").quantize(Decimal("0.01"), ROUND_HALF_UP) Decimal('2.68') round() gives 2.67, not 2.68, for two stacked reasons: the float nearest to 2.675 is actually 2.67499988..., and round() uses round-half-to-even for the exact ties it does meet. Money rounds half-up in almost every accounting context, so I quantize with Decimal and ROUND_HALF_UP, and leave round() for display-only cases.
Quick summary
| Question | Shortcut people try | Correct math | Example |
|---|---|---|---|
| Gross before a 15% fee, net = 2046.30 | net × 1.15 → 2353.25 | net ÷ 0.85 → 2407.41 | off by $54.16 |
| Price at a 30% margin, cost = 70 | cost × 1.3 → 91 | cost ÷ 0.7 → 100 | margin 21.8% vs 30% |
| Round $2.675 to cents | round(2.675, 2) → 2.67 | Decimal + ROUND_HALF_UP → 2.68 | banker's rounding |
The pattern across all three: every percentage belongs to a base, and the base is whatever the rate was applied to, not whatever number you happen to have in hand. Naming the base out loud before computing has saved me more money than any formula.
More free browser-based utilities at utilvy.com.