Prime Checker
Check whether a number up to one trillion is prime, or list every prime up to 10,000.
How to Use
- Is Prime?: Type a whole number up to one trillion to see whether it is prime. For composite numbers you also get the smallest divisor and the nearest primes.
- List Primes: Enter a limit up to 10,000 to list every prime up to it, then press Copy All.
- Results update in real time as you type.
About Prime Checker
A prime number is a whole number greater than 1 whose only divisors are 1 and itself. The single check uses trial division: it rules out 2 and 3, then tests divisors of the form 6k − 1 and 6k + 1 up to the square root of the number.
The list mode uses the Sieve of Eratosthenes, which crosses out the multiples of each prime in turn. Both methods are exact, and everything runs in your browser.
You may also find our Scientific Calculator and Roman Numeral Converter helpful.
Frequently Asked Questions
What is the largest number I can check?
One trillion (1,000,000,000,000). Up to that size trial division needs at most about 333,000 test pairs, which finishes instantly. Larger inputs get a note instead of a result.
Why does the check only go up to the square root?
If a number n has a factor larger than its square root, it must also have a matching factor smaller than the square root. So if nothing up to the square root divides n, nothing larger can either.
Is 1 a prime number?
No. A prime has exactly two positive divisors, 1 and itself, and 1 has only one. 0 and 1 are neither prime nor composite.
How many primes are there below 1,000 and 10,000?
There are 168 primes below 1,000 and 1,229 below 10,000. You can confirm both in List Primes by setting the limit and reading the primes found count.
Was this tool helpful?
Guide
How to check whether a number is prime and list primes up to N
This tool has two modes. Is Prime? tells you whether a whole number up to one trillion is prime and, if not, shows its smallest divisor and the three nearest primes below and above it. List Primes shows every prime from 2 up to a limit you choose, with a count and a Copy All button. Results update as you type.
The single check uses trial division: it rules out 2 and 3, then tests divisors of the form 6k - 1 and 6k + 1 up to the square root. The list uses the Sieve of Eratosthenes, which crosses out multiples of each prime. Both are exact within their limits.
Step by step
- Choose Is Prime? or List Primes using the two buttons at the top of the tool.
- In Is Prime?, type a number in the Enter a number box. It starts at 17.
- Read the result card: green Prime, or red Not Prime with a line such as Divisible by 89: 8633 = 89 × 97.
- For a composite number, the Nearby primes chips show the closest primes on either side.
- In List Primes, type the limit after List all primes up to (default 50). A primes found count and a scrollable list appear.
- Press Copy All to copy the list as comma-separated values.
When this is useful
- Checking homework on primes and factors.
- Getting a ready list of primes under 100 or 1,000 for a worksheet or quiz.
- Picking a prime size for a hash table or a coding exercise.
- Testing a hunch that a number such as 8633 is prime before trying to factorise it by hand.
Worked example: Is 8633 prime?
You type 8633 and the card turns red: Not Prime, Divisible by 89: 8633 = 89 × 97. Its square root is just under 93, so divisors up to 92 suffice. After 2 and 3, the tool tests pairs 5 and 7, 11 and 13, and so on; on the 15th pair (89 and 91) it finds 8633 = 89 x 97. The Nearby primes chips read 8623, 8627, 8629, 8641, 8647 and 8663. Typing 2027 instead gives a green Prime after 7 pairs, the last being 41 and 43. In List Primes, a limit of 50 gives 15 primes, from 2 to 47.
Tips for better results
- Enter whole numbers only. A decimal such as 7.5 gets a note asking you to remove the decimal part, because only whole numbers can be prime.
- Nearby primes appear only for composite numbers. To find the primes around a prime, check the number next to it.
- Every number up to the one-trillion limit responds instantly; the square root of a trillion is only a million, so the work stays small.
- The list mode stops at 10,000; Copy All gives a comma-separated line ready for notes or code.
Common mistakes
- Entering numbers above one trillion. The tool shows a note instead of a result, because checking much larger numbers by trial division would freeze the page. Use a dedicated number-theory tool for those.
- Typing a limit over 10,000 in List Primes. The tool lists up to 10,000 (1,229 primes) and shows a note that this is the maximum.
- Treating 0 and 1 as composite. The tool explains that they are neither prime nor composite, and that negative numbers are not prime.
- Assuming a big odd number that ends in 1, 3, 7 or 9 is prime. Numbers like 8633 or 221 only look prime; let the tool check.
Your files and privacy
Every check and list is calculated in your browser, and this tool makes no network requests. Nothing you type is saved, and the only thing Copy All does is write the list to your own clipboard.
Frequently asked questions
What is the largest number I can check?
One trillion (1,000,000,000,000). Up to that size trial division needs at most about 333,000 test pairs, which finishes instantly. Larger inputs get a note instead of a result.
Why does the check only go up to the square root?
If a number n has a factor larger than its square root, it must also have a matching factor smaller than the square root. So if nothing up to the square root divides n, nothing larger can either. For 221, checking up to 14 is enough, and 13 x 17 shows it is composite.
Why are only numbers of the form 6k plus or minus 1 tested?
Every whole number is 6k plus 0 to 5. Four of those forms are divisible by 2 or 3, which are ruled out first, so any other prime divisor must be 6k - 1 or 6k + 1. That cuts the work to about a third.
Is 1 a prime number?
No. A prime has exactly two positive divisors, 1 and itself, and 1 has only one. The tool says 1 is neither prime nor composite, and the same for 0.
How many primes are there below 1,000 and 10,000?
There are 168 primes below 1,000 and 1,229 below 10,000. You can confirm both in List Primes by setting the limit and reading the primes found count.
Guide written and last checked against the tool on 2026-10-28 by Dibya Ranjan Sahu. Found something out of date? Tell us.
More Tools
Related Math & Calc
Statistics Calculator
Scientific Calculator
Percentage Calculator
BMI Calculator
You Might Also Like