Prime Number Checker
Check whether a number is prime.
Loading tool…
About this tool
Enter a whole number to find out if it is prime. 97 is prime, but 91 is not because 7 × 13 = 91, and 1 is never prime.
How to use
1
Step 1
Enter a whole number.
2
Step 2
Press Calculate.
3
Step 3
Read whether it is prime and, if not, a factor that proves it.
How it works
A prime has exactly two divisors, 1 and itself. The checker tests divisors up to the square root of n, since any factor above that pairs with one below it. 2 is the only even prime.
n is prime if no integer d with 2 ≤ d ≤ √n divides n
Worked example
A number that looks prime
- Input
- n = 91
- Output
- Not prime
- Walkthrough
- 91 is odd and not divisible by 3 or 5, but 91 ÷ 7 = 13, so 91 = 7 × 13.
Limitations
- Whole numbers from 0 up to 9,007,199,254,740,991 (2^53 − 1). Larger values are refused.
- Decimals and negative numbers are rejected.
Questions
Is 97 a prime number?
Yes. 97 has no divisor between 2 and 9.
Is 91 a prime number?
No. 91 = 7 × 13.
Is 1 a prime number?
No. A prime needs exactly two divisors, and 1 has only one.
Is 1,000,000,007 prime?
Yes. It is a well-known prime used in programming contests.
Features
- Instant for large numbers
- Square-root trial division
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Introduction to scientific notation
Khan Academy
Scientific notation for calculator and number tools.
Watch on YouTubeVectors | Essence of linear algebra
3Blue1Brown
Linear algebra intuition for matrix and vector tools.
Watch on YouTube
- Pre-algebra
Khan Academy
Number sense practice that supports general calculator use.
- Euler's Number (e)
Math is Fun
e for exponential and scientific calculator keys.