HCF & LCM Calculator
Find the Highest Common Factor and Least Common Multiple of up to 6 numbers — with full step-by-step working and two methods.
Step-by-Step Solution
See exactly how the answer is worked out
What Are HCF and LCM?
The largest number that divides all the given numbers exactly (with no remainder).
The smallest number that is a multiple of all the given numbers.
The Golden Relationship (for 2 numbers)
H Finding HCF — Prime Factorization
L Finding LCM — Prime Factorization
Worked Examples
Click Try it on any example to load the numbers into the calculator above and see the full step-by-step solution instantly.
Beginner — Two Numbers (Class 5–6)
Intermediate — Three Numbers (Class 7–8)
Real-World Applications
Bus A departs every 6 minutes and Bus B every 8 minutes. Both depart together at 8:00 AM. When will they next depart together?
A rectangular floor is 60 cm × 90 cm. What is the largest square tile that fits perfectly without cutting?
Frequently Asked Questions
What is HCF (Highest Common Factor)?
HCF (Highest Common Factor), also called GCD (Greatest Common Divisor), is the largest number that divides all the given numbers exactly, leaving no remainder. For example, factors of 12 are {1, 2, 3, 4, 6, 12} and factors of 18 are {1, 2, 3, 6, 9, 18}. The common factors are {1, 2, 3, 6}, so HCF = 6.
What is LCM (Least Common Multiple)?
LCM is the smallest positive number that is exactly divisible by all the given numbers. Multiples of 4: 4, 8, 12, 16, 20… Multiples of 6: 6, 12, 18, 24… The first common multiple is 12, so LCM(4, 6) = 12. It is the "first time" all numbers sync up.
What is the relationship between HCF and LCM?
For any two numbers a and b: HCF(a, b) × LCM(a, b) = a × b. This is very useful — if you know three of the four values, you can find the fourth. Example: HCF(12,18) = 6 and LCM(12,18) = 36. Check: 6 × 36 = 216 = 12 × 18 ✓. Note: this formula only works directly for two numbers; for three or more, apply it pairwise.
What are co-prime numbers?
Two numbers are called co-prime (or relatively prime) when their HCF is 1 — they share no common factor other than 1. For co-prime numbers: LCM = a × b. Example: HCF(7, 11) = 1, so LCM(7, 11) = 7 × 11 = 77. All prime numbers are co-prime to each other.
How does the Euclidean Algorithm find HCF?
The Euclidean Algorithm repeatedly divides the larger number by the smaller, replaces the larger with the smaller, and the smaller with the remainder. It stops when the remainder is 0 — the last non-zero divisor is the HCF. Example for HCF(48, 18): 48 ÷ 18 = 2 rem 12 → 18 ÷ 12 = 1 rem 6 → 12 ÷ 6 = 2 rem 0. HCF = 6.
Can I find HCF and LCM of more than 2 numbers?
Yes! This calculator supports up to 6 numbers. For prime factorization: collect all primes from all numbers, then take min powers (HCF) or max powers (LCM). For the division method: apply pairwise. HCF(a, b, c) = HCF(HCF(a, b), c). LCM works the same way.
When is HCF = one of the numbers?
HCF(a, b) = the smaller number when the smaller number divides the larger exactly. Example: HCF(4, 12) = 4 because 4 divides 12 (12 ÷ 4 = 3 with no remainder). In this case, LCM = the larger number (12), because the larger number is already a multiple of the smaller.