Big Number Calculator
An ordinary calculator stops being exact above about 9 quadrillion and starts quietly rounding. This works with the digits themselves, so the answer is exact however long it gets.
The Operation
Whole numbers only. Commas and spaces in the input are ignored.
Where ordinary calculators give up
Almost every calculator and spreadsheet stores numbers as 64-bit floating point, which holds about 15 to 17 significant decimal digits. Beyond 253 — roughly 9.007 quadrillion — consecutive integers stop being individually representable, and the machine rounds to the nearest value it can hold. It does this silently. Add one to a large enough number and nothing changes; multiply two twenty-digit numbers and the last several digits are fiction.
What exact arithmetic does instead
Arbitrary-precision integers store the digits themselves and carry between them exactly as you would on paper, so there is no rounding at any point and no upper limit other than memory. The cost is speed: multiplying two numbers with n digits by the schoolbook method takes time proportional to n squared, which is why this page puts a ceiling on how large a power it will compute rather than locking up your browser.
Why the limit exists, and where it is
A power is where results explode. Raising a thirty-digit number to the thousandth power produces roughly thirty thousand digits, and each higher exponent multiplies the work again. Rather than accept any input and freeze — which is a real failure mode for this kind of tool — the calculator estimates the size of the answer first, and if it would exceed the digit ceiling it refuses and says so. A refusal with a reason is more useful than a frozen tab, and far more useful than a wrong answer delivered quickly.
Where this actually matters
Cryptography is the obvious case: RSA key sizes are quoted in bits precisely because the numbers involved run to hundreds of decimal digits, and a single rounded digit destroys the mathematics. Combinatorics produces enormous numbers from modest inputs — the number of ways to shuffle a deck of cards is 52 factorial, about 8×1067, which is more than the estimated number of atoms in our galaxy. Accounting in minor units and astronomical distance calculations both run into the same precision wall from different directions.
Reading the digit sum
The digit sum is a cheap sanity check. Adding the digits of a number, repeatedly until one digit remains, gives its value modulo nine, and that property survives addition and multiplication — the old "casting out nines" trick. If the digit sums of your inputs do not combine to match the digit sum of the result, something is wrong. It cannot prove an answer is right, but it catches transposed digits quickly.
Frequently Asked Questions
Why does my spreadsheet lose the last digits of big numbers?
Does this handle decimals?
Why does it refuse very large powers?
What is the digit sum for?
Sources
Official publications only. Links open the original document in a new tab.
- National Institute of Standards and Technology Special Publication 811 — Guide for the use of the SI Significant figures and rounding conventions
- National Institute of Standards and Technology CODATA fundamental physical constants Values of the fundamental physical constants