Skip to content

Big Number Calculator

Add, subtract, multiply, divide, raise to powers, take roots and find GCD, LCM, mod and factorials of numbers with thousands of digits, every digit exact.

Calculator Details

Result:1.26765060022823 × 10^30See results ↓

What to do with A and B

A whole number or decimal of any size; spaces and commas are ignored; e-notation (1e300) works

The second number (the exponent for a power, the index for a root)

For division, roots and fractional powers: digits after the point (rounded half away from zero)

Your Results

Result: 1.26765060022823 × 10^30

Result

1.26765060022823 × 10^30

31 digits, exact

Details

Scientific notation

1.26765060022823 × 10^30

15 significant digits

Digits

31

In the whole-number result

Trailing zeros

0

Zeros at the end of the result

Full result
1,267,650,600,228,229,401,496,703,205,376

2 ^ 100 = 1.26765060022823 × 10^30, a result with 31 digits.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Detailed Breakdown

The calculation
ItemValue
OperationA ^ B (power)
A1 digit
B3 digits
Result31 digits, 1.26765060022823 × 10^30
Exact?Yes, every digit
Sum of the digits115

How This Calculator Works

How it's calculated

Ordinary calculators keep about 16 significant digits. This one keeps them all. Whole numbers are stored as BigInt values, which hold any number of digits and multiply exactly. Decimals are stored with decimal.js, which works in base 10 with as many digits as the calculation needs, so 0.1 + 0.2 is exactly 0.3. When a result can't be finite (1 ÷ 3, √2), it is worked out with extra guard digits and then rounded to the decimal places you asked for.

Powers use repeated squaring, roots Newton's method, GCD the Euclidean algorithm and LCM = |A × B| ÷ GCD. A remainder can follow two conventions for negative numbers, and both are shown.

2 ^ 100
= 1267650600228229401496703205376
≈ 1.26765060022823 × 10^30

Frequently Asked Questions

Why do ordinary calculators get big numbers wrong?

Most calculators and spreadsheets store numbers as 64-bit floating point, which keeps only about 15 to 17 significant digits. Beyond that the last digits are rounded away: 2^100 shows as 1.26765E+30, while the exact value is 1267650600228229401496703205376. Above about 1.8 × 10^308 they overflow altogether. This calculator stores every digit.

How big can the numbers be?

Each input can be up to 5,000 characters and a result up to 100,000 digits. That is enough for 1000! (2,568 digits) and for powers like 10^100, a googol, with 101 digits. Very large powers that would exceed the limit are refused with an estimate of their size.

Are decimal results exact?

Addition, subtraction, multiplication and whole-number powers of decimals are exact: 0.1 + 0.2 gives 0.3, not 0.30000000000000004. Division, roots and fractional powers usually have infinitely many digits, so they are rounded to the number of decimal places you choose (up to 2,000), and the result says when it is rounded.

What is the difference between the remainder and mod for negative numbers?

There are two conventions. The truncated remainder takes the sign of the dividend, as JavaScript, C and Java do: −17 rem 5 = -2. The floored modulo takes the sign of the divisor, as Python and Excel's MOD do: −17 mod 5 = 3. For positive numbers they agree. The calculator shows both.

How do I enter very large or very small numbers?

Type or paste the digits; spaces, commas and underscores used as separators are ignored. E-notation works too: 6.02214076e23 or 1e-50. A minus sign in front makes a number negative.

How is the factorial of a big number computed?

By multiplying 1 × 2 × … × n exactly with BigInt, splitting the product into balanced halves so the multiplications stay fast. For the factorial of small numbers with digit counts, trailing zeros and Stirling’s approximation, see the factorial calculator.

What is scientific notation used for here?

A number with thousands of digits is hard to read, so the result also shows it as a mantissa between 1 and 10 times a power of ten, rounded to 15 significant digits, along with the exact number of digits. The full result is always there to copy.

Is the calculation done on a server?

No. Everything runs in your browser, so the numbers you type are not sent anywhere. They do appear in the page address, which is how the share link reproduces your calculation.

Whole numbers are handled with JavaScript BigInt and decimals with decimal.js, so addition, subtraction, multiplication, whole-number powers, GCD, LCM, remainders and factorials are exact to the last digit. Division, roots, negative and fractional powers are rounded to the decimal places you choose, half away from zero. Inputs are limited to 5,000 characters and results to 100,000 digits (n! to n ≤ 25,000); everything runs in your browser. The remainder is shown in both conventions: truncated (the sign of A) and floored (the sign of B). Not included: complex numbers, fractions typed as a/b, numbers in other bases (see the number base converter), and the gamma function for non-integer factorials.

Big Number Calculator: Exact Arithmetic on Numbers with Thousands of Digits

By FindMySum · Last reviewed

A big number calculator does arithmetic on numbers too large, or too precise, for an ordinary calculator. This one adds, subtracts, multiplies and divides numbers with thousands of digits, raises them to powers, takes roots and finds the greatest common divisor, the least common multiple, remainders and factorials. Whole-number results are exact to the last digit. Decimal results are exact where that is possible, and rounded to a number of decimal places you choose where it isn't.

Why ordinary calculators lose digits

Almost every calculator, spreadsheet and programming language stores numbers in 64-bit binary floating point (IEEE 754 double precision). It keeps a 53-bit significand, which is about 15 to 17 decimal digits, plus an exponent. That is plenty for measurements, but it means:

  • Whole numbers above 2^53 (about 9 × 10^15) can't all be stored, so 2^100 becomes 1.26765E+30 and its last 16 digits are lost.
  • Numbers above about 1.8 × 10^308 overflow to infinity, so 171! can't be computed at all.
  • Many short decimals, like 0.1, have no exact binary form, which is why 0.1 + 0.2 gives 0.30000000000000004.

Arbitrary-precision arithmetic stores as many digits as the number needs. The calculator uses JavaScript's built-in BigInt for whole numbers and the decimal.js library for decimals. Both run in your browser.

What each operation does

Addition, subtraction and multiplication are exact for any inputs. Multiplying a 30-digit number by another 30-digit number gives a 59- or 60-digit result, and every digit is shown.

Division of whole numbers gives three things: the whole-number quotient, the remainder and the decimal value to the number of places you choose. 1 ÷ 7 to 30 places is 0.142857 142857 142857 142857 142857 142857 (digits grouped in sixes here); the six-digit block repeats forever, so any finite answer is rounded.

Powers with a whole-number exponent are exact: 2^100 = 1 267 650 600 228 229 401 496 703 205 376. A negative exponent gives a reciprocal, rounded to your decimal places, and a fractional exponent such as 2^0.5 is computed with logarithms at high precision.

Roots use the index B: B = 2 for a square root, 3 for a cube root. If A is a perfect power the root is exact, otherwise it is rounded: √2 to 50 places is 1.41421 35623 73095 04880 16887 24209 69807 85696 71875 37695 (grouped in fives here).

GCD and LCM use the Euclidean algorithm, which takes only a few hundred steps even for numbers with hundreds of digits. LCM(A, B) = |A × B| ÷ GCD(A, B).

Factorial multiplies 1 × 2 × … × n. 100! has 158 digits and ends in 24 zeros; the calculator handles n up to 25,000, whose factorial has about 99,000 digits.

Remainders of negative numbers

For positive numbers, 17 mod 5 = 2 everywhere. For negative numbers there are two conventions, and both are in common use:

  • Truncated remainder: the quotient is rounded toward zero, so the remainder has the sign of the dividend. −17 rem 5 = −2, because −17 = 5 × (−3) − 2. JavaScript, C, C++ and Java's % operator work this way.
  • Floored modulo: the quotient is rounded down, so the result has the sign of the divisor. −17 mod 5 = 3, because −17 = 5 × (−4) + 3. Python's %, Excel's MOD and most mathematics texts work this way.

The calculator shows both, so you can match whichever system you are checking.

Worked example: 2^100

The calculator opens with A = 2, B = 100 and the power operation.

  1. Exact result: 2^100 = 1 267 650 600 228 229 401 496 703 205 376 (digits grouped in threes here).
  2. Digit count: 31, which matches ⌊100 × log₁₀ 2⌋ + 1 = ⌊30.103⌋ + 1.
  3. Scientific notation: 1.26765060022823 × 10^30, rounded to 15 significant digits.
  4. Compare: a spreadsheet shows 1.26765E+30 and, if you format it as a whole number, prints 1 267 650 600 228 230 000 000 000 000 000, with the last 16 digits replaced by zeros.

Entering numbers

Type or paste digits; spaces, commas and underscores are ignored, so 1,000,000 and 1 000 000 both work. E-notation is accepted (6.02214076e23, 1e-50), and a leading minus sign makes a number negative. Each input can be up to 5,000 characters, and the result is limited to 100,000 digits. Results that would be larger are refused with an estimate of their size, worked out from logarithms, before any work is done.

Limits

The calculator works with real numbers in base 10. It doesn't do complex numbers, fractions typed as a/b, other number bases or non-integer factorials (the gamma function). Rounded results use round-half-away-from-zero at the last place you ask for; increase the decimal places if you need more digits.

More questions

What is the largest number a normal computer can store exactly?

In standard double-precision floating point, which JavaScript, Excel and most calculators use, every integer up to 2^53 = 9,007,199,254,740,992 is exact. Above that, only some integers can be stored and the rest are rounded to a neighbour; the largest finite value is about 1.8 × 10^308. Arbitrary-precision libraries like BigInt and decimal.js remove both limits.

What is a googol and a googolplex?

A googol is 10^100, a 1 followed by 100 zeros, so it has 101 digits. A googolplex is 10^googol: it has a googol plus one digits, far more than there are atoms in the observable universe, so no computer can write it out. The calculator can show a googol in full.

Why does 0.1 + 0.2 not equal 0.3 on some computers?

Binary floating point can't represent 0.1 or 0.2 exactly, just as a decimal can't write 1/3 exactly. The stored values are slightly off, and their sum is 0.30000000000000004. Decimal arithmetic, which this calculator uses for numbers with a decimal point, stores 0.1 exactly and gives 0.3.

How many digits does a power have?

The number of digits of a positive whole number N is ⌊log₁₀ N⌋ + 1. For a power a^b that is ⌊b·log₁₀ a⌋ + 1, so 2^100 has ⌊100 × 0.30103⌋ + 1 = 31 digits and 2^1000 has 302. The calculator uses this estimate to refuse results over 100,000 digits before trying.

Where are numbers this large used?

Cryptography is the main everyday use: RSA keys are products of two primes with hundreds of digits each, and the arithmetic is modular exponentiation on 2048-bit numbers. Combinatorics produces huge counts such as 52! ≈ 8.07 × 10^67 orderings of a deck of cards, and number theory searches for primes and digits of constants with millions of digits.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy