Big Integer Calculator
Guide
Big Integer Calculator
Compute exact results for math expressions that overflow ordinary calculators. The tool runs entirely on JavaScript BigInt, so factorial(1000), 25000, fibonacci(10000), and primality checks on trillion-digit candidates return every digit correctly — no scientific notation, no silent rounding.
How to Use
- Type an integer expression, for example
2 ** 1000,factorial(100), orgcd(1071, 462). - Pick an output base (decimal, hex, binary, octal). The result updates as you type.
- Use Copy or Download to grab the full result — useful when the number runs to thousands of digits.
- Read the digit count under the result to compare growth rates of different expressions.
Features
- Operators –
+,-,*,/(integer truncation),%(mod),**or^(power), and postfix!for factorial. - Built-in functions –
factorial,fibonacci/fib(fast-doubling),gcd,lcm,isprime(deterministic Miller-Rabin),nextprime,abs,pow,mod, and integersqrt. - Number literals – decimal,
0xhex,0bbinary,0ooctal, plus_separators for readability such as1_000_000. - Output bases – render the same value in base 10, 16, 2, or 8 without recomputing.
- Digit counter – instantly reports how many decimal digits the answer has, even when the result spans pages.
- Runs in your browser – nothing is sent to a server, and the parser rejects negative exponents, decimal points, and unbounded exponents that would freeze the page.
Example Inputs
100!– 158-digit factorial.2 ** 1000– the value behind 1000-bit RSA-style key sizes.fibonacci(500)– the 500th Fibonacci number, 105 decimal digits.nextprime(10 ** 30)– the next prime above an octillion.gcd(1071, 462)– the Euclidean algorithm at work.isprime(1000000000039)– a 13-digit prime confirmed in milliseconds.
FAQ
-
Why do regular calculators give wrong results for large factorials or powers?
JavaScript and most calculators use 64-bit floating-point numbers, which can represent integers exactly only up to 253-1 (about 9 quadrillion). Beyond that, results are silently rounded to the nearest representable float, so factorial(21), 254, and other large integers lose precision. BigInt-based calculators store digits arbitrarily, so every digit is exact.
-
What is arbitrary-precision arithmetic and where is it used?
Arbitrary-precision arithmetic represents integers with as many digits as memory allows, instead of a fixed register width. It is essential to RSA and elliptic-curve cryptography (keys are 2048-4096-bit integers), to financial systems that need exact decimals, to combinatorics, and to number-theory research.
-
How does the Miller-Rabin primality test decide if a number is prime?
Miller-Rabin picks witnesses a and checks whether a relationship that must hold for primes (derived from Fermat's little theorem) holds for the candidate n. A single random witness can be fooled, but with carefully chosen small witnesses the test becomes deterministic up to large bounds. With witnesses {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37}, the result is provably correct for every integer up to 3.317 * 1024.
-
How big does factorial(n) get?
Stirling's approximation gives log10(n!) ≈ n·log10(n/e) + 0.5·log10(2π·n). So 100! has about 158 digits, 1000! has 2568 digits, and 10000! has 35660 digits. A standard double-precision float overflows around 170!.
-
Why are gcd and lcm so important in number theory?
The greatest common divisor (gcd) and least common multiple (lcm) are the foundation for reducing fractions, solving linear Diophantine equations, the Chinese Remainder Theorem, and computing modular inverses. The Euclidean algorithm, used here, computes gcd in O(log min(a,b)) steps even for thousand-digit inputs.
Install Our Extensions
Add IO tools to your favorite browser for instant access and faster searching
恵 Scoreboard Has Arrived!
Scoreboard is a fun way to keep track of your games, all data is stored in your browser. More features are coming soon!
Must-Try Tools
View All New Arrivals
View AllUpdate: Our latest tool was added on May 31, 2026
