# Prime Number Checker - Is It Prime? Factorisation, Next Prime and a List of Primes

Page: https://hirantha.me/tools/prime-number-checker
Part of: Hirantha Sandaruwan Lakshan free tools (https://hirantha.me/tools)
Updated: 2026-10-13

Check whether a number is prime, up to 2^64, see its prime factors and the previous and next prime, and list every prime up to 100,000.

This is a free tool that runs in the browser: open the page to use it. File tools process files on the visitor's own device; files are never uploaded or stored. No account, sign-up, payment or watermark.

Type a whole number to find out whether it is prime. You get the verdict, the full prime factorisation, the number of divisors and the nearest primes on each side. A second box lists every prime up to 100,000 that you can copy. The test is exact for any number below 2^64 (18,446,744,073,709,551,615), and it all runs in your browser.

A prime is a whole number greater than 1 whose only positive divisors are 1 and itself, so 2, 3, 5, 7 and 11 are prime. 1 is not prime, because it has only one divisor, and 0 is neither prime nor composite. 2 is the only even prime, because every larger even number is also divisible by 2. A number greater than 1 that is not prime is called composite.

To test a number the page uses the Miller-Rabin test with the first twelve primes (2 to 37) as bases. This version is deterministic: it is known to give no wrong answer for any number below 318,665,857,834,031,151,167,461, which is far above the 2^64 limit used here. So a Yes or No from this page is a proof and not a probability. By hand, you only need to try dividing by the primes up to the square root of the number.

Every whole number greater than 1 is a product of primes in exactly one way, apart from the order (the fundamental theorem of arithmetic). The page finds the factors by dividing out the primes below 10,000 and then using Pollard's rho method on what is left. If a number is p^a × q^b × ..., it has (a + 1)(b + 1)... divisors, so 360 = 2^3 × 3^2 × 5 has 4 × 3 × 2 = 24 divisors.

The list of primes uses the sieve of Eratosthenes: cross out the multiples of each prime and what remains is prime. There are 25 primes up to 100, 168 up to 1,000, 1,229 up to 10,000 and 9,592 up to 100,000.

The primes up to 500, in blocks of 50:
| Range | Primes | How many | Total so far |
| --- | --- | --- | --- |
| 1 to 50 | 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 | 15 | 15 |
| 51 to 100 | 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 | 10 | 25 |
| 101 to 150 | 101, 103, 107, 109, 113, 127, 131, 137, 139, 149 | 10 | 35 |
| 151 to 200 | 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199 | 11 | 46 |
| 201 to 250 | 211, 223, 227, 229, 233, 239, 241 | 7 | 53 |
| 251 to 300 | 251, 257, 263, 269, 271, 277, 281, 283, 293 | 9 | 62 |
| 301 to 350 | 307, 311, 313, 317, 331, 337, 347, 349 | 8 | 70 |
| 351 to 400 | 353, 359, 367, 373, 379, 383, 389, 397 | 8 | 78 |
| 401 to 450 | 401, 409, 419, 421, 431, 433, 439, 443, 449 | 9 | 87 |
| 451 to 500 | 457, 461, 463, 467, 479, 487, 491, 499 | 8 | 95 |

Q: Is 1 a prime number?
A: No. A prime must have exactly two divisors, and 1 has only one. Leaving 1 out also keeps the fundamental theorem of arithmetic true: if 1 were prime, 6 = 2 × 3 = 1 × 2 × 3 would have more than one factorisation.

Q: Is 2 a prime number, and is it the only even prime?
A: Yes to both. 2 has only the divisors 1 and 2. Every other even number is divisible by 2 as well as by 1 and itself, so it is composite.

Q: How can I check if a number is prime by hand?
A: Divide it by each prime up to its square root. If none divides it exactly, it is prime. To test 97 you only try 2, 3, 5 and 7, because 11 × 11 = 121 is already bigger than 97. None of them divides 97, so it is prime.

Q: How many prime numbers are there below 100?
A: There are 25: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97.

Q: Is there a biggest prime?
A: No. Euclid showed over two thousand years ago that there are infinitely many primes. This tool stops at 2^64 - 1 so that every answer stays exact and quick, but there is always a larger prime beyond any limit.

Q: What are twin primes?
A: Twin primes are two primes that differ by 2, such as 11 and 13 or 2027 and 2029. When the number you check is a prime with a twin, the page tells you.

Q: Why does the tool refuse numbers above 2^64 - 1?
A: Factorising an arbitrary number that large can take far too long in a browser tab, and this page promises exact answers and not guesses. It stops at one clear limit, 18,446,744,073,709,551,615, instead of taking minutes or freezing.

Sources: Euclid's Elements, Book IX, Proposition 20: there are infinitely many primes (https://mathcs.clarku.edu/~djoyce/elements/bookIX/propIX20.html); Prime number - Wikipedia: definition, 1 and 2, the fundamental theorem of arithmetic (https://en.wikipedia.org/wiki/Prime_number); Miller-Rabin primality test - Wikipedia: the deterministic bases and their bounds (https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test); Carmichael number - Wikipedia: 561 = 3 × 11 × 17 is the smallest (https://en.wikipedia.org/wiki/Carmichael_number); The Prime Pages: why 1 is not prime (https://t5k.org/notes/faq/one.html); Prime-counting function - Wikipedia: how many primes up to 10, 100, 1,000 and more (https://en.wikipedia.org/wiki/Prime-counting_function); Pollard's rho algorithm - Wikipedia (https://en.wikipedia.org/wiki/Pollard%27s_rho_algorithm)

Related tools:

- [GCD and LCM calculator](https://hirantha.me/tools/gcd-lcm-calculator.md): Find the greatest common divisor and least common multiple of two or more whole numbers, with the Euclidean steps and prime factors shown.
- [Fraction calculator](https://hirantha.me/tools/fraction-calculator.md): Add, subtract, multiply and divide fractions and mixed numbers, with the working shown, the answer in lowest terms and as a decimal.
- [Number base converter](https://hirantha.me/tools/number-base-converter.md): Convert whole numbers between binary, octal, decimal, hex and any base from 2 to 36 with exact BigInt maths, negatives, two's complement and step-by-step working.
- [Roman numeral converter](https://hirantha.me/tools/roman-numeral-converter.md): Convert numbers 1 to 3999 to Roman numerals and back, find out why forms like IIII, VX and IC are not standard, and write any date in Roman numerals.
- [Random number generator](https://hirantha.me/tools/random-number-generator.md): Pick random whole numbers or decimals in any range, with or without repeats, drawn fairly from your browser's secure random number generator.
