Check whether a whole number up to 10^15 is prime, see its factors, and find the previous and next prime.
There are 25 prime numbers below 100. The rows list the primes in each group of ten.
| Numbers | Primes |
|---|---|
| 1 to 10 | 2, 3, 5, 7 |
| 11 to 20 | 11, 13, 17, 19 |
| 21 to 30 | 23, 29 |
| 31 to 40 | 31, 37 |
| 41 to 50 | 41, 43, 47 |
| 51 to 60 | 53, 59 |
| 61 to 70 | 61, 67 |
| 71 to 80 | 71, 73, 79 |
| 81 to 90 | 83, 89 |
| 91 to 100 | 97 |
Found with this page's own prime check.
| Number | Verdict | Smallest factor | Factors |
|---|---|---|---|
| 1 | Neither prime nor composite | - | - |
| 2 | Prime | - | - |
| 9 | Composite | 3 | 3 × 3 |
| 17 | Prime | - | - |
| 21 | Composite | 3 | 3 × 7 |
| 27 | Composite | 3 | 3 × 9 |
| 51 | Composite | 3 | 3 × 17 |
| 57 | Composite | 3 | 3 × 19 |
| 91 | Composite | 7 | 7 × 13 |
| 97 | Prime | - | - |
| 101 | Prime | - | - |
A dash means the number is prime or has no factors to list. 1 is neither prime nor composite, because a prime needs exactly two divisors.
Type a whole number from 0 to 10^15 (1,000,000,000,000,000). Spaces, commas and underscores are ignored, so 1,000,000,007 works; letters, decimals and negative signs show a message. The answer is given in words: Yes, 97 is prime; No, 91 is not prime (composite); or, for 0 and 1, neither prime nor composite, since a prime needs exactly two divisors. A composite number also shows its smallest factor (91 = 7 × 13) and, up to 10^12, its full prime factorisation written like 2^12 × 5^12. Above 10^12 only the smallest factor is shown.
Numbers below 1,000,000,000 are checked by trial division: the number is divided by 2, 3, 5, 7, 11, 13 and so on up to its square root. Larger numbers use the Miller-Rabin test with the 13 witnesses 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37 and 41. That set is proven to give the correct answer for every number below 3.317 × 10^24, far above the 10^15 limit, so the result is a certainty, not a probability. It uses BigInt for the modular arithmetic.
The page walks down and up from your number, testing each candidate, and shows the nearest prime on each side: for 91 these are 89 and 97. For 2 the previous prime is None, since no prime is smaller. The next prime can be above 10^15 (the next prime after 10^15 is 1,000,000,000,000,037). Near 10^15 the gap between primes is typically a few dozen numbers.
The limit of 10^15 keeps every number exactly representable in the browser. Paste a number with or without commas: 1,000,000,007 and 1000000007 give the same answer. For a composite number the page shows the smallest factor, and up to 10^12 the full prime factorisation, so 360 reads 2^3 × 3^2 × 5. Everything runs in this tab, and nothing you type is stored or sent anywhere.
No. A prime has exactly two divisors, 1 and itself, and 1 has only one. The page calls 1 neither prime nor composite, and says the same of 0.
It runs the Miller-Rabin test with 13 fixed witnesses. For numbers below 3.317 × 10^24 this set is proven to be right every time, so 999,999,999,999,989, the largest prime below 10^15, is confirmed exactly rather than guessed.
10^15, which is 1,000,000,000,000,000. The full prime factorisation of a composite number is shown up to 10^12; above that you still get the verdict, the smallest factor, and the previous and next prime.
The smallest prime factor is the quickest proof that a number is not prime: 91 = 7 × 13. The complete list of prime factors (2^3 × 3^2 × 5 for 360) is shown for numbers up to 10^12.
Yes. The next prime after 10^15 is 1,000,000,000,000,037, and the page shows it, because the test is exact far beyond the input limit.
Yes. 2 is the only even prime. Its previous prime is shown as None and its next prime is 3.