Big Number Calculator

Perform arithmetic on arbitrarily large integers beyond normal floating-point precision. Supports addition, subtraction, multiplication, division, modulo, exponentiation, GCD, and LCM.

Input

OperationDescription
+, −, ×, ÷Standard arithmetic (integer division for ÷)
modRemainder after division (A mod B)
^Exponentiation (A to the power of B)
GCDGreatest Common Divisor of A and B
LCMLeast Common Multiple of A and B

Result

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.

Exact integer rules, and how one input moves the answer

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.

How to Use This Calculator

  1. Type the First Number (A). The box deletes any character that is not a digit or a minus sign as you type.
  2. Pick an operation from the list: +, −, ×, ÷, mod, ^, GCD or LCM.
  3. Type the Second Number (B). For ^ this is the exponent, which must be non-negative and no larger than 1000.
  4. Press Calculate. Nothing updates until you do.
  5. Read the result. Numbers up to 40 characters get comma separators, and a digit count appears below. Results of 15 digits or fewer also show a scientific-notation tile.
  6. If a red message appears, read it, fix the input and press Calculate again.

Frequently Asked Questions

What happens if I type a decimal point?

It is deleted, so 1.5 silently becomes 15. The calculator handles integers only, so scale decimals up to whole numbers before entering them.

Can I paste a number written with commas?

Yes. The commas are stripped as the text lands, so 1,000,000 becomes 1000000. Spaces and letters are stripped too.

Why does it reject 0?

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.

Why is my division answer smaller than expected?

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.

Why won't it accept a negative or very large exponent?

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.

Is there a limit on how many digits I can enter?

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.