Prime Number Checker
Test whether a whole number is prime. A prime has exactly two positive divisors: 1 and itself. 2 is the only even prime. 0 and 1 are not prime. A composite number has a smaller factor, which this page reports when the answer is “not prime.”
Prime Number Checker tool
About the Prime Number Checker
The checker uses trial division up to the square root (6k ± 1 after testing 2 and 3). Inputs run from 0 through 1,000,000,000,000. It checks one integer; it does not list primes in a range or prove primality certificates.
For every divisor and the prime factorization, use the factor calculator. Factorial n! is a different operation on the scientific calculator.
How the Prime Number Checker works
If n < 2, it is not prime. If n is 2 or 3, it is prime. Otherwise test divisibility by 2, 3, then 5, 7, 11, 13… up to √n. The first divisor found is the smallest factor greater than 1.
n is prime ⇔ n > 1 and no integer d with 1 < d ≤ √n divides n
Example
97 is prime (the default). 91 = 7 × 13 is not; the smallest factor is 7.
How to Use the Prime Number Checker
- Enter a whole number from 0 through 1,000,000,000,000.
- Read Prime or Not prime.
- If it is composite, read the smallest factor greater than 1.
- Open the factor calculator to list every divisor or see p^a × q^b.
- Remember 1 is not prime and not composite in this definition.
Prime Number Checker Examples
A prime
97 has no divisor in 2…9, so it is prime. Divisors are only 1 and 97.
A composite
91 is 7 × 13. The checker reports not prime and factor 7.
Even numbers
Any even n > 2 is composite; the smallest factor is 2.
One
1 is not prime. It has a single positive divisor, which fails the two-divisor definition.
How to Check a Prime Number by Hand
Reject 0 and 1. If n is even and greater than 2, it is not prime. If the digit sum is divisible by 3, n is divisible by 3. Then test 5, 7, 11… up to the square root. You never need to test past √n because any larger factor has a matching smaller partner. That is the same loop the calculator runs. For 97, √97 ≈ 9.8, so testing 2, 3, 5, 7 is enough.
Prime versus composite versus 1
Every integer greater than 1 is either prime or composite. 1 is neither. That classification matters in unique factorization: every integer n > 1 writes as a product of primes in one way (order aside). The factor calculator prints that product. This checker only answers the yes/no used in “prime number checker” searches.
Worked checks
The table matches what the tool returns. 91 fools people because it is not even and does not look like a multiple of 5; 7 × 13 is the usual miss. 121 is 11². 1 and 0 fail before any trial division.
| n | Prime? | Smallest factor > 1 |
|---|---|---|
| 0 | No | — |
| 1 | No | 1 (only divisor) |
| 2 | Yes | — |
| 97 | Yes | — |
| 91 | No | 7 |
| 121 | No | 11 |
What this page does not do
It does not generate RSA keys, test probable primes with Miller–Rabin, or search a range. Large-integer cryptography is outside the 1e12 cap and outside this site. For homework and contest warm-ups, trial division through the square root is the honest method and the one documented in the result panel.
Frequently Asked Questions
Is 1 a prime number?
No. Prime numbers have exactly two distinct positive divisors. 1 has one.
Is 2 prime?
Yes. It is the only even prime.
Are negative numbers prime?
This checker only accepts whole numbers ≥ 0. Primality is defined for positive integers.
Does this list primes between two numbers?
No. It tests one integer. Generating a prime table is not a feature of this page.
What is the smallest factor it shows?
The least divisor greater than 1 when n is composite. For primes that field is omitted.
Is this a factorization tool?
It only needs one factor to prove compositeness. Use the factor calculator for the complete list and the prime factorization.
Guides that use this calculator
- How to Find Factors of a Number
Factors come in pairs up to the square root. Here is the list for 84, prime factorization, and the free factor calculator — not factorial n!.
- How to Check a Prime Number
Prime means exactly two positive divisors. Here is the square-root test, why 1 is not prime, and the free prime number checker.