Check whether a whole number from 0 to 1 trillion is prime, meaning it has exactly two positive divisors: 1 and itself. It is useful for number theory homework, puzzles, and checking factor trees. Numbers that are not prime, other than 0 and 1, are called composite.
How to use the Prime Number Checker calculator
- Enter a whole number in Integer (0–1 trillion). Decimals and negative numbers are not accepted.
- Read the verdict: Prime or Not prime.
- If the answer is Not prime and you need the factors, test small primes such as 2, 3, 5, 7, 11 and 13 by hand, or use the GCD Calculator to test a suspected factor.
How the prime number checker calculation works
How the check works
The calculator uses trial division. It tries dividing by 2 and then by every odd number up to the square root of your number. If none divides evenly, the number is prime. Stopping at the square root is enough, because any factor larger than the root must pair with one smaller than it. For a number near 1 trillion, that means testing divisors only up to about 1,000,000.
Trial division gives a definite answer, not a probable one, which is why the input range is capped. Much larger numbers need specialized tests that are beyond a quick web calculator.
Edge cases and quick filters
0 and 1 are not prime. 1 has only one positive divisor, and excluding it keeps prime factorizations unique: every whole number greater than 1 can be written as a product of primes in exactly one way. 2 is the only even prime.
Before reaching for the calculator, you can rule out many numbers by eye. A number ending in 0, 2, 4, 5, 6 or 8 (other than 2 and 5 themselves) is composite. If the digits add up to a multiple of 3, the number is divisible by 3. Numbers like 91, 119 and 221 pass those filters but are still composite, which is where a checker helps.
Worked example
Integer (0–1 trillion): 91
- √91 ≈ 9.54, so test divisors up to 9.
- 91 is odd, so 2 fails. 9 + 1 = 10 is not a multiple of 3, so 3 fails. It does not end in 0 or 5, so 5 fails.
- 91 ÷ 7 = 13 exactly.
- Since 91 = 7 × 13, it has more than two divisors and is not prime.
Result: Not prime
Assumptions and limits
Whole numbers up to 1 trillion; 0 and 1 are not prime.
Formula and worked examples last checked November 20, 2026. Spotted a problem? Report an error.
Frequently asked questions
Is 1 a prime number?
No. A prime must have exactly two distinct positive divisors, and 1 has only one. If 1 counted as prime, numbers would have many prime factorizations, such as 6 = 2 × 3 = 1 × 2 × 3.
Is 2 a prime number?
Yes. Its only divisors are 1 and 2, and it is the only even prime. Every other even number is divisible by 2 and therefore composite.
What are the prime numbers under 50?
There are 15: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43 and 47. Note that 49 = 7 × 7, so it is not on the list.
What is the largest number this checker can test?
It accepts whole numbers up to 1,000,000,000,000. For example, 999,999,999,989 returns Prime. Larger values are rejected because checking them by trial division would take too long in a browser.