HCF and LCM Calculator (GCD and LCM)

Type two or more whole numbers to get their HCF (also called GCD) and LCM, worked out two ways.

HCF (GCD)

6

LCM
72
Numbers used
3
Show working
  1. 12 = 2² × 3
  2. 18 = 2 × 3²
  3. 24 = 2³ × 3
  4. HCF = 2 × 3 = 6
  5. LCM = 2³ × 3² = 72
  6. 18 = 1 × 12 + 6
  7. 12 = 2 × 6 + 0
  8. HCF(12, 18) = 6
  9. 24 = 4 × 6 + 0
  10. HCF(6, 24) = 6

How to use

  1. Type the numbers separated by commas or spaces, e.g. 12, 18, 24.
  2. Read the HCF and LCM.
  3. Follow the steps: prime factorisation first, then Euclid's division lemma.

Good to know

HCF (highest common factor), also called GCD or GCF, is the largest number that divides all of them. LCM (least common multiple) is the smallest number they all divide. Prime factor method: write each number as prime factors; the HCF takes each common prime with its lowest power, the LCM takes every prime with its highest power. 12 = 2² × 3, 18 = 2 × 3², 24 = 2³ × 3: HCF = 2 × 3 = 6, LCM = 2³ × 3² = 72.

Euclid's division lemma (NCERT Class 10, Real Numbers): divide the larger number by the smaller, then divide the divisor by the remainder, and repeat until the remainder is 0. The last divisor is the HCF. It is fast even for very large numbers, which is why computers use it.

For two numbers, HCF × LCM = product of the numbers, so LCM = a × b ÷ HCF. This doesn't hold for three or more numbers. Numbers with HCF 1 are called co-prime, like 8 and 15. LCM is used to add fractions and to find when repeating events coincide, like two bells ringing every 12 and 18 minutes (together every 36 minutes).

Questions

What is the HCF of 12 and 18?

6. Factors of 12: 1, 2, 3, 4, 6, 12; of 18: 1, 2, 3, 6, 9, 18. The largest common one is 6.

What is the LCM of 4, 6 and 8?

24. 4 = 2², 6 = 2 × 3, 8 = 2³; take 2³ × 3 = 24.

Are HCF and GCD the same?

Yes. HCF (highest common factor), GCD (greatest common divisor) and GCF (greatest common factor) all mean the same.

What is the relation between HCF and LCM?

For two numbers a and b: HCF × LCM = a × b. For 12 and 18: 6 × 36 = 216 = 12 × 18.

What is the HCF of two prime numbers?

1, so they are co-prime, and their LCM is their product.

Last updated: