Calculator Tools
Big Number Calculator
Calculate with integers of any size in your browser. Add, multiply, factorial, power, modular exponent, GCD, and LCM with no precision loss.
Calculator mode
Type any integer expression. Operators: +, -, *, / (integer divide), % (remainder), ^ (power), ! (factorial). Functions: gcd(a, b), lcm(a, b), powmod(base, exp, mod), abs(n). Underscores group digits: 1_000_000. # starts a comment.
Examples: 100!, 2^256, gcd(12345, 67890), powmod(7, 10^18, 1_000_000_007).
Modular reduction
Reduce the current result modulo any positive integer or expression. Useful when the full value is enormous but a remainder is all you need (hash arithmetic, cryptography, contest math).
You can type an expression like 10^9 + 7 or 2^61 - 1.
Result mod m
437918130
Worked examples
Tap any example to load it into expression mode. Each one is a classic arbitrary-precision query.
Where normal calculators give up
Standard calculators use 64-bit floating point and start losing digits past 2^53. This tool uses native BigInt and keeps every digit. The widths below are common ceilings you can blow past.
| Range | Decimal digits | Width |
|---|---|---|
| JavaScript Number.MAX_SAFE_INTEGER (2^53 - 1) | 16 | 53 bits |
| Signed 32-bit integer max | 10 | 31 bits |
| Signed 64-bit integer max | 19 | 63 bits |
| Unsigned 128-bit integer max | 39 | 128 bits |
| Unsigned 256-bit integer max (SHA-256, EC keys) | 78 | 256 bits |
| Unsigned 2048-bit integer (typical RSA modulus) | 617 | 2048 bits |
What the operators do
- + - *: exact addition, subtraction, and multiplication on integers of any length.
- /: integer (truncating) division. The result is the whole-number quotient; the remainder is dropped. Pair with % to recover it.
- %: remainder of integer division. Sign follows the dividend, matching JavaScript and C.
- ^: integer power with exponentiation by squaring. Right-associative, so a^b^c means a^(b^c).
- !: factorial. Postfix, so n! computes n * (n-1) * ... * 1. Capped at 100,000 to keep the page responsive.
- gcd, lcm: Euclid's algorithm for greatest common divisor; least common multiple is derived from a*b / gcd(a, b).
- powmod(b, e, m): modular exponentiation. Computes b^e mod m without forming the full power, so cryptographic-size inputs run instantly.
Tips and limits
- Use underscores to group long literals so they are easier to read: 1_000_000_007 is the same as 1000000007.
- Lines that start with # are treated as comments. Anything after the # on a line is ignored.
- Division is integer-only because the result type is BigInt. To keep the fractional part of x / y, compute x and y separately and copy them.
- Negative exponents would produce a fraction, so a^(-1) is rejected. Use powmod for modular inverse instead.
- Results are capped at 50,000 digits and powers at exponent 200,000 to keep the browser responsive. The math itself has no upper bound.
- The scientific notation panel is a display convenience; copy the decimal or hex panel for the exact value.
How to use
- Pick Expression mode to type a free-form integer expression, or Two-number mode for a guided panel on a single operation.
- In Expression mode, use +, -, *, / (integer divide), % (remainder), ^ (power), ! (factorial). Call gcd(a, b), lcm(a, b), powmod(base, exp, mod), or abs(n) as functions. Group digits with underscores (1_000_000_007).
- In Two-number mode, pick the operation, then type one integer per input. The expression is built and evaluated below.
- Read the exact decimal value, digit count, scientific notation, hex, and binary in the Result panel. Use any Copy button or Copy summary to grab the full answer with every digit.
- Type a modulus in the Modular reduction panel to reduce the result. Expressions like 10^9 + 7 work as a modulus too.
About this tool
Big Number Calculator does integer arithmetic at any size, exactly, in your browser. Standard calculators are limited to 64-bit floating point, which silently rounds anything past about 15 to 17 significant digits, so the difference between 9_007_199_254_740_992 and 9_007_199_254_740_993 disappears and queries like 100! or 2^256 either overflow to Infinity or return an approximation. This tool runs on native BigInt, so every digit of the result is kept, all the way through addition, subtraction, multiplication, integer division, remainder, power, and factorial. Two complementary modes: Expression mode accepts a small calculator language with the standard infix operators (+, -, *, /, %, ^), unary minus, parentheses, the postfix factorial operator !, and the bracket functions gcd(a, b), lcm(a, b), powmod(base, exponent, modulus), and abs(n). SI-style digit grouping (1_000_000_007) and # line comments are accepted so long literals stay readable. Two-number mode is a guided panel for the most common single operations (add, subtract, multiply, integer divide, remainder, power, GCD, LCM, modular exponent), which builds the underlying expression for you. The result is reported in five forms: the exact decimal value, the decimal value with comma grouping, scientific notation (the leading digits and exponent), hexadecimal (0x...), and binary (0b...), with the total digit count and the sign called out. A separate modular reduction panel reduces the current result modulo any integer expression you type (for example 10^9 + 7 or 2^61 - 1), which is useful for hash arithmetic, contest math, and cryptographic checks. Hard limits keep the page responsive: results are capped at 50,000 digits, factorial inputs at 100,000, and direct power exponents at 200,000 (powmod sidesteps that limit because it never materializes the full power). Useful for cryptography students working through RSA and Diffie-Hellman style problems, contest programmers checking modular arithmetic, number theory homework with factorials and GCDs, and anyone who needs to verify that an answer they got from a smaller calculator is correct. Nothing is uploaded; every BigInt operation runs locally in the browser.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Prime Number Calculator
Primality test plus prime factorization, divisors, divisor count, divisor sum, and next or previous prime.
Open tool
CalculatorFactor Tree Generator
Visual factor tree, exponent form, step-by-step splits, divisors, and counts.
Open tool
CalculatorPermutation and Combination Calculator
nPr, nCr, factorial, n^r, and multiset coefficient with exact step-by-step working.
Open tool
ConverterNumber Base Converter
Binary, octal, decimal, hex, and custom-base conversion with two's complement.
Open tool
ConverterScientific Notation Converter
Convert between scientific, E, engineering, and decimal forms with a precision slider.
Open tool