science tinker

Prime factors, HCF and LCM calculator

Type a number to break it into prime factors with a factor tree and see all its factors. Then type two or more numbers to find their highest common factor (HCF) and lowest common multiple (LCM), with a Venn diagram of the primes.

Prime factorisation

HCF and LCM

What is a prime number?

A prime number has exactly two factors: 1 and itself. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. 1 is not prime, and 2 is the only even prime. Every whole number bigger than 1 can be written as a product of primes in exactly one way: this is the fundamental theorem of arithmetic.

Making a factor tree

Split the number into any two factors, then keep splitting until every branch ends in a prime. Circle the primes. However you split it, you always end with the same primes: 360 = 2³ × 3² × 5.

HCF and LCM from prime factors

Write each number as a product of primes. The HCF uses each shared prime to its lowest power; the LCM uses every prime to its highest power. In a Venn diagram, the HCF is the product of the overlap and the LCM is the product of everything. Use HCFs to simplify fractions in the fraction calculator.

Questions students ask

What is the HCF of two numbers?

The highest common factor (HCF), also called the greatest common factor (GCF), is the largest whole number that divides exactly into both numbers. The HCF of 84 and 120 is 12.

What is the LCM of two numbers?

The lowest common multiple (LCM) is the smallest number that both numbers divide into exactly. The LCM of 84 and 120 is 840.

Is 1 a prime number?

No. A prime number must have exactly two different factors, and 1 has only one.

Check yourself

3 quick questions. Tap an answer to see if you are right.

1. What is 60 as a product of primes?

2. What is the HCF of 12 and 18?

3. What is the LCM of 4 and 6?

More math tools

Know someone who needs this?

It’s free for every student. Send it to your class group chat.

Updated · Free, no sign-up ·

Connected tools

The same idea from another angle, across the site.