Big Number Calculator
Add, subtract, multiply, divide, mod, GCD, LCM, square, square root, factorial, or raise to a power — exact whole-number results of any size, far beyond a standard calculator display.
How to use this calculator
- 1Enter your first number.
- 2Choose the operation — most need a second number or an exponent, but square, square root and factorial only need the first.
- 3Results too long to display in full are truncated in the headline but always shown in full in the copyable text field.
How the calculation works
Exact integer arithmetic using arbitrary-precision (BigInt) representation, not floating-point- BigInt
- A number type that stores every digit exactly, with no fixed size limit
- gcd(a,b)
- Greatest common divisor, via the Euclidean algorithm
- X!
- Factorial — the product of every whole number from 1 up to X
A standard calculator (and JavaScript's regular numbers) can only represent integers exactly up to 2⁵³ − 1 (about 9 quadrillion) before precision is lost. BigInt arithmetic instead stores every digit, so results are exact no matter how large — the only limit is practical: extremely large exponents can take a moment to compute and produce results with millions of digits.
Square root works in exact integers, so a number that is not a perfect square is floored to the largest whole number whose square does not exceed it, rather than shown as a decimal.
Worked example
2 raised to the power of 100
- 1.2¹⁰⁰ = 1,267,650,600,228,229,401,496,703,205,376 — a 31-digit number, far beyond standard calculator precision.
Result: 1267650600228229401496703205376
20 factorial
- 1.20! = 20 × 19 × 18 × … × 2 × 1, which comes out to 2,432,902,008,176,640,000 — already a 19-digit number, more than a standard calculator display can hold exactly.
Result: 2432902008176640000
Why some whole numbers break an ordinary calculator
Every standard calculator, spreadsheet and most programming languages store numbers using a fixed amount of space in a computer's memory — commonly a format that can represent integers exactly only up to about 9 quadrillion (2⁵³). Push past that boundary and the hardware starts silently rounding to the nearest number it can actually represent, which for something like a large factorial or a big exponent means the last several digits of the "answer" are simply wrong, without any error message pointing that out.
How arbitrary-precision arithmetic gets around the limit
Rather than storing a number in a fixed-size register, arbitrary-precision arithmetic stores it as a sequence of digits — conceptually, the same way it is written on paper — and lets that sequence grow to whatever length the true answer needs. Adding, multiplying or comparing two such numbers works through the same digit-by-digit process taught in grade-school arithmetic, carrying and borrowing included, just automated and applied to numbers with dozens, hundreds or even millions of digits instead of a handful. The trade-off is speed: operations on arbitrarily large numbers take longer than the near-instant results a calculator gives for numbers that fit its display, because there is genuinely more digit-by-digit work happening underneath.
Where exact, oversized integers actually matter
Numbers this large are not just a curiosity — several fields depend on integer arithmetic that stays exact well past ordinary calculator range.
- Cryptography — modern encryption methods like RSA rely on multiplying two enormous prime numbers together, and on the practical difficulty of reversing that multiplication — a security guarantee that depends entirely on exact, not approximate, arithmetic on numbers hundreds of digits long.
- Combinatorics — counting the number of ways to arrange or choose from a moderately sized set routinely produces factorials with dozens of digits — 25! alone is a 26-digit number, and the count only grows faster from there.
- Number theory research — questions about prime numbers, perfect numbers and integer sequences are frequently explored computationally on numbers with thousands of digits, where a single rounding error would invalidate the whole search.
- Computer science — algorithms are commonly tested and benchmarked using exact large-integer arithmetic, and many programming languages ship a built-in arbitrary-precision integer type for exactly this reason.
A common mix-up: exact integers versus long decimals
Arbitrary-precision integer arithmetic is not the same tool as arbitrary-precision decimal arithmetic, even though both aim for exactness. This calculator works entirely in whole numbers: dividing two big integers gives an exact whole-number quotient and a separate remainder, rather than a long string of decimal places, because representing a division's decimal expansion exactly can require infinitely many digits (as with 1 ÷ 3), while the whole-number quotient and remainder are always exact and finite.
What this assumes, and where it stops
Assumptions
- Inputs are whole numbers — decimals are not supported, since this tool is specifically for exact large-integer arithmetic.
Limitations
- Division produces a whole-number quotient and remainder, not a decimal — arbitrary-precision decimal division is a fundamentally different (and much slower) computation.
- Factorial is capped at 10,000! (already over 35,000 digits) to keep computation time reasonable in the browser.
Common questions
Why do I need this instead of a normal calculator?
Ordinary calculators — and most programming languages' default number type — lose precision above about 9 quadrillion (2⁵³) because they store numbers in a fixed amount of binary floating-point space. This tool uses arbitrary-precision integers instead, which grow to fit however many digits the true answer needs, so results stay exact no matter how large.
Can I compute factorials here?
Yes — choose "Factorial (X!)" and enter just the first number. It is computed by direct repeated multiplication in exact integers, so results like 100! (158 digits) or even 1000! (over 2,500 digits) come out exact, well past where a standard calculator would lose precision or simply refuse.
What does square root give me for a number that is not a perfect square?
The floor — the largest whole number whose square does not exceed your input — since this tool works in exact integers rather than decimals. The result notes when this happened and shows the two nearest perfect squares so you can see how close it landed.
Formula and content last reviewed on .
Results are estimates for information only, not professional advice.
Related calculators
Tools people commonly use alongside the big number calculator.