LCM and HCF Calculator
Enter two or more whole numbers to find their HCF (highest common factor, also called GCD) and LCM (lowest common multiple). The working uses the prime factorisation method from your NCERT textbook, so you can copy the steps straight into your notebook.
Enter 2 to 10 whole numbers separated by commas or spaces.
Step-by-step solution
- Step 1 — Prime factorisation:
- 12 = 2² × 3
- 18 = 2 × 3²
- 30 = 2 × 3 × 5
- Step 2 — HCF = product of common primes with the LOWEST power = 2 × 3 = 6
- Step 3 — LCM = product of all primes with the HIGHEST power = 2² × 3² × 5 = 180
How to use the lcm and hcf calculator
- Enter 2 to 10 positive whole numbers separated by commas or spaces, e.g. 12, 18, 30.
- The HCF and LCM appear instantly along with each number’s prime factorisation.
- For two numbers, the calculator also verifies that HCF × LCM = product of the numbers.
Formulas
| HCF | Product of common prime factors with the lowest powers |
|---|---|
| LCM | Product of all prime factors with the highest powers |
| For two numbers | HCF(a, b) × LCM(a, b) = a × bThis does not hold for three or more numbers. |
Solved examples
Example 1: Find the HCF and LCM of 12 and 18.
- 12 = 2² × 3
- 18 = 2 × 3²
- HCF = 2 × 3 = 6
- LCM = 2² × 3² = 36
Answer: HCF 6, LCM 36
Example 2: Find the LCM of 8, 9 and 21.
- 8 = 2³, 9 = 3², 21 = 3 × 7
- LCM = 2³ × 3² × 7
Answer: 504
Example 3: Three bells ring every 12, 15 and 20 minutes. If they ring together at 9:00, when will they ring together next?
- LCM(12, 15, 20) = 2² × 3 × 5 = 60 minutes
Answer: 10:00
When to use HCF and when to use LCM
Use the HCF when you need to split things into the largest equal groups — for example, the longest tape that can measure 84 cm and 120 cm exactly, or the maximum number of students who can share chocolates equally.
Use the LCM when you need the first time things line up again — bells ringing together, traffic lights turning green at the same moment, or the smallest number divisible by several numbers.
Prime factorisation vs. the division method
Prime factorisation writes each number as a product of primes, then compares powers. It works for any count of numbers and is the method used in NCERT Class 10 (Real Numbers). Euclid’s division algorithm finds the HCF of two numbers by repeated division; this calculator uses it internally to verify results, even for very large numbers.
📘 Learn it in your NCERT syllabus
- Class 6 Maths — Playing with Numbers / Prime Time (HCF & LCM)
- Class 10 Maths — Real Numbers (Fundamental Theorem of Arithmetic)
Free chapter notes, flashcards and quizzes on TalentJR CBSE.
🎯 Asked in competitive exams
This topic regularly appears in the quantitative aptitude section of:
- SSC CGL & CHSL
- RRB NTPC & Group D
- IBPS Clerk
- Campus placement aptitude tests
AI resume builder, ATS score check and interview practice.
Frequently asked questions
What is the difference between HCF and GCD?
There is none. HCF (highest common factor) and GCD (greatest common divisor) are two names for the same thing: the largest number that divides all the given numbers exactly.
Is HCF × LCM always equal to the product of the numbers?
Only for two numbers. For three or more numbers the relationship does not hold in general.
What is the HCF of two prime numbers?
The HCF of two different prime numbers is always 1, and their LCM is their product. Numbers whose HCF is 1 are called co-prime.
How do I find the LCM of fractions?
LCM of fractions = LCM of the numerators ÷ HCF of the denominators. HCF of fractions = HCF of the numerators ÷ LCM of the denominators.
How large can the numbers be?
You can enter up to 10 numbers, each up to 1,000,000,000,000 (one lakh crore). Results are computed exactly without rounding.
Related calculators
- Fraction CalculatorAdd, subtract, multiply and divide fractions and mixed numbers.
- Ratio CalculatorSimplify ratios like 12:18 or 1.5:2.25, solve proportions (a:b = c:x) and divide an amount in a given ratio such as 2:3:5.
- Average CalculatorPaste a list of numbers to find the average (mean), sum, count, median, mode and range instantly.
- Percentage CalculatorFree percentage calculator: find X% of Y, what percent one number is of another, percentage increase/decrease and change — with step-by-step working..
Last updated .