fileformer
search⌘KtranslateENexpand_moreupload_fileConvert
Converters8 file families · 44 direct conversions
What changes in a conversionarrow_forward
home/tools/calculators

Ask the question the way you'd say it.

Pick a question, change the numbers in it, and the answer updates as you type. When you need the full picture, with charts, schedules and edge cases, open the calculator behind it.

percentPercent ofeventDays untilsavingsSavings growthaccount_balanceLoan repaymentstraightenMiles to kmcasinoRandom number
What is % of ?
Also does “what percent is X of Y” and percentage change.
answer3615% of 240 · the other 85% is 204casinoRoll againOpen the percentage calculatorarrow_forward
~/every-calculator

6 calculators, and the formula each one runs.

No black boxes. Each line shows the maths behind the calculator and a worked example, so you can check the answer yourself.

~/where-mental-maths-slips

Two percentage traps that catch almost everyone.

Both come up in shops, payslips and news headlines. Drag the sliders to see how big the gap gets.

Up 30%, then down 30% isn’t back to where you startedThe fall is taken from the bigger, raised number, so it removes more than the rise added.
change± 30%
start
£100.00
+30%
£130.00
then −30%
£91.00
You end £9.00 down, a 9.0% loss. To get back to £100 after a 30% fall you’d need a 42.9% rise.
A rate going from 4% to 5% is a 25% rise“One percentage point” and “one percent” are different things. Headlines use whichever sounds bigger.
before4%
after5%
percentage points+1.00 ptsThe plain difference between the two rates.percent change+25.0%How much bigger or smaller the new rate is, relative to the old one.
On a £200,000 mortgage, going from 4% to 5% changes a year’s interest by about £2,000. Both headlines, “up 1.00 points” and “up 25%”, describe the same change.
~/how-computers-store-numbers

Why 0.1 + 0.2 isn't 0.3, and what calculators do about it.

Almost every calculator on the web, including JavaScript itself, stores numbers as 64-bit binary floating point (IEEE 754). Most decimal fractions have no exact binary form, so they're stored as the nearest of about 18 quintillion possible values. Type a sum below. Your browser computes it the usual way, then works out the exact decimal value of every stored number and the true answer, using whole-number arithmetic that can't round.

0.1 + 0.20.3 − 0.11.1 × 31 ÷ 39007199254740992 + 11e16 + 10.57 × 100
+−×÷
JavaScript says0.30000000000000004
exact decimal answer0.3
warningOff by +4.44e-17. 0.1 has no exact binary form, so it was stored slightly high before the sum even started.
valueexactly what's storedstored error
0.10.1000000000000000055511151231257827021181583404541015625+5.55e-18
0.20.200000000000000011102230246251565404236316680908203125+1.11e-17
result0.3000000000000000444089209850062616169452667236328125+4.44e-17
the 64 bits of the result0011111111010011001100110011001100110011001100110011001100110100
sign · 1 bitexponent · 11 bits, biased by 1023fraction · 52 bits
(−1)^0 × 1.fraction × 2^(1021 − 1023) = 1.2000000000000001… × 2^-2Next double up: 0.3000000000000001. Nothing in between can be stored, so near this value every answer is a multiple of 5.551e-17.
~/seven-ways-to-round

“Round to 2 decimal places” has seven answers.

Rounding rules only disagree on exact ties and negative numbers, but invoices, tax returns and payroll hit those cases every day. The middle column applies each rule to the number exactly as you typed it. The right column applies the same rule to the value actually stored in binary, which is where 1.005 quietly becomes 1.00, the same answer toFixed gives.

0 dp1 dp2 dp3 dp4 dp
1.0052.5-2.50.1251.2558.345
rule · who uses itexacton the stored double
Half away from zeroTaught at school; Excel ROUND; most tills1.011.00
Half to evenBanker’s rounding; IEEE 754 default; Python round()1.001.00
Half toward zeroRare; some legacy finance systems1.001.00
Half toward +∞JavaScript Math.round: −2.5 becomes −21.011.00
Always up (ceiling)Excel CEILING.MATH; shipping weights; minimum charges1.011.01
Always down (floor)Excel FLOOR.MATH; age in whole years1.001.00
Toward zero (truncate)Excel TRUNC; casting to an integer in C or Java1.001.00
x.toFixed(2)1.00Math.round(x × 10^2) / 10^21Intl, half away from zero1.01
1.005 is stored as 1.0049999999999998934185896359… (51 digits), just below the true value. Rules applied to the stored value land on the other side of the tie (shown in red), which is what toFixed does. Intl.NumberFormat rounds the shortest decimal that reproduces the double (1.005), so it agrees with the exact column.
VAT per line, or on the total?20% VAT on six lines, rounded half up to the penny. HMRC accepts either method if used consistently.
Printer paper, 5 reams · £19.993.9984.00Toner cartridge · £4.990.9981.00Envelopes · £0.850.170.17Desk lamp · £12.492.4982.50Cable ties · £2.330.4660.47Notebooks · £7.151.431.43
per line£9.57on the total£9.56difference+0.01
Add 10p, 10 timesA loop adding 0.1 in floating point, against counting whole pence.
0.1 added in a loop0.9999999999999999exact110 pence, as integers100p = £1.00error−1.11e-16
The loop first shows a wrong total after 3 additions (0.1 + 0.1 + 0.1 = 0.30000000000000004). Payment systems avoid this by storing pence or cents as whole numbers.
~/one-rate-four-numbers

The same interest rate, quoted four different ways.

A headline rate is only the start. How often interest compounds, what fees are added, which country's APR rules apply and how the bank counts days all change what you actually pay or earn. Set a loan below and every figure is recalculated, including an APR found by solving the regulator's equation.

NOMINAL RATE6.5% a year
LOAN£12,000
TERM5 years
UPFRONT FEE£495
monthly payment£234.7960 payments · £2,087.63 interesteffective rate, no fee6.70%Monthly compounding of 6.5%.UK APR, with fee8.6%Annual effective rate solved from the FCA formula, rounded to 1 dp.US-style APR, with fee8.27%The same cash flows, quoted as 12 × the monthly rate.
The fee is paid at the start, so you receive £11,505.00 but repay as if you had borrowed £12,000.00. The UK APR is the yearly rate X that makes £11,505.00 = Σ payment ÷ (1 + X)^(t/12), solved here by bisection. US law quotes the nominal rate, which is always lower for the same loan.
compoundedeffectiveextra / yron £10,000
Annually6.500%+£0.00
Twice a year6.606%+£10.56
Quarterly6.660%+£16.02
Monthly6.697%+£19.72
Weekly6.712%+£21.16
Daily6.715%+£21.53
Continuously6.716%+£21.59
Interest for one period, by day count→
Actual/365 FixedUK money markets and most sterling loans181 d0.495890£386.79
Actual/360USD and EUR money markets181 d0.502778£392.17
30/360 USUS corporate bonds and many mortgages180 d0.500000£390.00
Actual/Actual ISDAGovernment bonds and swaps181 d0.495890£386.79
Simple interest on £12,000.00 at 6.5%. Actual/360 always charges the most, about 1.4% more than Actual/365. 30/360 treats every month as 30 days, so February counts the same as August.
~/reference

The limits behind every calculator, checked by your browser.

Every value and check in this table was computed when the page loaded, not typed in. These are the edges where web calculators, spreadsheets and databases start giving wrong answers.

limitexpressionvalue herewhat it meanslive check
Largest safe integerNumber.MAX_SAFE_INTEGER90071992547409912⁵³ − 1. Above it, not every whole number exists as a double, so 64-bit IDs lose digits in JSON.parse.9007199254740993 === 9007199254740992 → true
Machine epsilonNumber.EPSILON2.220446049250313e-16The gap between 1 and the next double, 2⁻⁵². Compare money with a tolerance, or use integer pence.1 + EPSILON / 2 === 1 → true
Largest doubleNumber.MAX_VALUE1.7976931348623157e+308(2 − 2⁻⁵²) × 2¹⁰²³. Beyond it, results overflow to Infinity.MAX_VALUE × 2 → Infinity
Smallest normal double2 ** -10222.2250738585072014e-308Below this, numbers are subnormal: they lose precision gradually instead of dropping to zero.2 ** -1022 / 2 ** 52 → 5e-324
Smallest doubleNumber.MIN_VALUE5e-3242⁻¹⁰⁷⁴, the last value before zero.MIN_VALUE / 2 → 0
0.1 in single precisionMath.fround(0.1)0.10000000149011611938476562532-bit floats, used by GPUs, sensors and many file formats, keep only about 7 significant digits.fround(16777217) → 16777216
Latest JavaScript datenew Date(8.64e15)+275760-09-13T00:00:00.000ZExactly 100 million days after 1 January 1970.new Date(8.64e15 + 1) → Invalid Date
End of 32-bit Unix timenew Date(2 ** 31 * 1000 − 1000)2038-01-19T03:14:07.000ZA signed 32-bit seconds counter overflows one second later: the Year 2038 problem.(2147483647 + 1) | 0 → -2147483648

From the abacus to the Year 2038 problem

1202Liber AbaciFibonacci brings Hindu: Arabic numerals to Europe, with worked problems on interest and currency exchange.
1582Gregorian calendarTen days are dropped and the 400-year leap rule begins, the rule every date calculator still follows.
1683Bernoulli and eJacob Bernoulli asks what happens as compounding becomes continuous, and finds the constant e.
1968Truth in Lending ActUS lenders must disclose an APR, defined as a nominal rate.
1970Unix epochUnix counts time in seconds from 00:00 UTC on 1 January 1970.
1985IEEE 754One standard for binary floating point, so the same sum gives the same answer on every computer.
2008IEEE 754-2008Adds decimal floating point and fused multiply: add. Revised again in 2019.
2038Year 2038At 03:14:07 UTC on 19 January, signed 32-bit Unix time runs out.

All calculators 23