calc-hub logocalc-hub.net

Big Number, Factorial and Power Calculator

Enter two whole numbers of up to 100,000 digits each and pick an operation: add, subtract, multiply, divide, modulo or power. The calculator returns the exact result and how many digits it has. Divide gives the whole-number quotient and drops the remainder, and modulo gives the remainder. Power raises A to the B, up to a result of 200,000 digits. Below that, Count Digits measures a single number, Is Prime? checks numbers up to 1,000,000 and Factorial gives n! up to 40,000!.

Single Number Analysis

How to use the Big Number Calculator

  1. Enter your numbers in the Big Number Calculator above.
  2. Press the Calculate button to see the result.
  3. To try other numbers, change any value and press the button again.

How the calculator stays exact

Whole-number arithmetic with JavaScript BigInt · · · A ÷ B rounds toward zero · · · A % B takes the sign of A

An ordinary browser number holds whole numbers exactly only up to 9,007,199,254,740,991 (2⁵³ − 1). The calculator reads both fields as BigInt, which keeps every digit, so every result is exact. A comma counts only as a thousands separator, so 1,234 is 1234 and 1,5 gets an error message. A decimal point or an exponent such as 1e5 also gets one, because BigInt holds whole numbers only. Dividing −7 by 2 gives −3, and −7 modulo 2 gives −1. n! is 1 × 2 × 3 × … × n, and 0! is 1. In the power mode a negative base keeps its minus sign for an odd exponent, so −2 to the 3 is −8, and 0 to the 0 counts as 1.

Worked example

Enter A = 123456789012345 and B = 987654321098765, two 15-digit numbers. A × B = 121932631137021071359549253925, a 30-digit result. Put B in Number A and A in Number B, and divide gives 8 while modulo gives 9000005. In the power mode, 2 to the 64 gives 18446744073709551616, 20 digits. In the single-number box, 25 and Factorial gives 15511210043330985984000000, 26 digits.

Frequently asked questions

How large a factorial or power can it work out?

Factorial goes up to 40,000!, a number with 166,714 digits. Above that you get a message. Power goes up to a result of 200,000 digits, so 2 to the 664,385 works and 2 to the 664,386 gets a message. The calculator prints every digit, and a result that long takes a moment to appear.

Can it do decimals or negative exponents?

No. Every field takes whole numbers only, because the result is exact. A negative exponent gives a fraction, so it gets a message. For decimals, use the Scientific Calculator.

When do I need big numbers?

Whenever a number passes 9,007,199,254,740,991. Above that an ordinary number field rounds, so 9,007,199,254,740,993 turns into 9,007,199,254,740,992. Long ID or account numbers, cryptography and combinatorics with large n all go past that limit.

How long can the numbers be?

Up to 100,000 digits in each field. A longer number gets a message. The product of two numbers that long has up to 200,000 digits, and the calculator shows all of them. Count Digits ignores the sign, commas and leading zeros, so -007 is 1 digit.

How large a number can Is Prime? check?

Up to 1,000,000. It tests by trial division, so 999,983 comes back prime. Above the limit it says it cannot tell, which is also what it says for 1,000,003. It reports 0, 1 and negative numbers as not prime.

We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking "Accept", you agree to our use of cookies.
Learn more.