Big Number Calculator

About this calculator

The Big Number Calculator does exact arithmetic on numbers far beyond the 15 to 16 digits an ordinary calculator can hold. Enter X and Y as integers, decimals or E notation, choose an operation, and get every digit of the answer along with its digit count and scientific notation.

Addition, subtraction, multiplication, whole-number powers, factorials, MOD, GCD and LCM are exact. Division, square roots and negative powers are cut off at the precision you choose.

digits after the decimal point (for division, roots and negative powers)

Accepts integers, decimals and E notation such as 23E18 or 3.5e-19. Commas and spaces are ignored.

Embed this calculator

Paste this code into a Custom HTML block on your site. The calculator fits the width of the block. Adjust the height in the code if you want more room for results.

Find this widget in the publisher directory

What the big number calculator does

Most calculators, spreadsheets and programming languages store numbers in double-precision floating point, which keeps only about 15 to 16 significant digits. Beyond that, digits are silently rounded away: in floating point, 264 + 1 equals 264. This tool stores numbers as exact strings of digits instead, so a 1,000-digit number keeps all 1,000 digits, and results such as 21000 (302 digits) or 1000! (2,568 digits) are printed in full.

Operations

  • X + Y, X − Y, X × Y: exact sums, differences and products, including decimals.
  • X / Y: the quotient, truncated (not rounded) to the number of decimal places set in Precision. Trailing zeros are dropped, so 1 / 4 shows 0.25.
  • XY: X raised to a whole-number power Y. Positive powers are exact; negative powers are computed as 1 / X|Y| and truncated to the precision.
  • √X: the square root of X, truncated to the precision.
  • X2: X times itself, exact.
  • X!: the factorial of a whole number X, the product 1 × 2 × 3 × ... × X.
  • MOD: the remainder after dividing X by Y. The remainder takes the sign of X.
  • GCD and LCM: greatest common divisor and least common multiple of two whole numbers.

Entering numbers

Type digits with an optional minus sign and decimal point. Commas and spaces are ignored, so you can paste numbers copied from a document. E notation is accepted: 23E18 means 23 × 1018 and 3.5e-4 means 0.00035. Inputs may be thousands of digits long.

Worked examples

InputOperationResult
X = 2, Y = 100XY1,267,650,600,228,229,401,496,703,205,376
X = 25X!15,511,210,043,330,985,984,000,000
X = 2√X, precision 201.4142135623730950488
X = 2, Y = 3X / Y, precision 50.66666 (truncated, not rounded up)
X = 1071, Y = 462GCD21

Notice the square root of 2 ends in ...0488 rather than ...04880: the twentieth decimal is a zero, and trailing zeros are not printed.

Names of large numbers

In the short scale used in the United States and in modern British English, each new name is a thousand times the previous one.

NamePower of tenZeros
Thousand1033
Million1066
Billion1099
Trillion101212
Quadrillion101515
Quintillion101818
Sextillion102121
Septillion102424
Octillion102727
Nonillion103030
Decillion103333
Googol10100100
Centillion10303303

The long scale, still used in much of continental Europe and Latin America, calls 109 a "milliard" and 1012 a "billion", so always check which convention a source uses.

How the arithmetic works

Each number is stored as a whole number of digits plus a count of decimal places. 12.345 becomes 12345 with three decimal places. Adding or subtracting lines up the decimal places first; multiplying multiplies the digit strings and adds the decimal places. Division scales the dividend by a power of ten large enough for the requested precision, then performs exact integer division, which is why the result is truncated. Square roots use Newton's method on integers, and GCD uses the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller, until the remainder is zero. LCM is then |X × Y| ÷ GCD(X, Y).

Where big numbers show up

Cryptography uses primes with hundreds of digits; RSA keys are typically 2,048 bits, about 617 decimal digits. Combinatorics produces enormous counts: a standard deck can be shuffled in 52! ways, a 68-digit number. Astronomy and physics deal with values such as the roughly 1080 atoms in the observable universe. In each case an exact tool avoids the rounding that ordinary floating point would introduce.

Frequently asked questions

How many digits can the big number calculator handle?
Inputs can be thousands of digits long, and results up to about 200,000 digits are shown in full. For example 2^1000 (302 digits) and 1000! (2,568 digits) display every digit.
Why is the division result not rounded?
Division, square roots and negative powers are truncated to the number of decimal places in the Precision box, so 2 / 3 with precision 5 shows 0.66666. Raise the precision to see more digits.
Can I use decimals and scientific notation?
Yes. Inputs such as 0.000125, -42.5 and 6.022E23 are accepted and converted to exact values before the calculation.
What is 52 factorial?
Enter 52 as X and press X!. The result is 80,658,175,170,943,878,571,660,636,856,403,766,975,289,505,440,883,277,824,000,000,000,000, a 68-digit number.

Formulas and sample results on this page were checked against independent references. Page last reviewed or updated . How we verify calculators. Project led by Shaun Connell.