A prime number is a natural number greater than 1 that can be divided evenly by itself and by 1.
- The number 1 is neither a prime nor a composite.
- 2 is the only even prime number; every other prime is odd.
There are 25 prime numbers between 1 and 100, as shown in the image below:

Mathematically, a number 'p' is prime if:
- p is a natural number (p ≥ 2).
- p has no divisors other than 1 and p itself. That is, if p can be written as p = a × b, then a = 1 and b = p, or vice versa.
How to Check if a Number Is Prime
Find the number's factors and count them. If it has exactly two, 1 and itself it's prime. If it has more than two, it's not.
Checking every possible factor works fine for small numbers, but it gets slow as numbers grow. For larger numbers, we use a different, more efficient method, which we'll learn further.
Facts
- The smallest prime number is 2. It is unique because it’s the only even prime number.
- There is no largest prime number, as prime numbers continue infinitely.
- There are infinitely many prime numbers. This was proved by Euclid around 300 BC.
- The largest prime number discovered as of 2026 is (2136,279,841 – 1), which has 41,024,320 digits.
- A Prime number is always a natural number i.e., a number greater than 1.
- Every integer greater than 1 can be expressed as a product of prime numbers, and this factorization is unique apart from the order of the factors. This is known as the Fundamental Theorem of Arithmetic.
Related Concepts
- Prime vs Composite
- Types of Primes
- Prime factorization
- Coprime numbers
- How to find prime numbers?
- Finding Prime using Sieve of Eratosthenes
- Algorithm to check for Prime Number
- Applications
- Interesting Facts
Theorems
For Programmers
- Check for Prime Number
- Prime Factor of a Number
- Largest Prime Factor
- Next Prime Number
- Check if Two Numbers are Co-Prime or not
- Check for Strong Prime
- Closest Prime
- Sieve of Eratosthenes
- Nth Prime Number
- Program to print prime numbers from 1 to N.
- Segmented Sieve
Also Check: Prime Numbers Worksheet