Prime Factorization: Factor Trees, Division Ladders and Divisibility Rules

Break any number into prime factors using factor trees or the ladder method, with divisibility shortcuts and examples of using primes to find the GCF and LCM.

A young boy writing complex formulas on a chalkboard
Photo by Vitaly Gariev on Unsplash
Try the GCF Calculator – Enter two or more whole numbers to get their greatest common factor, least common multiple, prime factorizations and the Euclidean algorithm worked out.

Every whole number greater than 1 is either prime or can be written as a product of primes in exactly one way, apart from the order. This is called the fundamental theorem of arithmetic, and it makes prime factorization a kind of fingerprint for numbers. Once you have it, finding common factors becomes straightforward.

Primes worth knowing

A prime has exactly two factors: 1 and itself. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47. The number 1 is not prime, and 2 is the only even prime.

Divisibility rules

Divisible byRuleExample
2Last digit is even548
3Sum of digits divisible by 3471 (4+7+1 = 12)
5Ends in 0 or 5235
7Double the last digit, subtract from the rest; result divisible by 7343 (34 − 6 = 28)
9Sum of digits divisible by 9729 (7+2+9 = 18)
11Alternating sum of digits divisible by 112,343 (2−3+4−3 = 0)

Method 1: factor tree

Split the number into any two factors, then keep splitting until every branch ends in a prime.

360 → 36 × 10 → (6 × 6) × (2 × 5) → (2 × 3) × (2 × 3) × 2 × 5

Collecting the primes: 360 = 2³ × 3² × 5. A different first split, such as 360 = 8 × 45, gives the same final answer.

Method 2: ladder (repeated division)

Divide by the smallest prime that works, write the quotient underneath, and repeat.

  • 588 ÷ 2 = 294
  • 294 ÷ 2 = 147
  • 147 ÷ 3 = 49
  • 49 ÷ 7 = 7
  • 7 ÷ 7 = 1

So 588 = 2² × 3 × 7².

When to stop testing

You only need to test primes up to the square root of the number. To check whether 97 is prime, test 2, 3, 5 and 7 (since 11² = 121 is already bigger than 97). None divide it, so 97 is prime.

Using factorizations for GCF and LCM

With 360 = 2³ × 3² × 5 and 588 = 2² × 3 × 7²:

  • GCF: shared primes at their lowest power: 2² × 3 = 12.
  • LCM: all primes at their highest power: 2³ × 3² × 5 × 7² = 17,640.

The GCF calculator shows each number's prime factorization alongside the result, using the notation 2^3 for 2³.

Counting factors

Add 1 to each exponent and multiply. 360 = 2³ × 3² × 5¹ has (3+1)(2+1)(1+1) = 24 factors. Numbers with many factors, like 360, are why it was chosen for degrees in a circle: it divides evenly in so many ways.

Other uses

Further reading from official sources

More gcf guides

A student writing formulas on a chalkboardGCF vs. LCM: What's the Difference and When to Use EachThe greatest common factor and least common multiple are easy to confuse. Learn what each one means, how they're related, and which one a word problem needs.3 min readA man standing in front of a chalkboard covered in equationsThe Euclidean Algorithm: The Fastest Way to Find the GCFHow Euclid's division method finds the greatest common factor of large numbers in a few steps, why it works, and how to extend it to three or more numbers.3 min readA person writing with a pencilSimplifying Fractions with the GCF (Including Mixed Numbers and Algebra)Reduce any fraction to lowest terms in one step using the greatest common factor, with examples for improper fractions, mixed numbers and algebraic fractions.2 min read