Big number calculator
Evaluate arithmetic on integers of any size, right in your browser.
Big number calculator
JavaScript's native numbers lose precision past about 15 digits, which makes them useless for cryptography key sizes, combinatorics, or just multiplying two very large integers correctly. This calculator evaluates expressions using BigInt arithmetic instead, so a 40-digit number multiplied by another 40-digit number comes back exact, digit for digit, with no rounding.
Type one expression per line and every line is evaluated on its own, in order — paste a whole batch of calculations and get a matching batch of results. Supported operators are + − * / % (integer division and remainder) and ^ or ** for exponentiation, plus parentheses for grouping and a trailing ! for factorial. Two named functions round out the set: gcd(a, b) for the greatest common divisor, and modpow(base, exponent, modulus) for fast modular exponentiation — the operation behind RSA and Diffie-Hellman, computed without ever materializing the astronomically large intermediate power.
The options control how results are written rather than what gets computed. Thousands separators group the digits of a decimal result for readability, or group binary, octal and hexadecimal output into short blocks when you switch the output base. Turning on the digit count appends how many decimal digits a result has — handy for eyeballing the size of a factorial or a power before you use it elsewhere. Scientific notation kicks in only once a decimal result passes 21 digits, printing a rounded "1.23457e+40" instead of a wall of digits. A handful of safety limits — factorial capped at 10,000!, results capped at a million digits — keep the page responsive instead of freezing on a runaway expression.
Everything runs locally in your browser; no expression or result is ever sent anywhere. Copy the output, download it as a .txt file, or send it straight back into the input to chain another calculation.