Skip to content
FigureSure
Sign in

Big Number Calculator

Add, subtract, multiply and divide numbers with hundreds or thousands of digits, and work out exact powers, factorials, remainders and square roots to as many as 1,000 decimal places. Every digit is exact, where an ordinary calculator would round after 15 or so.
  • Updated
  • Formula shown

Operation
Numbers

Whole numbers or decimals, any length up to 5,000 characters

For powers, a whole-number exponent

Output
Digit grouping

Results

Result
1.21933 × 10³⁹
Exact. Full digits below
Digits
in the whole number
40
Scientific notation
Rounded to 10 significant figures
1.219326311 × 10³⁹

12345678901234567890 × 98765432109876543210 = 1219326311370217952237463801111263526900

Full result
1219326311370217952237463801111263526900

How to use the big number calculator

  1. Choose the operation. Factorial and square root use only number A.
  2. Paste or type the numbers. Decimals and minus signs are fine; commas, spaces and line breaks are ignored, so you can paste formatted numbers.
  3. For division, square roots and negative powers, choose how many decimal places you want. The last digit is rounded half up.
  4. Copy the full result from the box under the summary. Switch on digit grouping to make long results easier to read.

How exact arithmetic works

Store a decimal as an integer and a scale: 12.345 = 12345 ÷ 10³
Add: line the scales up, then add the integers  ·  Multiply: multiply integers, add scales
Divide to N places: round(A × 10ᴺ ÷ B)  ·  √A to N places: integer √(A × 10²ᴺ)
A mod B = A − B × ⌊A ÷ B⌋

Most calculators store numbers in binary floating point, which keeps about 15 to 17 significant digits. That is plenty for measurements but not for exact work such as checking a cryptography exercise, a combinatorics count or a long multiplication. This calculator instead stores each number as an arbitrary-length integer (JavaScript's BigInt) together with the number of decimal places, and does schoolbook-exact arithmetic on those integers. Division and square roots can go on forever, so they stop at the number of places you choose.

For modulo, the answer follows the mathematical (floored) convention, so the remainder takes the sign of B: −7 mod 3 = 2. Many programming languages instead give −1; the calculator shows that version too when it differs.

Worked examples

  • A long multiplication: 12,345,678,901,234,567,890 × 98,765,432,109,876,543,210 = 1219326311370217952237463801111263526900. In floating point the same product comes out as roughly 1.2193263113702179 × 10³⁹, with everything after the 17th digit lost.
  • The chessboard problem: doubling a grain of rice on each of 64 squares gives 2⁶⁴ − 1 = 18,446,744,073,709,551,615 grains in total.
  • A factorial: 25! = 15,511,210,043,330,985,984,000,000. 100! has 158 digits and ends in 24 zeros, one for each factor of 10 (pairs of 2 and 5) in 1 × 2 × … × 100.
  • A square root: √2 to 40 places is 1.4142135623730950488016887242096980785697.
  • A repeating decimal: 1 ÷ 7 to 42 places is 0.142857142857142857142857142857142857142857; the block 142857 repeats. The long division calculator finds repeating blocks for you.

How many digits? Factorials and powers of 2

nDigits in n!Digits in 2ⁿ
1074
20197
506516
10015831
5001,135151
1,0002,568302

Factorials overtake powers quickly: 1,000! already has thousands of digits, far beyond the roughly 10³⁰⁸ ceiling of ordinary floating point.

Limits and tips

  • Size limits keep your browser responsive: inputs up to 5,000 characters, results of powers up to 100,000 digits, factorials up to 5,000! and up to 1,000 decimal places.
  • Exponents must be whole numbers. For fractional powers such as 8^(2/3), use the exponent calculator.
  • “Exact” means exact. When a quotient or root terminates within your decimal places, the calculator says so; otherwise the last digit shown is rounded.
  • For a compact view of a huge result, use the scientific notation line, or convert it with the scientific notation calculator.

Frequently asked questions

Why do normal calculators get big numbers wrong?

They use binary floating point, which keeps only about 15 to 17 significant digits. 12345678901234567890 × 98765432109876543210 has 39 digits, so everything after about the 17th is lost. This calculator keeps every digit.

How large a number can I use?

Each input can be up to 5,000 characters. Powers can produce up to 100,000 digits, factorials go up to 5,000! (16,326 digits) and division or square roots up to 1,000 decimal places.

What is 100 factorial?

100! is a 158-digit number beginning 93326215443944152681… and ending in 24 zeros. The zeros come from the 24 pairs of factors 2 and 5 in 1 × 2 × 3 × … × 100.

How is modulo calculated for negative numbers?

The main answer uses the floored convention, where the remainder has the sign of the divisor: −7 mod 3 = 2. C, Java and JavaScript truncate instead and give −1; the calculator shows both when they differ.

Are division and square root results rounded?

They stop at the number of decimal places you choose, and the last digit is rounded half up. If the answer ends before that, as with 10 ÷ 4 = 2.5 or √144 = 12, it is marked as exact.

Was this calculator helpful?