Is it prime?
Test any whole number for primality. Composite numbers come with their full prime factorization. BigInt arithmetic keeps large inputs exact.
Input
Primality
—Type a whole number to check whether it's prime.
A free prime number checker that tells you whether any whole number is prime or composite. For composite numbers it shows the full prime factorization. Uses trial division with BigInt arithmetic for exact results on large inputs — all computed locally in your browser with no server calls.
How to check if a number is prime
- Type the number you want to test into the input field.
- The result — prime or composite — appears immediately.
- If composite, the prime factorization is shown (e.g. 60 = 2² × 3 × 5).
Trial division and why it works
To test whether n is prime, you only need to check divisors up to the square root of n. If no integer from 2 to √n divides n evenly, n is prime. For composite n, at least one factor must be at or below √n. Trial division is straightforward and exact — and BigInt ensures no precision is lost for large values, unlike floating-point arithmetic which can give wrong square root estimates.
Frequently asked questions
How do I know if a number is prime?
A number is prime if its only divisors are 1 and itself. This tool tests every candidate divisor up to the square root, which is sufficient to prove primality.
What is prime factorization?
Breaking a composite number down into the prime numbers whose product equals it. For example, 84 = 2² × 3 × 7.
What is the largest number this tool can check?
There is no fixed limit. BigInt arithmetic handles arbitrarily large integers exactly, though very large numbers with many small factors may take a moment.
Is 0 or 1 prime?
No. Zero and one are neither prime nor composite by definition. Primality only applies to integers greater than 1.
Randomly