Perform arithmetic on arbitrarily large integers beyond normal floating-point precision. Supports addition, subtraction, multiplication, division, modulo, exponentiation, GCD, and LCM.
| Operation | Description |
|---|---|
| +, −, ×, ÷ | Standard arithmetic (integer division for ÷) |
| mod | Remainder after division (A mod B) |
| ^ | Exponentiation (A to the power of B) |
| GCD | Greatest Common Divisor of A and B |
| LCM | Least Common Multiple of A and B |
Enter two large integers and click Calculate.
How do you multiply two 30-digit numbers and keep every digit? An ordinary calculator rounds anything past about 15 or 16 significant digits and flips to e-notation, so the trailing digits are gone for good. This page uses exact integer arithmetic instead, so 123456789012345678901234567890 × 987654321098765432109876543210 comes back as a full 60-digit number.
Addition, subtraction and multiplication are exact. Division is integer division that truncates toward zero, and mod returns the remainder carrying the sign of the first number, so -7 ÷ 2 is -3 and -7 mod 2 is -1. Powers use repeated squaring: multiply the running result by the base whenever the exponent is odd, square the base, halve the exponent. GCD uses Euclid's rule, GCD(a, b) = GCD(b, a mod b), and LCM(a, b) = a ÷ GCD(a, b) × b, with negatives treated as their absolute values.
What changes if you nudge one input? The result moves by exactly that amount. Add 1 to the first number and the sum rises by exactly 1, down to the last digit. Ordinary floating point cannot tell the two apart: both print as 1.2345678901234568e+29. For powers, every +1 on the exponent multiplies by the base. 2^64 is 18446744073709551616 (20 digits) and 2^65 is 36893488147419103232, while 2^1000 runs to 302 digits.
Worked example with A = 123456789012345678901234567890 and B = 987654321098765432109876543210. A + B = 1111111110111111111011111111100, which is 31 digits. B ÷ A truncates to 8, and B mod A = 9000000000900000000090. Here that remainder divides A exactly, so it is also GCD(A, B). LCM(A, B) = A ÷ GCD × B = 13548070124980948012498094801236261410. A × B = 121932631137021795226185032733622923332237463801111263526900, again exact.
A practical use is modular arithmetic. To find the remainder of 7^100 divided by 13, run 7 ^ 100 first. The result has 85 digits. Copy it into A, choose mod, enter 13 as B, and the answer is 9. The page cannot chain two operations on its own, so the copy-and-paste step is yours.
It is deleted, so 1.5 silently becomes 15. The calculator handles integers only, so scale decimals up to whole numbers before entering them.
Yes. The commas are stripped as the text lands, so 1,000,000 becomes 1000000. Spaces and letters are stripped too.
On this page a 0 in either box is treated as invalid, with an 'invalid integer' message, except as the second number for mod, which answers 'Modulo by zero'. For zero cases, work them out by hand: 0 added to anything changes nothing, and anything times 0 is 0.
Division here keeps only the whole part. 100 ÷ 7 gives 14 and drops the .2857 tail. Use mod to get the remainder, 2, so that 14 × 7 + 2 = 100.
Negative exponents would give fractions, which an integer calculator cannot hold, and the page caps the exponent at 1000, so 2 ^ 1001 is refused while 2 ^ 1000 works.
The page sets none, so the practical limit is your browser's memory and patience. Very long inputs with ^, ×, GCD or LCM can take noticeably longer to compute.