Big Number Calculator - Arbitrary Precision Integers
Math Calculators
Perform exact arithmetic on integers of any size - no floating-point rounding. Supports addition, subtraction, multiplication, division, modulo, power, GCD, LCM, and factorial up to 10 000!.
Quick examples:
2 ^ 64 =
18446744073709551616
How to use this tool
- Choose an operation. Select from add, subtract, multiply, divide, modulo, power, GCD, LCM, or factorial using the operation selector.
- Enter the numbers. Type integer values for A (and B for binary operations). You can enter numbers with thousands of digits - no scientific notation needed.
- Click Calculate. Press Calculate to compute the exact result instantly.
- Read the result. The full exact integer result is displayed along with the digit count. For division, the remainder is also shown.
Why arbitrary precision matters
Standard 64-bit floating-point arithmetic can only represent integers exactly up to 2⁵³ =
9,007,199,254,740,992 (~9 quadrillion). Beyond that, numbers are rounded. This calculator uses
JavaScript's native BigInt type, which stores integers as sequences of digits with
no upper size limit other than available memory.
Supported operations
- Addition / Subtraction / Multiplication: Exact integer arithmetic.
- Division: Integer (floor) division with a displayed remainder.
- Modulo: Always returns a non-negative result for positive divisors.
- Power: A raised to the B (non-negative integer). Large exponents may produce very long results; a limit is imposed to avoid browser freezes.
- GCD: Greatest Common Divisor via the Euclidean algorithm.
- LCM: Least Common Multiple, computed as |A·B| / GCD(A,B).
- Factorial: n! for n up to 10 000. (10 000! has ~35 660 digits.)
Example: how large can results get?
- 2¹⁰⁰ = 1,267,650,600,228,229,401,496,703,205,376 (31 digits)
- 100! ≈ 9.33 × 10¹⁵⁷ (158 digits)
- 1000! has 2568 digits
- 10000! has 35 660 digits
Use cases
- Cryptography: RSA-2048 uses 2048-bit keys - numbers with ~617 decimal digits. Factoring these numbers is computationally infeasible, which is the basis of RSA's security.
- Combinatorics: the number of ways to arrange a 52-card deck is 52! ≈ 8.07 × 10⁶⁷ - vastly more than the number of atoms in the observable universe. Big-number arithmetic is required to compute this exactly.
- Astronomical distances: the observable universe is approximately 8.8 × 10²⁶ meters across. Precise calculations involving such distances require arithmetic well beyond standard 64-bit float precision.
Performance note
Operations like factorial grow extremely fast. 10,000! produces a 35,660-digit string and takes tens of milliseconds to compute. To prevent the browser from freezing, this calculator limits factorial input to 10,000 and power exponents to values that would produce fewer than ~100,000 digits. Results exceeding these limits display a warning rather than a truncated answer.
Frequently asked questions
Why do regular calculators give wrong answers for large numbers?
Standard calculators and most programming languages use 64-bit floating-point (IEEE 754 double), which can only represent integers exactly up to 2⁵³ ≈ 9 quadrillion. Beyond that, precision is lost. This calculator uses JavaScript BigInt, which handles integers of arbitrary size with perfect precision.
What is the largest number this calculator can handle?
Input numbers are limited to 10 000 digits for performance. For factorial, you can compute up to 10 000! - a number with over 35 000 digits. For power operations, the result is limited to avoid multi-second computation in the browser.
What is the difference between division and modulo?
Division (÷) returns the integer quotient by truncating toward zero, not mathematical floor division. For example, 17 ÷ 5 = 3 (remainder 2), while -5 ÷ 2 = -2 (remainder -1). The displayed remainder follows A = B × quotient + remainder and has the sign of A. Modulo is a separate operation: it is normalized to a value from 0 through |B| - 1.
What is GCD and why is it useful?
The Greatest Common Divisor (GCD) of two integers is the largest integer that divides both without remainder. GCD(48, 18) = 6. It is used to simplify fractions (divide numerator and denominator by GCD) and in many number theory algorithms.
What is n! (factorial)?
n! (n factorial) is the product of all positive integers from 1 to n: n! = 1 × 2 × 3 × … × n. Factorials grow extremely quickly - 100! has 158 digits, and 1000! has 2568 digits. They appear in combinatorics (counting permutations and combinations), probability, and calculus.
Related tools
- Scientific Notation ConverterCompress an enormous integer into scientific or engineering notation for reporting.
- Number to WordsWrite the integer out in words or in check-writing style after calculating it.
- Bitwise CalculatorApply AND, OR, XOR, shifts, and NOT when the large integers represent bit patterns.
- Number Base ConverterConvert the integer between decimal, hexadecimal, octal, and binary representations.