Big Number Calculator
Exact arithmetic on integers with hundreds of digits — no floating-point rounding. Add, subtract, multiply, divide, power, GCD, LCM, and factorial using JavaScript BigInt.
You might also need
How It Works
Standard JavaScript numbers (64-bit doubles) lose precision above 2^53. BigInt is a separate data type with no upper bound. This calculator converts both inputs to BigInt before any operation, ensuring every digit is exact. The result displays with its digit count — useful for verifying large factorial or power computations.
BigInt exact up to millions of digits | float loses precision above 2^532^100 = 1267650600228229401496703205376 (31 digits, exact)Multiply any two integers exactly. Example: 123456789012345678901234567890 × 987654321098765432109876543210 — a 60-digit × 60-digit multiplication that standard calculators cannot handle. The result is the exact 120-digit product. Enter each number in the input fields and press ×.
a × b → exact product, any number of digits999999999 × 999999999 = 999999998000000001 (exact, 18 digits)Enter base a and integer exponent n. The result is the exact integer. 2^64 = 18446744073709551616 (the number of IPv6 addresses). 2^256 has 78 digits (Bitcoin private key space). For very large exponents (n > 1000), computation may take a few seconds due to the number of digits involved.
a^n = a × a × ... × a (n times), BigInt exact2^64 = 18446744073709551616 | 2^256 = 78-digit numberGCD uses the Euclidean algorithm: GCD(a,b) = GCD(b, a mod b) until b=0. LCM = a×b/GCD(a,b). Both work exactly for arbitrarily large inputs. GCD(100-digit number, 50-digit number) runs in milliseconds. Enter both numbers and press GCD or LCM.
GCD via Euclidean algorithm | LCM = |a×b| / GCD(a,b)GCD(1234567890, 9876543210) = 90 | LCM = 135480701111100Enter n in the first input field and press n!. The result is the exact factorial — every digit correct. n! grows extremely fast: 10!=3628800 (7 digits), 100! (158 digits), 1000! (2568 digits). The digit count displays alongside the result. For n above 1000, computation may take 1-2 seconds.
n! = 1 × 2 × 3 × ... × n | 0! = 1 by convention10! = 3628800 | 20! = 2432902008176640000 | 100! = 158 digitsQuick Reference
Verify these results in the calculator above.
Power
2^100
31 digits (exact)
Factorial
10!
3,628,800
Factorial
100!
158 digits
Multiply
999999999×999999999
999999998000000001
GCD
GCD(12, 18)
6
LCM
LCM(12, 18)
36
Modulo
17 mod 5
2
Computing
2^64
18446744073709551616
Tips & Shortcuts
Enter numbers as plain digits — no commas, spaces, or scientific notation. The input accepts unlimited length, so type all digits for exact BigInt arithmetic.
For modular exponentiation (a^e mod n): compute a^e first (may be millions of digits), then compute mod n. For large e, consider splitting into smaller steps.
The digit count next to the result tells you the order of magnitude: 100! has 158 digits, meaning it is between 10^157 and 10^158.
GCD and LCM work efficiently even for 100+ digit numbers thanks to the Euclidean algorithm — no brute-force factoring needed.
Integer division truncates toward zero. If you need to check for exact divisibility, compute the modulo — if the result is 0, the division is exact.
Common Mistakes
Entering numbers with commas (1,000,000 instead of 1000000)
The calculator interprets the input as a raw string of digits. Commas are not accepted — enter 1000000, not 1,000,000.
Using scientific notation (1e20) for input
Scientific notation is not parsed as BigInt — it would be read as the string "1e20" causing an error. Convert to full digits first: 1e20 = 100000000000000000000 (21 digits).
Expecting decimal results from division
BigInt division is integer-only: 17÷5=3 with remainder 2. Use modulo (17 mod 5 = 2) separately. For decimal results, use the regular calculator.
Computing very large factorials (n > 10000) and expecting instant results
10000! has 35,659 digits and may take 1-2 seconds. 100000! would take much longer. The calculator will complete but may appear slow for extreme inputs — this is normal for arbitrary-precision arithmetic.
Using power with a negative exponent
BigInt only supports non-negative integer exponents. a^(−n) would be a fraction, which BigInt cannot represent. For negative exponents, use the Exponent Calculator which uses floating-point arithmetic.
Frequently Asked Questions
Standard 64-bit floating-point (IEEE 754 double) represents integers exactly only up to 2^53 = 9,007,199,254,740,992. Beyond this limit, precision is lost — for example, 9007199254740993 becomes 9007199254740992 in standard math. BigInt uses arbitrary-precision integer arithmetic with no upper limit, giving exact results for any size integer.
Addition (+), subtraction (−), multiplication (×), integer division (÷, truncates toward zero), modulo (remainder), power (a^n for non-negative integer n), GCD (Greatest Common Divisor using the Euclidean algorithm), LCM (Least Common Multiple via LCM=a×b/GCD), and factorial (n! for n up to ~1000 in reasonable time). All exact — no rounding.
No hardcoded limit. BigInt can represent integers with millions of digits. Practical examples: 1000! has 2,568 digits and computes in milliseconds. 2^10000 has 3,011 digits and computes instantly. 10000! has 35,659 digits and may take 1-2 seconds. The only limit is your browser's available memory.
BigInt division is integer division — it truncates toward zero and discards the remainder. 17 ÷ 5 = 3 (not 3.4). To get the remainder: use the modulo operation, 17 mod 5 = 2. The division result and remainder together express the full relationship: dividend = divisor × quotient + remainder. 17 = 5 × 3 + 2.
100! has 158 digits. The exact value is 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000. Enter 100 in the first field and press n! to verify instantly.
Yes, for educational purposes. RSA arithmetic involves large-integer operations: modular exponentiation (compute a^e, then mod n), GCD checks for coprimality in key generation, and factoring tests. This calculator handles the arithmetic but does not implement protocols. For modular exponentiation: compute a^e first (may be huge), then compute mod n separately — or use a dedicated modular exponentiation tool.
Type all digits directly — the input accepts unlimited length. No commas, spaces, or scientific notation. Negative numbers use a leading minus sign. For numbers in scientific notation (e.g. 1.5×10^20), convert to all digits first: 150000000000000000000. The calculator requires the full integer representation for exact BigInt arithmetic.
Related Calculators
Long Division Calculator
Perform long division with full step-by-step working.
Remainder Calculator
Find the remainder when dividing two numbers.
Simple Interest Calculator
Calculate interest earned on a principal without compounding.
Present Value Calculator
Find the current value of a future sum of money.
Scientific Calculator
Full scientific calculator with trig, log, and advanced functions.
Random Number Generator
Generate random integers within any range.