HCF and LCM calculator (with prime factors)
Enter two or three whole numbers and this calculator gives the highest common factor and lowest common multiple, along with the prime factorisation of each number and which primes are shared. That prime factor working is exactly what GCSE mark schemes reward, so you can copy the method rather than just the answer.
Enter two or three whole numbers
HCF = 12 · LCM = 240
Prime factorisation
- 60 = 2^2 × 3 × 5
- 48 = 2^4 × 3
Common prime factors: 2^2 × 3
Check: HCF × LCM = 12 × 240 = 2880 = 60 × 48
Working
- 60 = 2^2 × 3 × 5
- 48 = 2^4 × 3
- HCF = product of the common primes at their lowest power = 12
- LCM = product of every prime at its highest power = 240
The method behind it
- Write each number in prime factor form, e.g. 60 = 2² × 3 × 5.
- HCF = common primes to the lowest power; LCM = all primes to the highest power.
- Two-number check: HCF × LCM = a × b.
How to use this tool
1. Enter your numbers
Type two whole numbers, or add a third if the question uses three. Values must be positive integers.
2. Read the prime factorisation
Each number is broken into its prime factors in index form. Shared primes give the HCF; all primes at their highest power give the LCM.
3. Check with the product rule
For two numbers, HCF × LCM = the product of the numbers. The tool shows this check so you can spot mistakes instantly.
Frequently asked questions
What is the difference between HCF and LCM?
The highest common factor is the largest number that divides into all of them exactly. The lowest common multiple is the smallest number they all divide into. HCF is always less than or equal to the smallest input; LCM is always at least as big as the largest.
How do you find HCF and LCM using prime factors?
Write each number as a product of primes. For the HCF, multiply the primes common to all, each to the lowest power that appears. For the LCM, multiply every prime that appears, each to the highest power.
How does the Venn diagram method work?
Put the shared prime factors in the overlap and the rest in the outer regions. The overlap multiplied out is the HCF, and everything in the whole diagram multiplied out is the LCM.
Is HCF × LCM always equal to the product of the numbers?
For two numbers, yes: HCF × LCM = a × b. It does not extend to three numbers, so use the prime factor method whenever there are more than two values.
Practise this properly, not just once
A solver gives you the answer; exam marks come from the working. MathsGradeUp pairs exam-board questions with step-by-step feedback and revision notes on the exact topics you keep dropping marks on.