Prime Number Checker

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. This calculator checks whether a given positive integer is prime or composite. If the number is composite, it displays the smallest factor, which helps identify why it is not prime. For example, 17 is prime because no number other than 1 and 17 divides it evenly. In contrast, 18 is composite because it is divisible by 2 (the smallest factor). The algorithm checks divisibility only up to the square root of the number being tested, making it efficient for large numbers. Prime numbers are fundamental in mathematics and have practical applications in cryptography, computer security, and number theory. The calculator also provides a reference list of all prime numbers up to 1,000, helping you identify and understand the distribution of primes.

Any positive integer
17 is prime
No factors other than 1 and 17

How to check for primality

To check if n is prime:
Test divisibility by all integers from 2 to sqrt(n).
If no divisors found, n is prime.
If a divisor is found, n is composite.

Prime numbers from 2 to 1,000

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997

Prime number checker: frequently asked questions

What is a prime number?

A prime number is a natural number greater than 1 that has exactly two distinct positive divisors: 1 and itself. For example, 7 is prime because only 1 and 7 divide it. By definition, 1 is not prime.

What is a composite number?

A composite number is a positive integer greater than 1 that has at least one positive divisor other than 1 and itself. For example, 12 is composite because it is divisible by 1, 2, 3, 4, 6, and 12.

How do you check if a number is prime?

To check if a number n is prime, test whether any number from 2 to the square root of n divides it evenly. If no divisors are found, the number is prime. This works because if n has a factor greater than its square root, it must also have a factor less than its square root.

What is the smallest prime number?

The smallest prime number is 2. It is also the only even prime number. All other prime numbers are odd, because even numbers greater than 2 are divisible by 2.

How many primes are there?

There are infinitely many prime numbers. This was proven by the ancient Greek mathematician Euclid around 300 BCE. As numbers get larger, primes become rarer but never stop occurring.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 14 June 2026. See our methodology.