Prime Number Calculator

Check if a number is prime, find its prime factors, or get a list of prime numbers up to a limit.

What Is a Prime Number?

Definition

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.

First 20 Primes

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71

Quick Rules

  • 2 is the only even prime number.
  • 1 is not a prime number.
  • All primes > 2 are odd.
  • All primes > 3 end in 1, 3, 7, or 9.

Related Calculators

Why Prime Numbers Matter

Primes are the building blocks of all integers — every whole number greater than 1 is either prime itself or can be uniquely expressed as a product of primes (the Fundamental Theorem of Arithmetic). This makes them critical to cryptography: RSA encryption, which secures most internet traffic (HTTPS), relies on the fact that multiplying two large primes is easy but factoring the product back into primes is computationally infeasible. A modern RSA key uses primes with 1,024 to 4,096 bits.

Primes also appear in nature (cicada life cycles of 13 or 17 years are prime, helping them avoid predators on shorter cycles) and in hash table design in computer science.

How to Check if a Number is Prime

The most efficient basic method: check if the number is divisible by any integer from 2 up to its square root. If no divisor is found, the number is prime. You only need to check up to √n because if n = a × b and both a and b are greater than √n, their product would exceed n.

NumberPrime?Reason
97YesNo divisors up to √97 ≈ 9.8
91No91 = 7 × 13
2YesOnly even prime
1NoBy definition (1 has only one factor)

Properties of Prime Numbers in Mathematics

A prime number is a natural number greater than 1 that has exactly two distinct positive divisors: 1 and itself. Numbers with more than two divisors are called composite. The number 1 is neither prime nor composite by convention. The first several primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29. Two is the only even prime; all other even numbers are divisible by 2 and therefore composite. The fundamental theorem of arithmetic states that every integer greater than 1 is either prime itself or can be expressed as a unique product of prime numbers (up to the order of multiplication). This prime factorization is the foundation of many areas of mathematics and computer science. The Sieve of Eratosthenes is a classical algorithm for finding all primes up to a limit: list all integers from 2 to the limit, then repeatedly mark multiples of each prime as composite and move to the next unmarked number. Checking whether a large number is prime uses primality tests like Miller-Rabin or AKS, which modern cryptographic systems rely on because the difficulty of factoring large numbers into primes underlies RSA encryption security.

Prime Number Reference Table

RangePrimesCount
1–102, 3, 5, 74
11–2011, 13, 17, 194
21–3023, 292
31–5031, 37, 41, 43, 475
51–10053, 59, 61, 67, 71, 73, 79, 83, 89, 9710
Have Feedback or a Suggestion? Contact Us
Top