Prime number guide: definitions, examples and testing
What is a prime number?
A prime number is a positive integer greater than 1 with exactly two positive divisors: 1 and itself. The first ten primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. A composite number is an integer greater than 1 with an additional positive divisor; for example, 221 = 13 × 17.
Are 1, 0 and negative numbers prime?
No. The number 1 has only one positive divisor, so it is neither prime nor composite. Zero and negative integers are also outside these definitions. The number 2 is the only even prime: every larger even integer has 2 as a nontrivial divisor. Odd numbers are not always prime; 9, 15 and 21 are composite.
How to check primality by trial division
For a small integer n greater than 1, try divisors up to and including √n. If n is composite, at least one factor in a factor pair is no greater than √n. For example, to check 97, it is enough to test the primes 2, 3, 5 and 7. None divides 97, so 97 is prime. Checking every divisor becomes slow for very large inputs.
Exact 64-bit testing and large-number precision
This checker first looks for divisors up to 997, then uses Miller–Rabin with bases 2, 325, 9375, 28178, 450775, 9780504 and 1795265022. Together these bases give a deterministic result for positive integers below 2^64. The maximum accepted absolute value is 18446744073709551615. BigInt arithmetic preserves every input digit; values beyond this range are rejected rather than reported as probable primes.
Does the checker give a full prime factorization?
No. A small divisor produces a factor pair, such as 221 = 13 × 17. A composite number with no divisor up to 997 is identified by a failed Miller–Rabin base test, without finding its factors. A factor pair need not contain only primes. Primality testing answers whether a number is prime; full prime factorization is a separate task.
Using the checker for learning and programming
Use the examples to compare prime, composite and neither results, or verify integer test cases while learning number theory. Enter one plain integer at a time and copy the classification with its explanation. Checks run in your browser without sending the entered number for calculation; shared website resources may still load. This tool does not generate cryptographic keys.