What Are LCM and HCF? The Basics Explained

In number theory, LCM stands for Least Common Multiple — the smallest positive integer that is divisible by each of the given numbers. HCF stands for Highest Common Factor — the largest positive integer that divides each of the given numbers without leaving a remainder. HCF is also called GCD (Greatest Common Divisor) or GCF (Greatest Common Factor) — all three terms refer to the same value.

For example, take the numbers 12 and 18. The factors of 12 are {1, 2, 3, 4, 6, 12}; the factors of 18 are {1, 2, 3, 6, 9, 18}. The largest factor they share is 6 — so HCF(12, 18) = 6. The multiples of 12 are {12, 24, 36, 48…}; multiples of 18 are {18, 36, 54…}. The smallest multiple they share is 36 — so LCM(12, 18) = 36.

Core LCM & HCF Definitions
HCF(a, b) × LCM(a, b) = a × b
HCF / GCD / GCF — the largest number that divides each input exactly
LCM — the smallest positive number that each input divides exactly
Co-prime numbers — numbers with HCF = 1 (e.g., 8 and 9)
Identity (2 numbers only) — HCF × LCM equals the product of the two inputs
Note — this identity does NOT hold for three or more numbers

LCM and HCF Formula and Tricks

The most important LCM and HCF formula every student should memorise is the product identity:

HCF(a, b) × LCM(a, b) = a × b

This identity is the single fastest shortcut in LCM-HCF problems. If you know any three of the four values (a, b, HCF, LCM), you can find the fourth instantly.

Trick 1 — Find LCM from HCF: If the HCF of two numbers is known, LCM = (a × b) / HCF. This is much faster than listing multiples.

Trick 2 — Find HCF from LCM: HCF = (a × b) / LCM. Useful when an exam question gives you the LCM and asks for the HCF.

Trick 3 — Co-prime check: Two numbers are co-prime if HCF = 1, which means LCM = a × b directly. Examples: (8, 9), (7, 15), (11, 13).

Trick 4 — Fractions: For two fractions, HCF = HCF(numerators) / LCM(denominators), and LCM = LCM(numerators) / HCF(denominators). Useful in advanced problems.

Lcm Vs Hcf Difference Explained

How to Find LCM and HCF Using Prime Factorization

The prime factorization method is the most reliable way to find LCM and HCF — it works for any number of inputs and never produces rounding errors.

Three methods to find LCM and HCF compared: prime factorization, long division method, and Euclid's algorithm with worked example

Step-by-Step Prime Factorization Example — LCM & HCF of 12 and 18

  1. Write each number as a product of prime factors: 12 = 2² × 3 and 18 = 2 × 3².
  2. For HCF, take each prime factor that appears in every number, raised to the lowest exponent.
  3. Common primes: 2 and 3. Lowest exponents: 2¹ and 3¹. So HCF = 2 × 3 = 6.
  4. For LCM, take every prime that appears in any number, raised to the highest exponent.
  5. Primes: 2 and 3. Highest exponents: 2² and 3². So LCM = 4 × 9 = 36.
  6. Verify: HCF × LCM = 6 × 36 = 216, and a × b = 12 × 18 = 216. Both equal — verified.

How to Find LCM and HCF Using the Division Method

The long-division method (sometimes called the cake or ladder method) is the second most common method in Indian/CBSE textbooks. It works directly on the list of numbers without explicit prime factorization.

LCM by Division Method — Worked Example

Find the LCM of 12, 18, and 24 using the division method:

  1. Write all numbers in a row. Divide by the smallest prime that divides at least one number (start with 2).
  2. 2 | 12, 18, 24 → 6, 9, 12. (9 wasn’t divisible; carry it down.)
  3. 2 | 6, 9, 12 → 3, 9, 6.
  4. 2 | 3, 9, 6 → 3, 9, 3.
  5. 3 | 3, 9, 3 → 1, 3, 1.
  6. 3 | 1, 3, 1 → 1, 1, 1. Stop.
  7. Multiply all the divisors: 2 × 2 × 2 × 3 × 3 = 72. So LCM(12, 18, 24) = 72.

For HCF using the division method, divide only by primes that divide every number until no common prime remains. The product of those divisors is the HCF. For (12, 18, 24): 2 divides all (carry 6, 9, 12), 3 divides all (carry 2, 3, 4). No further common prime. HCF = 2 × 3 = 6.

HCF by Euclid’s Division Algorithm

Euclid’s algorithm is the fastest method for finding the HCF of two numbers. It is based on a simple principle: HCF(a, b) = HCF(b, a mod b). Keep replacing the larger number with the remainder until the remainder becomes 0. The last non-zero divisor is the HCF.

HCF(510, 92): 510 = 92 × 5 + 50 → 92 = 50 × 1 + 42 → 50 = 42 × 1 + 8 → 42 = 8 × 5 + 2 → 8 = 2 × 4 + 0. HCF = 2.

This is exactly how our calculator computes HCF internally — using a tight while-loop that replaces (a, b) with (b, a mod b) until b reaches zero. It runs in O(log min(a,b)) time and handles numbers up to 9 digits effortlessly.

Prime Factorization Method Steps

LCM and HCF Relationship — Why LCM × HCF = Product

The relationship LCM(a, b) × HCF(a, b) = a × b is one of the most beautiful identities in elementary number theory. Here is why it works, in plain terms:

  • Every common factor between a and b is “counted once” in the HCF.
  • Everything else — the unique prime powers in a and b — is captured in the LCM.
  • Together, HCF × LCM reconstructs every prime power exactly the way they appear in a × b.

Important — for 3 or more numbers, this identity does NOT hold. For example, take 4, 6, and 8: HCF = 2, LCM = 24, HCF × LCM = 48. But the product 4 × 6 × 8 = 192. The identity is exclusive to two-number inputs and is the foundation of countless textbook verification questions.

LCM & HCF of 510 and 92 — Fully Solved

This is one of the most-searched LCM & HCF questions from the NCERT Class 10 textbook (Real Numbers chapter). Solving it step by step:

  1. Prime factorize: 510 = 2 × 3 × 5 × 17; 92 = 2² × 23.
  2. HCF — common prime with lowest exponent: only 2 is common, lowest power 2¹. HCF = 2.
  3. LCM — all primes with highest exponent: 2², 3, 5, 17, 23. LCM = 4 × 3 × 5 × 17 × 23 = 23,460.
  4. Verify: HCF × LCM = 2 × 23,460 = 46,920. Product = 510 × 92 = 46,920. Verified.

LCM & HCF of 336 and 54 — Fully Solved

Another classic NCERT Class 10 example. Solving step by step:

  1. Prime factorize: 336 = 2⁴ × 3 × 7; 54 = 2 × 3³.
  2. HCF — common primes 2 and 3 at lowest powers: 2¹ × 3¹ = HCF = 6.
  3. LCM — all primes at highest powers: 2⁴ × 3³ × 7 = 16 × 27 × 7 = 3,024.
  4. Verify: HCF × LCM = 6 × 3,024 = 18,144. Product = 336 × 54 = 18,144. Verified.

LCM & HCF Word Problems with Solutions

Word problems are where LCM and HCF become genuinely useful in everyday life. Use this simple rule of thumb:

  • Use HCF when the question asks for the largest equal group, biggest size, or maximum divisor (e.g., “largest tape that measures…”).
  • Use LCM when the question asks for the smallest common interval, when events meet again, or the smallest divisible quantity (e.g., “all bells ring together…”).

Word Problem 1 — Bell-Ringing (LCM)

Three bells ring at intervals of 4, 6, and 8 seconds. If they ring together at 12:00 PM, when will they ring together again? Solution: Find LCM(4, 6, 8). Prime factors: 2², 2 × 3, 2³. LCM = 2³ × 3 = 24. They ring together every 24 seconds, so next at 12:00:24 PM.

Word Problem 2 — Longest Measuring Tape (HCF)

The length, breadth, and height of a room are 6 m 80 cm, 5 m 10 cm, and 3 m 40 cm. Find the longest tape that can measure all three dimensions exactly. Solution: Convert to cm: 680, 510, 340. Find HCF(680, 510, 340) = 170 cm. The longest tape is 1 m 70 cm.

Word Problem 3 — Equal Packing (HCF)

210 oranges, 252 apples, and 294 pears are packed in cartons such that each carton has the same number of one type of fruit and no fruit is left over. What is the biggest possible number of cartons? Solution: Find HCF(210, 252, 294). Prime factors: 2×3×5×7, 2²×3²×7, 2×3×7². HCF = 2×3×7 = 42. So the answer is 42 cartons of each fruit type (5 of oranges, 6 of apples, 7 of pears).

Word Problem 4 — Smallest Divisible Number (LCM)

Find the smallest number which when increased by 23 is exactly divisible by 32, 36, 48, and 96. Solution: Find LCM(32, 36, 48, 96) = 288. The smallest number is 288 − 23 = 265.

LCM & HCF Questions for Class 6 (with Answers)

These questions follow the Class 6 CBSE / NCERT chapter on Playing with Numbers and are great for daily practice:

  • Q1. Find the LCM of 9 and 12. (LCM = 36)
  • Q2. Find the HCF of 24 and 36. (HCF = 12)
  • Q3. Find the LCM and HCF of 15 and 25, and verify LCM × HCF = product. (HCF = 5, LCM = 75, both products = 375)
  • Q4. Two numbers are 18 and 30. Find their LCM and HCF. (HCF = 6, LCM = 90)
  • Q5. Find the smallest number which is divisible by 8, 9, and 10. (LCM = 360)
  • Q6. Mary has dance class every 2nd day and painting every 3rd day. On which day will she have both? (LCM(2, 3) = 6th day)
  • Q7. What is the HCF of two co-prime numbers, e.g., 15 and 28? (HCF = 1)
  • Q8. Find the LCM of three numbers 12, 18, and 24 using the division method. (LCM = 72)

Type any of these into the calculator above to see the full step-by-step working — perfect for self-checking practice answers or building a complete LCM & HCF worksheet.

Difference Between LCM and HCF

Students often confuse LCM and HCF. The key distinction:

  • HCF is always ≤ the smallest input. It is the “biggest divisor” — it cannot exceed the smallest number.
  • LCM is always ≥ the largest input. It is the “smallest multiple” — it cannot be smaller than the largest number.
  • HCF answers “What divides all of them?” — useful for grouping, splitting, and simplification.
  • LCM answers “What do they all divide?” — useful for cycles, schedules, and fraction denominators.

When to Use This LCM & HCF Calculator

This tool is built for:

  • Students (Class 4 to Class 10) — verifying NCERT / CBSE textbook answers and seeing the prime-factorization working.
  • Competitive exam prep — SSC, banking, GMAT/GRE quant, and aptitude rounds frequently use the LCM × HCF identity.
  • Teachers — generating worked examples and worksheets with verified answers.
  • Programmers — checking expected outputs for GCD/LCM functions during algorithm practice.
  • Real-world scheduling — aligning task cycles, work shifts, or interval-based events.
Educational Note: This LCM & HCF calculator uses Euclid’s division algorithm and prime factorization with integer arithmetic for mathematically exact results. All calculations happen in your browser — nothing is uploaded or stored. Results are valid for any 2 to 10 positive whole numbers up to 9 digits each.