Prime Number Checker
Check whether a number is prime and see its factors.
Is 9973 prime?
Yes
It has exactly two divisors: 1 and itself
Twin prime
No
Palindromic
No
Nearest prime below
9967
Nearest prime above
10007
Trial division by small primes, then a deterministic Miller-Rabin test.
- Primality testing is fast even for huge numbers. Factorising them is not — that asymmetry is what RSA encryption relies on.
What does Prime Number Checker do?
Test any number for primality with an exact deterministic algorithm, and see its prime factorisation when it is composite. It also lists nearby primes and identifies special forms such as twin and Mersenne primes.
How to Use Prime Number Checker
- 1Enter a numberAny positive whole number, however large.
- 2Read the verdictPrime or composite, with the reasoning.
- 3See the factorisationComposite numbers are fully factorised.
Key Features
- Deterministic Miller-Rabin test — exact, not probabilistic, for realistic inputs
- Full prime factorisation with exponents when the number is composite
- Complete divisor list for smaller numbers
- Nearest prime below and above
- Identifies twin, Mersenne, Fermat and palindromic primes
- BigInt arithmetic, so very large numbers are handled exactly
Frequently Asked Questions
Is 1 a prime number?
No. A prime has exactly two distinct positive divisors, and 1 has only one. Excluding it is what makes prime factorisation unique, which the fundamental theorem of arithmetic depends on.
What is the largest prime you can check?
Primality testing works on numbers with hundreds of digits because it uses BigInt arithmetic. Full factorisation is much harder and is practical up to around 10¹⁴ — that difficulty is precisely what RSA encryption relies on.
How does the test work?
Trial division by small primes first, then a deterministic Miller-Rabin test with a fixed witness set proven correct for every value below 3.3 × 10²⁴. That covers anything you can reasonably type in.
What are twin primes?
A pair differing by two, such as 11 and 13, or 17 and 19. Whether infinitely many exist is one of the oldest unsolved problems in mathematics.
All arithmetic runs in your browser, using exact BigInt maths where whole numbers are involved so nothing is lost to floating-point rounding.
Related Tools
Factorial Calculator
Calculate exact factorials, permutations and combinations.
LCM and HCF Calculator
Find the lowest common multiple and highest common factor.
Fibonacci Sequence Generator
Generate Fibonacci numbers and explore the golden ratio.
Square Root Calculator
Find square roots, cube roots and any nth root.