Big Integer Calculator
Calculate with integers of any size: addition, subtraction, multiplication, division, remainder, powers, factorials, gcd and lcm, with results in decimal and hex.
Free · No sign-up · Your inputs stay in your browser
Input
Calculate with arbitrarily large integers
Output
Result
Decimal
340282366920938463463374607431768211455
39 digits
Hex
0xffffffffffffffffffffffffffffffff
Binary length
128 bits
Uses JavaScript's BigInt, so there is no limit but memory and no rounding: 2^128 has every one of its 39 digits. That is the difference from a normal calculator or a double, which is exact only up to 2^53. Integer division truncates towards zero, as it does in C, Java and SQL.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Exact answers
Ordinary calculators and doubles are exact only up to 2^53; beyond that they round. 2^128 - 1, the size of the UUID or IPv6 space, has 39 digits and every one is shown here. Integer division truncates towards zero, as in C, Java and SQL, and the remainder takes the sign of the dividend.
In code
JavaScript's BigInt (with an n suffix), Python's built-in int, PHP's GMP or BCMath extensions and Java's BigInteger all do arbitrary-precision integer arithmetic. BigInt and Number cannot be mixed in one JavaScript expression without converting.