HCF and LCM Calculator
Calculate Highest Common Factor (HCF / GCD) and Least Common Multiple (LCM) for multiple numbers with prime factorization.
Working
Euclidean algorithm:
HCF(24, 36) = 12
Prime factorisation:
24 = 2^3 × 3
36 = 2^2 × 3^2
Check: HCF × LCM = 12 × 72 = 864 = 24 × 36
HCF and LCM Calculator: how it works
The Euclidean algorithm finds the highest common factor in a handful of steps, and the LCM follows from it directly.
The Euclidean algorithm
Repeatedly replace the larger number with the remainder of dividing it by the smaller. When the remainder reaches zero, the last non-zero value is the HCF.
Worked example · HCF of 24 and 36
Given
- a = 36, b = 24
Working
- 136 ÷ 24 = 1 remainder 12
- 224 ÷ 12 = 2 remainder 0
- 3Last non-zero remainder is 12
HCF(24, 36) = 12
LCM from HCF
LCM(a, b) = (a × b) ÷ HCF(a, b)
- Valid for two numbers only
Worked example · LCM of 24 and 36
Given
- HCF = 12
Working
- 1LCM = (24 × 36) ÷ 12
- 2= 864 ÷ 12
LCM(24, 36) = 72
Prime factorisation
The alternative method: express each number as a product of primes, then take the lowest power of each shared prime for the HCF and the highest power of every prime for the LCM.
Worked example · Same numbers by factorisation
Given
- 24 = 2³ × 3
- 36 = 2² × 3²
Working
- 1HCF = 2² × 3¹ = 12 (lowest powers)
- 2LCM = 2³ × 3² = 72 (highest powers)
Same answers, different route
Where these appear
- HCF: dividing quantities into the largest equal groups, simplifying fractions.
- LCM: finding when repeating events coincide, adding fractions with unlike denominators.
- Both appear routinely in SSC, banking and railway aptitude papers.
Frequently asked questions
More in Academics & Competitive Exams
KIIT CGPA & Percentage Calculator
Convert semester SGPA to cumulative CGPA and percentage for KIIT University students.
Saveetha CGPA & Percentage Calculator
Calculate SGPA, CGPA, and equivalent percentage according to Saveetha University (SIMATS / SEC) grading scale.
Anna University CGPA & Percentage Calculator
Calculate CGPA, SGPA, and grade percentage under Anna University Regulations (2017, 2021).
VIT CGPA & Grade Calculator
Calculate SGPA, CGPA, and equivalent percentage for VIT Vellore, Chennai, Bhopal & AP campuses.
Attendance Percentage & Bunk Calculator
Calculate current attendance %, required classes to hit 75%/80%/85%, or max classes you can bunk!
UPSC Mark & CSAT Calculator
Compute Prelims Paper-1 (GS) & Paper-2 (CSAT) scores with exact 1/3 negative marking penalties.