Big Integer Calculator
Add, subtract, multiply, divide, exponentiate, or find the modulo of integers of any size — beyond JavaScript's safe-integer limit — using exact arbitrary-precision arithmetic.
Input
Output
Exact result computed with arbitrary-precision arithmetic — never rounded.
Guides
Why big integers need their own calculator
JavaScript's Number type — and by extension every calculator built on it, including most in-browser tools — can only represent integers exactly up to Number.MAX_SAFE_INTEGER, which is 9007199254740991 (about 9 quadrillion, roughly 16 digits). Beyond that, numbers start silently losing precision: 9007199254740993 can't even be stored as written, because it rounds to 9007199254740992. Multiply two 15-digit numbers together and the exact product is often already past that limit, and results are silently corrupted without any error or warning.
This tool sidesteps the problem entirely using JavaScript's native BigInt type, which represents integers of any size — hundreds or thousands of digits — with exact precision. There's no rounding, no floating-point drift, no silent truncation. 2 raised to the 128th power comes out exactly right, every digit.
How to use it
- Enter Number A — any whole number, positive or negative, of any length.
- Choose an Operation: Add, Subtract, Multiply, Divide, Power, or Modulo.
- Enter Number B.
The result updates automatically and appears in the Result box, ready to copy or download.
Supported operations
- Add / Subtract / Multiply — exact results regardless of size.
- Divide — integer (truncating) division. If B doesn't divide A evenly, the result is shown as
quotient remainder rrather than a rounded or repeating decimal — the only way to represent the division exactly. - Power (A ^ B) — B must be zero or a positive whole number. Exponents are capped at 1000 to keep results computable in a reasonable amount of time; a base with more than a few digits raised to the 1000th power already produces a result thousands of digits long.
- Modulo (A mod B) — the remainder of A ÷ B, following JavaScript's
BigIntconvention: the result takes the sign of A (e.g.-17 mod 5 = -2).
FAQ
Why can't I enter decimals? This is an integer calculator — BigInt only supports whole numbers. For arbitrary-precision decimal math you'd need a different kind of tool (decimal libraries trade off performance and complexity that a whole-number calculator doesn't need).
What happens if I divide or take a modulo by zero? The tool rejects it with a clear error instead of crashing — division by zero is undefined for integers, so B must be non-zero for those two operations.
How big can the numbers get? Addition, subtraction, and multiplication have no practical size limit — you can paste in numbers hundreds of digits long. Only the exponent in a Power operation is capped, to avoid asking your browser to compute a result with millions of digits.
Is this useful for anything real? Yes — cryptography (RSA key material), combinatorics (factorials, large binomial coefficients), and any calculation that must stay exact rather than approximate all outgrow ordinary calculator precision quickly.
Privacy
All arithmetic runs locally using standard JavaScript — nothing you enter is uploaded or stored.