A prime number is a whole number greater than 1 with exactly two factors: 1 and itself. The first primes are 2, 3, 5, 7, 11 and 13. The number 1 is not prime, and 2 is the only even prime number. Whole numbers greater than 1 that are not prime are composite.
In Spanish
número primo
Also called
prime
Grade level
K-5
Grade 4Grade 5Grade 6CCSS 4.OA.B.4GED
Prime Number in a picture
A number of dots that can form a rectangle with more than one row is composite. Seven dots fit only in a single row, so 7 is prime: its only factors are 1 and 7.
Formal definition and notation
A whole numberp > 1 is prime if its only positive divisors are 1 and p. A whole number n > 1 that is not prime is composite: it can be written as n = a × b with 1 < a ≤ b < n. The number 1 is neither prime nor composite. Every composite number can be written as a product of primes in exactly one way, apart from the order of the factors (the Fundamental Theorem of Arithmetic).
The 15 primes less than 50 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43 and 47.
1 is not prime: it has only one factor. 0 is not prime either, because every nonzero whole number divides 0.
2 is the only even prime. Every other even number has 2 as a factor, so it has at least three factors.
Every whole number greater than 1 is either prime or a product of primes, such as 60 = 22 × 3 × 5.
There are infinitely many primes; a proof appears in Euclid’s Elements.
Prime test: trial division
Prime test: trial division
n is prime if no prime p ≤ √n divides it
n
the whole number greater than 1 that you are testing
p
the primes to try, in order: 2, 3, 5, 7, 11, …
√n
where you can stop: if no prime up to here divides n, then n is prime
Why it works: if n = a × b, the smaller factor is at most √n. For 97, √97 ≈ 9.8, so you only try 2, 3, 5 and 7. None divides 97, so 97 is prime.
Try it: prime checker and factor tree
Interactive
Type any whole number up to 9,999, or tap a sample. The checker lists every factor, says whether the number is prime or composite, and draws a factor tree that ends in primes. Tip: 51, 57 and 91 look prime, but are they?
This interactive needs JavaScript. The worked examples below show the same ideas step by step.
Prime Number examples, step by step
Example 1: Is 29 prime?
Warm-up
Decide whether 29 is prime.
√29 ≈ 5.4, so you only need to test the primes 2, 3 and 5.
29 is odd, so 2 is not a factor.
The digit sum is 2 + 9 = 11, which is not a multiple of 3, so 3 is not a factor.
29 does not end in 0 or 5, so 5 is not a factor.
Answer: 29 is prime: its only factors are 1 and 29.
Example 2: A number that looks prime
Core
Is 91 prime or composite?
√91 ≈ 9.5, so test the primes 2, 3, 5 and 7.
91 is odd (not 2), its digit sum 10 is not a multiple of 3, and it does not end in 0 or 5.
Try 7: 91 ÷ 7 = 13 exactly, so 91 = 7 × 13.
Answer: 91 is composite. Its factors are 1, 7, 13 and 91.
Example 3: Prime factorization
Test-style
Write 360 as a product of prime factors, using exponents.
Divide by 2 while you can: 360 = 2 × 180 = 2 × 2 × 90 = 2 × 2 × 2 × 45.
45 is odd. Divide by 3: 45 = 3 × 15 = 3 × 3 × 5.
Every factor is now prime: 360 = 2 × 2 × 2 × 3 × 3 × 5.
Use exponents for repeated primes: 23 × 32 × 5.
Answer:360 = 23 × 32 × 5
Common mistakes
✗ Mistake1 is prime, because it divides only by 1 and itself.
✓ Instead1 is not prime. It has only one factor, and a prime needs exactly two.
If 1 counted as prime, prime factorizations would stop being unique: 6 = 2 × 3 = 1 × 2 × 3 = 1 × 1 × 2 × 3.
✗ MistakeOdd numbers are prime, so 9, 15 and 21 are prime.
✓ InsteadCheck the factors: 9 = 3 × 3, 15 = 3 × 5, 21 = 3 × 7. All three are composite.
Being odd only rules out the factor 2. An odd number can still have factors such as 3, 5 or 7.
✗ Mistake51 looks prime, so it is prime.
✓ InsteadTest small primes: 5 + 1 = 6 is a multiple of 3, and 51 = 3 × 17.
Numbers such as 51, 57 and 91 fool many students. Testing primes up to the square root settles it every time.
A composite number has more than two factors: 12 has six (1, 2, 3, 4, 6, 12). A prime has exactly two. The numbers 0 and 1 are neither prime nor composite.
A factor of 12 is any whole number that divides it evenly: 1, 2, 3, 4, 6 and 12. Its prime factors are only the primes among them: 2 and 3.
Quick check: 3 questions
Question 1 of 3
Which number is prime?
Show answer and explanation
Answer: B. 31 has only the factors 1 and 31: 2, 3 and 5 do not divide it, and √31 is less than 6. 21 = 3 × 7 and 51 = 3 × 17 are composite, and 1 is neither prime nor composite.
Question 2 of 3
How many prime numbers are between 10 and 20?
Show answer and explanation
Answer: B. The primes between 10 and 20 are 11, 13, 17 and 19. The odd numbers 15 (3 × 5) and the even numbers are composite.
Question 3 of 3
Which is the prime factorization of 84?
Show answer and explanation
Answer: A. Only A uses primes alone: 2 × 2 × 3 × 7 = 84. The other choices multiply to 84 too, but they contain composite numbers (4, 42 and 14).
Prime Number: frequently asked questions
Why is 1 not a prime number?
A prime must have exactly two different factors, 1 and itself. The number 1 has only one factor, so it does not qualify. Leaving 1 out also keeps prime factorization unique: 12 = 2 × 2 × 3 in exactly one way. If 1 were prime, you could tack on as many 1s as you like and get endless different factorizations.
Is 2 a prime number?
Yes. The only factors of 2 are 1 and 2, so it is prime, and it is the smallest prime. It is also the only even prime: every other even number can be divided by 2, so it has at least three factors, 1, 2 and itself, which makes it composite.
How do you check whether a large number is prime?
Divide by the primes in order, 2, 3, 5, 7, 11 and so on, and stop once the prime is bigger than the square root of the number. If none of them divides evenly, the number is prime. For 221, you check primes up to 14: 13 divides it, because 221 = 13 × 17, so 221 is composite.
Whole NumberA whole number is 0 or a positive counting number: 0, 1, 2, 3, and so on. Whole numbers do not include fractions, decimals, or negative numbers, so 12 is a whole number but 8.5, 34 and −3 are not. Every whole number is also an integer.Number System · Grade 3, Grade 4, Grade 5DivisorA divisor is the number you divide by. In 56 ÷ 8 = 7, the divisor is 8: it tells how many equal groups to make, or how big each group is. The divisor can never be 0. A divisor of a whole number is also one of its factors, because it divides that number with no remainder.Operations · Grade 3, Grade 4, Grade 5NumberA number is an amount or value used to count, measure, order and compare. We write numbers with digits (7), words (seven) or other symbols, but the number itself is the amount: 7 dots, the word seven and the numeral 7 all show the same number. Numbers include whole numbers, fractions, decimals and negatives.Number System · Kindergarten, Grade 1, Grade 2Composite NumberA composite number is a whole number greater than 1 that has more than two factors. It can be divided evenly by a number other than 1 and itself: 12 is composite because 1, 2, 3, 4, 6 and 12 all divide it. Every whole number above 1 is either prime or composite; 1 is neither.Number System · Grade 4, Grade 5, Grade 6Prime FactorizationPrime factorization is writing a whole number as a product of prime numbers only, such as 72 = 2 × 2 × 2 × 3 × 3 = 23 × 32. Find it with a factor tree or repeated division. Every whole number greater than 1 has exactly one prime factorization, apart from the order of the factors.Number System · Grade 4, Grade 5, Grade 6PowerA power is a number written as a base with an exponent, such as 53, or the value that results, 53 = 5 × 5 × 5 = 125. We say 125 is the third power of 5, or “5 to the third power”. The second power is called the square and the third power the cube.Number System · Grade 5, Grade 6, Grade 7FactorA factor is a number or expression that divides another number or expression evenly, with no remainder. Factors multiply together to make a product: 4 × 6 = 24, so 4 and 6 are factors of 24. Every whole number greater than 1 has at least two factors, 1 and itself.Number System · Grade 4, Grade 5, Grade 6Even NumberAn even number is an integer that can be divided by 2 with no remainder, so it can be split into two equal groups or into pairs. Even numbers end in 0, 2, 4, 6 or 8, such as 14, 236 and −10. Zero is even. Every even number can be written as 2n for some integer n.Number System · Grade 2, Grade 3, Grade 4ProofA proof is a step-by-step logical argument that shows a math statement is true in every case it covers. It starts from given facts and uses definitions, postulates and statements already proved, with a reason for each step. A statement that has been proved is called a theorem.Geometry · Geometry, Algebra 1ExponentAn exponent tells how many times to use a base as a factor. It is the small raised number to the upper right of the base: in 53, the base is 5 and the exponent is 3, so 53 = 5 × 5 × 5 = 125. Any nonzero number with an exponent of 0 equals 1.Algebra · Grade 6, Grade 7, Grade 8Odd NumberAn odd number is a whole number that cannot be split into two equal groups: dividing it by 2 always leaves a remainder of 1. Odd numbers end in 1, 3, 5, 7 or 9, such as 7, 23 and 409. Every odd number can be written as 2k + 1, one more than a multiple of 2.Number System · Grade 2, Grade 3, Grade 4Square RootA square root of a number is a value that, multiplied by itself, gives that number. The square root of 36 is 6 because 6 × 6 = 36. Every positive number has two square roots, such as 6 and −6, but the radical sign √ means the principal square root, which is the non-negative one.Number System · Grade 8, Algebra 1MultipleA multiple of a number is the result of multiplying that number by any whole number. The multiples of 4 are 4, 8, 12, 16, and so on, continuing without end. Every number is a multiple of itself and of 1. To test a number, divide: if the remainder is 0, it is a multiple.Number System · Grade 4, Grade 5, Grade 6Greatest Common FactorThe greatest common factor (GCF) is the largest factor shared by two or more numbers: the largest number that divides into both without a remainder. The GCF of 18 and 24 is 6. Find it by listing factors or by multiplying the prime factors the numbers share. The GCF is how you simplify fractions in one step.Number System · Grade 5, Grade 6, Grade 7Least Common MultipleThe least common multiple (LCM) is the smallest positive multiple shared by two or more numbers. The LCM of 6 and 9 is 18: it is the first number on both lists of multiples, 6, 12, 18, … and 9, 18, …. The LCM of the denominators is the least common denominator for adding fractions.Number System · Grade 5, Grade 6, Grade 7FactoringFactoring rewrites a number or expression as a product of factors. It is the reverse of multiplying or distributing: 12 = 3 × 4, 6x + 9 = 3(2x + 3) and x2 + 5x + 6 = (x + 2)(x + 3). Factoring changes the form, not the value, so multiplying the factors back gives the original.Algebra · Grade 6, Grade 7, Grade 8Divisibility RulesDivisibility rules are shortcuts that tell whether one whole number divides another with no remainder, without doing the division. A number is divisible by 2 if its last digit is even, by 3 if its digit sum is divisible by 3, by 5 if it ends in 0 or 5, and by 10 if it ends in 0.Number System · Grade 4, Grade 5, Grade 6