🇺🇸 USC
Math & Conversion
🔢

Big Number Calculator

Exact arithmetic on huge integers and high-precision decimals

A big number calculator does exact arithmetic on numbers too long for a standard calculator or spreadsheet, which keeps only about 15 to 17 significant digits. For example, 2100 = 1,267,650,600,228,229,401,496,703,205,376 exactly (31 digits), while a standard calculator shows 1.2676506002282294e+30. This tool handles whole numbers with up to 20,000 digits and decimals to 1,000 places.

✅

Last updated October 2026

Method: Whole numbers use JavaScript BigInt, which the ECMAScript standard defines as an integer of any size, so every digit is exact. Decimals are stored as a BigInt plus a count of decimal places: addition, subtraction and multiplication are exact, while division and square roots (integer Newton iteration) are carried to the precision you choose and rounded half away from zero.

Included: Addition, subtraction, multiplication, quotient and remainder, powers, modulo, GCD and LCM, and factorials up to 20,000!; digit count, digit sum, trailing zeros and scientific notation; a side-by-side 64-bit floating-point result; and decimal arithmetic, whole-number powers and square roots at 0 to 1,000 places.

Not included: Fractional powers and logarithms of big numbers, trigonometry, complex numbers, primality tests and factorization, and results longer than 100,000 digits.

🔢 Enter your numbers

1 digit typed

3 digits typed

Operation
Try:

Spaces and underscores in your input are ignored, commas may group thousands (1,234,567), and e-notation such as 1e50 or 2.5e-8 is accepted. Inputs can have up to 20,000 digits; results up to 100,000 digits.

🔢 A ^ B

1,267,650,600,228,229,401,496,703,205,376
Digits
31
Scientific notation
1.2676506 × 1030
Digit sum
115
Trailing zeros
0

🧾 Details

Inputs as read
A: 1 digit (2 × 100)
B: 3 digits (1 × 102)
What a standard calculator shows (64-bit floating point, about 15 to 17 significant digits)
1.2676506002282294e+30
Differs from the result above: floating point keeps only about 16 significant digits.
Everything is computed in your browser. Whole numbers use JavaScript BigInt, which stores integers of any length exactly. Decimals are stored as a BigInt plus a count of decimal places, so 0.1 is exactly one tenth; division and square roots (Newton's method) are carried to the precision you choose and then rounded half away from zero.

Big number arithmetic: exact integers and high-precision decimals

A large number calculator, also called a big integer calculator or arbitrary precision calculator, is useful whenever the digits themselves matter: checking a 30-digit product, writing out 100! in full, testing where a program's 64-bit integers overflow, or carrying a division to 200 decimal places. This page explains why ordinary tools fall short and how exact arbitrary-precision arithmetic avoids the problem.

Why ordinary calculators lose digits

Almost every calculator app, spreadsheet and programming language stores numbers in the IEEE 754 double-precision format, the format the ECMAScript standard prescribes for JavaScript's Number type. A double holds 53 bits of significand, which is about 15 to 17 significant decimal digits. Everything beyond that is rounded away without a warning:

253 + 1 = 9,007,199,254,740,993   (a double shows 9,007,199,254,740,992) 0.1 + 0.2 = 0.3   (a double shows 0.30000000000000004) 264 = 18,446,744,073,709,551,616   (a double shows 18446744073709552000)

For a monthly budget those errors are harmless. For cryptography, combinatorics, ID numbers longer than 15 digits, or any result you want to quote to the last digit, they are not. The calculator above shows the floating-point answer next to the exact one so you can see where the two part ways.

How exact big-number arithmetic works

In whole-number mode every value is a BigInt, which the ECMAScript specification describes as an integer that "may be any size and is not limited to a particular bit-width". Addition, subtraction and multiplication are exact by definition; division returns the quotient truncated toward zero plus the remainder, so nothing is lost. Factorials use a binary-splitting product, multiplying 1 × 2 × … × n as a balanced tree of partial products, which computes 20,000! in a fraction of a second.

In decimal mode the page works as a high precision calculator. It stores each number as an integer plus a count of decimal places: 3.14159 becomes 314159 with 5 places. Sums and products of such numbers are again exact integers with a known number of places. Only division, negative powers and square roots can produce endless digits, and those are carried to the number of places you choose and rounded half away from zero, so 2 ÷ 3 at 20 places ends in 7.

Worked example 1: 2100 and 21000

Enter A = 2, B = 100 and choose AB:

2100 = 1,267,650,600,228,229,401,496,703,205,376

The result has 31 digits and a digit sum of 115, and its scientific form is 1.2676506 × 1030. A standard calculator shows 1.2676506002282294e+30, and tools that write the number out in full pad it with zeros after the 17th digit: 1,267,650,600,228,229,400,000,000,000,000. Raise the exponent to 1,000 and the exact answer grows to 302 digits, 1.071508607 × 10301, with a digit sum of 1,366, a classic programming exercise. You can predict the length before computing: digits = ⌊B × log10 A⌋ + 1 = ⌊1,000 × 0.30103⌋ + 1 = 302.

Worked example 2: 100! with every digit

Enter A = 100 and choose A!. The calculator returns all 158 digits:

93,326,215,443,944,152,681,699,238,856,266,700,490,715,968,264,381,621,468,592,963,895,217,599,993,229,915,608,941,463,976,156,518,286,253,697,920,827,223,758,251,185,210,916,864,000,000,000,000,000,000,000,000

The last 24 digits are zeros. Each trailing zero needs a factor of 10, that is a 5 paired with a 2, and fives are the scarcer factor: 100 ÷ 5 = 20 multiples of 5, plus 100 ÷ 25 = 4 numbers that contribute a second five, gives 24 (Legendre's formula). The digit sum is 648 and the scientific form is 9.332621544 × 10157. A double shows 9.33262154439441e+157, and from 171! on it overflows to Infinity, while this calculator continues to 20,000!.

Famous big numbers, computed exactly

Every value in this table was computed with the same exact arithmetic the calculator uses, so you can reproduce each row:

Number Digits Scientific notation Digit sum Trailing zeros
264201.844674407 × 1019880
2100311.2676506 × 10301150
50!653.04140932 × 106421612
Googol, 101001011 × 101001100
100!1589.332621544 × 1015764824
210003021.071508607 × 103011,3660
310004781.322070819 × 104772,1420
1000!2,5684.023872601 × 10256710,539249
10000!35,6602.846259681 × 1035659149,3462,499

264 is one more than the largest unsigned 64-bit integer, the ceiling of many databases and file systems. A googol has only one nonzero digit, while 10000! needs 35,660 digits, more than 350 googols' worth of length.

Division, remainders, modulo, GCD and LCM

Long division of big integers returns two exact results. For example:

123,456,789,012,345,678,901,234,567,890 ÷ 987,654,321 = 124,999,998,873,437,499,901 remainder 574,845,669

The calculator checks itself by showing B × quotient + remainder, which must give back A; a double would print the quotient as 124999998873437500000. With negative numbers the conventions split. Truncated division, used by JavaScript, C and Java, gives −7 ÷ 2 = −3 remainder −1; floor division gives −4 remainder 1. The modulo operation always returns a value from 0 to |B| − 1, so −7 mod 3 = 2, and modular arithmetic on huge powers works too: 2100 mod 1,000,000,007 = 976,371,285.

The greatest common divisor uses Euclid's algorithm on the exact integers. GCD(264 − 1, 248 − 1) = 65,535, which is 216 − 1 (16 is the GCD of the exponents), and the least common multiple is 79,229,371,458,530,696,292,133,175,295.

Worked example 3: decimals that floating point gets wrong

Switch to Decimals and the same numbers behave the way you learned in school:

  • 0.1 + 0.2 = 0.3 exactly (a double gives 0.30000000000000004).
  • 1.1 × 1.1 = 1.21 exactly (a double gives 1.2100000000000002).
  • 1 − 0.9 = 0.1 exactly (a double gives 0.09999999999999998).
  • 1 ÷ 7 at 60 places = 0.142857 repeated ten times, flagged as rounded because the true expansion never ends.

Powers show the difference most clearly. At 40 places, 1.000110000 = 2.7181459268252248640376646749131465361138, while a double returns 2.7181459268249255, wrong from the 13th significant digit because the tiny storage error in 1.0001 is multiplied ten thousand times. The value is close to e = 2.71828…, since (1 + 1/n)n approaches e as n grows.

Worked example 4: the square root of 2 to 50 places

To compute √2 to 50 places, the calculator finds the integer square root of 2 × 10100 with Newton's method:

xnext = (x + N ÷ x) ÷ 2, repeated until x stops shrinking √2 = 1.41421356237309504880168872420969807856967187537695

The digits after the 50th place begin with 8, so the last digit is rounded up from 4 to 5. Each Newton step roughly doubles the number of correct digits, which is why 1,000 places take milliseconds; the 1,000-place result matches the published decimal expansion of √2 (OEIS A002193) digit for digit. A double stops at 1.4142135623730951.

How to use this calculator

Pick Whole numbers for exact integer work or Decimals for numbers with a fractional part. Type or paste A and B; spaces and underscores are ignored, commas may group thousands (1,234,567), and e-notation such as 1e50 or 2.5e-8 works. Choose the operation; factorial and square root use only A. In decimal mode, set the number of decimal places (0 to 1,000) or tap a preset. The result card shows the full result with optional digit grouping, the digit count, the scientific notation and, for integers, the digit sum and trailing zeros. A copy button puts the plain digits on your clipboard, and the details card adds remainders, the LCM and the floating-point comparison.

Who this calculator is for

Programmers use it to check overflow boundaries such as 263 − 1 and to verify big-integer code. Students of number theory and cryptography work with modular arithmetic on numbers far beyond a phone calculator's range, and puzzle solvers compute digit sums of huge powers and factorials. Teachers demonstrate floating-point rounding with 0.1 + 0.2, and anyone handling long identifiers can multiply or compare them without losing digits.

Key terms

  • Arbitrary precision: arithmetic whose number length grows as needed instead of being fixed in advance.
  • BigInt: JavaScript's built-in integer type of unlimited size.
  • Floating point (double): the 64-bit format with about 15 to 17 significant digits used by ordinary calculators.
  • Significant digits: the digits from the first nonzero digit onward.
  • Remainder and modulo: what is left after integer division; modulo is never negative for a positive divisor.
  • Digit sum: the sum of all decimal digits of a number.

Accuracy, limits and tips

Whole-number results are always exact. Decimal results are exact for addition, subtraction, multiplication and positive powers, and otherwise correctly rounded at the last place you asked for, so the precision setting is what changes a decimal answer. To keep the page responsive, inputs are capped at 20,000 digits, results at 100,000 digits, factorials at 20,000! and GCD inputs at 10,000 digits; a power is checked with the digit formula before it runs, so 21,000,000 (301,030 digits) is refused with a clear message instead of freezing the tab. Use e-notation to type long round numbers, and remember that in the U.S. format a comma separates thousands, never decimals.

Related calculators

Sources

⚠️ Common mistakes & edge cases

Trusting a spreadsheet with long numbers

A 16-digit or longer ID typed into a floating-point tool can come back with its final digits changed or replaced by zeros. Store long identifiers as text, and do arithmetic on them only with an exact tool.

Typing a comma as the decimal point

In the U.S. format the comma only groups thousands, so the calculator stops at an entry like 1,5 with a message instead of guessing whether you meant 15 or 1.5. Use a period for decimals: 1.5.

Mixing up remainder conventions

−7 % 3 is −1 in JavaScript and C but 2 in Python and in mathematics. When code and paper disagree, check which convention each uses; the calculator shows both.

Expecting every fraction to terminate

1 ÷ 3 and 1 ÷ 7 never end in decimal form, so any finite answer is rounded. The result card says whether a decimal result is exact or rounded.

Underestimating powers

7222 sounds modest but has 188 digits, and 21,000,000 would have 301,030. Estimate with B × log10 A before asking for a power.

Zero to the power of zero

00 returns 1, the convention of the ECMAScript BigInt specification and of most algebra and combinatorics texts. Some calculus contexts leave it undefined, so state your convention.

Note: All arithmetic runs in your browser; nothing you type is sent anywhere. Very large results can take a moment to render.

❓ Frequently asked questions

What is a big number calculator?

A big number calculator performs exact arithmetic on numbers far longer than an ordinary calculator can hold. Instead of rounding to about 16 significant digits, it keeps every digit, so 2^100 comes out as 1,267,650,600,228,229,401,496,703,205,376 rather than 1.2676506002282294e+30. This one handles whole numbers with up to 20,000 digits, results up to 100,000 digits and decimals to 1,000 places.

How many digits can a normal calculator handle?

Most calculator apps, spreadsheets and programming languages store numbers in the 64-bit IEEE 754 double format, which has a 53-bit significand and keeps roughly 15 to 17 significant decimal digits. Every whole number up to 2^53 = 9,007,199,254,740,992 is exact, but above that some integers can no longer be stored: 2^53 + 1 is silently rounded to 9,007,199,254,740,992.

What is the largest number this calculator can handle?

Each input can have up to 20,000 digits and each result up to 100,000 digits, factorials go up to 20,000! (77,338 digits), GCD and LCM accept inputs of 10,000 digits each, and decimal results can carry up to 1,000 places. The limits exist to keep your browser responsive; within them every digit is exact.

Why does 0.1 + 0.2 not equal 0.3 on a computer?

Binary floating point cannot store 0.1, 0.2 or 0.3 exactly, just as a decimal cannot write 1/3 exactly. Each value is rounded to the nearest binary fraction, and the rounding errors add up to 0.30000000000000004. In this calculator's decimal mode, 0.1 is stored as the integer 1 with one decimal place, so 0.1 + 0.2 is exactly 0.3.

How do I calculate 2 to the power of 1000 exactly?

Enter 2 as A and 1000 as B and choose the power operation. The exact result has 302 digits, starts 10715086071862673 and has a digit sum of 1,366. You can predict the length without computing it: the number of digits of A^B is the whole part of B × log10(A), plus 1, here 301.03 rounded down to 301, plus 1.

How many digits does 100 factorial have?

100! has 158 digits and equals about 9.332621544 × 10^157. It ends in exactly 24 zeros, because each trailing zero needs a factor of 5 paired with a 2, and 1 to 100 contain 20 multiples of 5 plus 4 extra fives from 25, 50, 75 and 100. Its digit sum is 648. A standard calculator shows only 9.33262154439441e+157.

What is the difference between remainder and modulo?

They agree for positive numbers and differ when signs differ. Dividing −7 by 2 with truncation gives quotient −3 and remainder −1, the convention of JavaScript, C and Java. Floor division gives quotient −4 and remainder 1. The mathematical modulo is never negative for a positive divisor: −7 mod 3 = 2, while the truncated remainder is −1. The calculator shows both.

How does the calculator find square roots to 1,000 digits?

It scales the number by a power of 100, takes the exact integer square root with Newton's method, x(next) = (x + N ÷ x) ÷ 2, and then places the decimal point. Each Newton step roughly doubles the number of correct digits, so even 1,000 digits need only a handful of steps. The 1,000-place square root of 2 matches the published digits of OEIS sequence A002193.

What is arbitrary-precision arithmetic?

Arbitrary-precision arithmetic stores a number as a list of digits (or machine words) that can grow as long as needed, so its precision is limited only by memory and time rather than by a fixed format. Fixed-precision arithmetic, such as 64-bit floating point, always uses the same amount of storage and rounds whatever does not fit.

How do I write a very large number in scientific notation?

Count the digits: the exponent of 10 is the digit count minus 1, and the mantissa is the leading digits with the decimal point after the first one. 2^100 has 31 digits, so it is about 1.2676506 × 10^30. The calculator shows the scientific form of every result, rounded to 10 significant digits.

💡 Good to know

Count digits without computing

The number of digits of AB is ⌊B × log10 A⌋ + 1. For 31000 that is ⌊477.12⌋ + 1 = 478, the length in the table above.

Trailing zeros of a factorial

Add n ÷ 5, n ÷ 25, n ÷ 125 and so on, dropping the remainders. For 1000! that is 200 + 40 + 8 + 1 = 249 zeros.

The 253 boundary

Up to 9,007,199,254,740,992 every whole number fits exactly in a double. Above it the gaps between storable numbers grow to 2, then 4, then 8, which is where exact big-integer arithmetic becomes necessary.

Related Calculators