How to break a number into its prime factors

Every whole number bigger than 1 is either prime, or a product of primes — and there is only one such product for it. Finding it is called factorising, and almost everything else on this site is a shortcut for doing it faster.

The rule

Divide by prime numbers, smallest first, until nothing is left but 1. The primes you divided by are the number's prime factors, and no other set of primes will do.

How to do it

  1. Try the smallest prime, 2. If it divides, divide and write the answer down.
  2. Try the same prime again on the answer. A prime can go in more than once.
  3. When it stops dividing, move up to the next prime — 3, then 5, 7, 11, 13.
  4. Stop when the answer is 1. Multiply the primes back together to check.

Worked examples

What are the prime factors of 60? (factor tree)

60 6 2 3 10 2 5

Every branch ends on a prime, so 60 = 2 × 3 × 2 × 5 — that is 2 × 2 × 3 × 5.

What are the prime factors of 84? (division ladder)

84 2
42 2
21 3
7 7
1

84 = 2 × 2 × 3 × 7.

What are the prime factors of 29?

2 ✗ 3 ✗ 5 ✗ and the next prime, 7, has 7 × 7 past 29

Nothing divides it, so 29 is prime and is its own answer.

Two ways to write the same work

A factor tree splits the number into any two factors, splits those, and keeps going until every branch ends on a prime. There is no single right shape: 36 can start as 4 × 9 or as 6 × 6, and both finish with 2 × 2 × 3 × 3. That is the point of it — the route is yours, the destination is not.

A division ladder is the same work set out as a column: the number to the left of a rule, the prime you divided by to the right, the answer on the next line down. It is tidier, and it keeps the primes in one place where you can read them off.

Which one a child recognises depends on where they went to school. Brazil, Portugal and Spain write the ladder with the divisors on the right and run it down to 1; China, Japan and the United States draw the mirror image, divisors on the left, and stop one line earlier when the answer is already prime. Same arithmetic, three habits.

Why there is only one answer

However you break the number up, you land on the same primes. 36 as 4 × 9 becomes 2 × 2 × 3 × 3; 36 as 6 × 6 becomes 2 × 3 × 2 × 3. Same four primes, different order. Mathematicians call this the fundamental theorem of arithmetic, and it is the reason the answer can be checked.

That uniqueness is what makes prime factors worth finding. They are a fingerprint: two numbers share a divisor exactly when they share a prime. Both the highest common factor and the lowest common multiple are read straight off it.

Where mistakes happen

Questions people ask

Which prime should I try first?

2, then 3, 5, 7, 11, 13. Working upwards means you never have to go back, and the small primes are the ones with quick divisibility rules.

How do I know when to stop trying primes?

When the prime you are testing, multiplied by itself, is bigger than what is left. If nothing up to that point divided it, what is left is prime.

Is 1 a prime number?

No, and the one-answer rule is why. If 1 counted, every number would have endlessly many factorisations: 6 = 2 × 3 = 1 × 2 × 3 = 1 × 1 × 2 × 3, and so on.

What are prime factors actually used for?

Simplifying fractions, and finding the highest common factor and lowest common multiple of a pair. Both are read off the primes two numbers share.

Is it factorising or factorizing?

The same thing. British spelling uses an s, American a z, and you will meet prime factorisation and prime factorization in the same search results.

Related