Prime Number Checker – Up to 1,000 Digits, Free
Check if a number up to 1,000 digits is prime — instantly and free. See the factorization, nearest primes, trial-division steps and which test proved it.
All 168 Prime Numbers Below 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 |
Every other number below 1,000 is composite: it has at least one divisor other than 1 and itself.
How Many Primes Are There Below Each Power of Ten?
| Up to | Primes, π(x) | Share that are prime |
|---|---|---|
| 10 | 4 | 40% |
| 100 | 25 | 25% |
| 1,000 | 168 | 16.8% |
| 10⁴ | 1,229 | 12.29% |
| 10⁵ | 9,592 | 9.59% |
| 10⁶ | 78,498 | 7.85% |
| 10⁷ | 664,579 | 6.65% |
| 10⁸ | 5,761,455 | 5.76% |
| 10⁹ | 50,847,534 | 5.08% |
| 10¹⁰ | 455,052,511 | 4.55% |
| 10¹² | 37,607,912,018 | 3.76% |
| 10¹⁵ | 29,844,570,422,669 | 2.98% |
π(x) is the prime-counting function: how many primes do not exceed x. The share keeps shrinking — roughly 1 in ln(x) numbers near x is prime — but it never reaches zero, because there are infinitely many primes.
What Is a Prime Number Checker?
A prime number checker determines whether a given integer has no divisors other than 1 and itself. For small numbers this is easy to verify by hand with trial division, but for large numbers — cryptographic key candidates, competition math problems, or numbers with hundreds of digits — trial division becomes computationally infeasible, and a probabilistic or hybrid deterministic test is required instead.
This tool accepts integers up to 1,000 digits and automatically selects the fastest test that still gives a mathematically sound answer: trial division for small numbers, a deterministic Miller-Rabin test for numbers below roughly 3.3 × 10²⁴, and Baillie-PSW for anything larger. It also shows the prime factorization, the nearest primes, and which specific test proved the verdict.
How to Check If a Number Is Prime
- Enter the number Type or paste an integer up to 1,000 digits into the input box. Commas and spaces are ignored automatically.
- Read the verdict The result shows whether the number is prime, composite, or the special case of 1, along with which test produced the answer.
- Check the details Review the factorization, the nearest primes, and number-theoretic properties such as twin prime or Mersenne prime status.
Tips for getting more out of it
- A prime number is an integer greater than 1 whose only divisors are 1 and itself. The sequence begins 2, 3, 5, 7, 11, 13, … and never ends.
- The simplest primality test is trial division: divide N by every integer from 2 up to √N. Stopping at √N is enough, because if N = a × b then the smaller of a and b cannot exceed √N.
- You can rule out most numbers in seconds by hand: even numbers (other than 2), numbers ending in 5, and numbers whose digits sum to a multiple of 3 are all composite. Every prime above 3 has the form 6k − 1 or 6k + 1.
- For big numbers, trial division is hopeless and computers use the Miller-Rabin and Baillie–PSW tests instead. This page runs them, so you can paste a number with up to 1,000 digits and still get an answer in under a second.
- 1 is not prime — the definition requires "greater than 1" — and 2 is the only even prime, because every larger even number is divisible by 2.
Use Cases
Verifying homework or competition math answers
Quickly confirm whether a number identified as prime in a proof or problem set is actually correct, including a full factorization if it is not.
Exploring cryptography concepts
Test large candidate numbers to see how RSA-style primality testing works in practice, and compare trial division against Miller-Rabin/Baillie-PSW on the same input.
Checking special number properties
Find out if a number is a twin prime, Sophie Germain prime, Mersenne prime, or Fermat prime without looking up reference tables by hand.
Programming and algorithm study
Use the trial-division step table to understand exactly how a primality test decides its answer before implementing one yourself.
Glossary
- Trial division
- Testing whether any integer from 2 up to √N divides N. It is a complete proof but becomes too slow for very large numbers.
- Miller-Rabin test
- A test based on properties of square roots of 1 modulo N. With enough witness bases it is deterministic for numbers below about 3.3 × 10²⁴.
- Baillie-PSW test
- A combination of Miller-Rabin and a strong Lucas test used for numbers too large for a deterministic test. No composite number is known to pass it, though no proof exists.
- Probable prime
- A number that has passed a strong primality test like Baillie-PSW without a full deterministic proof — extremely likely to be prime but not mathematically certain.
- Twin prime
- A prime that differs from another prime by exactly 2, such as 11 and 13. Whether infinitely many twin primes exist is an open problem in mathematics.
- Mersenne prime
- A prime of the form 2^p − 1. The largest primes ever discovered are almost always Mersenne primes, found through distributed computing projects like GIMPS.
FAQ
Side Note — Why prime numbers matter
Primes are often called the "atoms of arithmetic." The Fundamental Theorem of Arithmetic says that every integer greater than 1 can be written as a product of primes in exactly one way, so the primes are the irreducible building blocks from which all whole numbers are assembled. That is also why the factorization shown above is unique: 360 is 2³ × 3² × 5 and nothing else.
Testing a huge number is a different problem from factorizing it, and the history of that distinction is worth knowing. Fermat's little theorem gives a fast test, but some composites sneak through it for every base — 561 is the smallest of these Carmichael numbers, and you can try it with the button above. The Miller-Rabin test fixes the loophole by looking at square roots of 1 along the way, and with the first 13 prime bases it becomes a proven, deterministic test for every number below about 3.3 × 10²⁴. Beyond that, this page adds a strong Lucas test to form Baillie–PSW: no composite has ever been found that passes it, though no proof exists yet, which is why very large results are labelled "probable prime."
That asymmetry — easy to test, hard to factorize — is what makes modern cryptography possible. RSA encryption, which still protects HTTPS traffic and digital signatures, multiplies two large primes together to make a public key. Recovering those primes from the product is believed to be computationally infeasible, so the same numbers that are trivial to verify are effectively impossible to take apart. You can see the gap on this page: a 1,000-digit number is judged prime or composite almost instantly, yet a 60-digit product of two 30-digit primes will defeat the factorizer.
Primes also hold some of the oldest unsolved problems in mathematics. Nobody knows whether there are infinitely many twin primes — pairs like 11 and 13, or 1,000,000,000,061 and 1,000,000,000,063 — even though Euclid proved around 300 BCE that the primes themselves never run out. The hunt for record-breaking primes is still going too: volunteers running the GIMPS project search Mersenne numbers of the form 2^p − 1, and the largest prime known to date, found in 2024, is 2¹³⁶²⁷⁹⁸⁴¹ − 1, a number with 41,024,320 digits.