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.

Enter 2 to 6 positive whole numbers Works best with numbers up to 10,000
Find:
Examples:

What Are HCF and LCM?

HCF
Highest Common Factor
Also called GCD

The largest number that divides all the given numbers exactly (with no remainder).

HCF(12, 18) = 6
LCM
Least Common Multiple
Smallest shared multiple

The smallest number that is a multiple of all the given numbers.

LCM(12, 18) = 36

The Golden Relationship (for 2 numbers)

HCF(a, b) × LCM(a, b) = a × b
Example: HCF(12, 18) × LCM(12, 18) = 6 × 36 = 12 × 18 = 216 ✓

H Finding HCF — Prime Factorization

1.Write each number as a product of primes.
2.Find primes that appear in ALL numbers.
3.Take the lowest power of each common prime.
4.Multiply them → HCF.

L Finding LCM — Prime Factorization

1.Write each number as a product of primes.
2.Collect ALL unique primes across all numbers.
3.Take the highest power of each prime.
4.Multiply them → LCM.

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)

HCF(12, 18) & LCM(12, 18)
Sharing ribbon into equal pieces
Classic
12 = 2² × 3  |  18 = 2 × 3²
HCF = 2 × 3 = 6  (lowest powers of 2,3)
LCM = 2² × 3² = 36  (highest powers)
HCF(16, 24) & LCM(16, 24)
Power of 2 numbers
Powers of 2
16 = 2⁴  |  24 = 2³ × 3
HCF = 2³ = 8
LCM = 2⁴ × 3 = 48
HCF(100, 150)
Dividing money equally
Money
100 = 2² × 5²  |  150 = 2 × 3 × 5²
HCF = 2 × 5² = 50
₹100 and ₹150 can each be split into ₹50 notes
HCF(7, 11)
Two prime numbers
Co-prime
7 and 11 are both prime numbers
HCF = 1 (they share no common factor)
LCM = 7 × 11 = 77

Intermediate — Three Numbers (Class 7–8)

HCF(15, 25, 35)
Three multiples of 5
3 Numbers
15 = 3×5  |  25 = 5²  |  35 = 5×7
HCF = 5 (only 5 is common to all)
LCM = 3 × 5² × 7 = 525
LCM(3, 4, 6)
Three bells — when do they ring together?
Bells
Bells ring every 3, 4, 6 minutes
3 = 3  |  4 = 2²  |  6 = 2 × 3
LCM = 2² × 3 = 12
All three bells ring together after 12 minutes!

Real-World Applications

Bus Timing Problem

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?

LCM(6, 8) = ?   6 = 2 × 3  |  8 = 2³
LCM = 2³ × 3 = 24 minutes
Next together departure: 8:24 AM
Floor Tiling Problem

A rectangular floor is 60 cm × 90 cm. What is the largest square tile that fits perfectly without cutting?

60 = 2² × 3 × 5  |  90 = 2 × 3² × 5
HCF(60, 90) = 2 × 3 × 5 = 30 cm
Use 30 cm × 30 cm tiles → 2 × 3 = 6 tiles needed

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.

Related Calculators