Skip to content
Instant results No sign-up Private — stays on your device Free

LCM and HCF (GCD) Calculator

Find the Lowest Common Multiple (LCM) and Highest Common Factor (HCF / GCD) of two or more numbers instantly.

E.g. 12, 18, 24
LCM

Enter whole numbers separated by commas or spaces.

What Are LCM and HCF?

The HCF (Highest Common Factor), also called the GCD or greatest common divisor, is the largest number that divides two or more numbers exactly, leaving no remainder. The LCM (Lowest Common Multiple) is the smallest number that is a multiple of all those numbers at once. Together they are core ideas in arithmetic, used everywhere from simplifying fractions to scheduling repeating events.

For instance, the HCF of 12 and 18 is 6, the biggest number dividing both, while their LCM is 36, the first number both 12 and 18 fit into evenly. HCF is useful for splitting things into equal groups, and LCM helps when two cycles must line up, such as buses arriving together or fractions sharing a common denominator. This calculator finds both for any list of numbers you enter.

How LCM and HCF Are Calculated

There are two standard approaches.

1. Euclid algorithm for HCF. Repeatedly replace the larger number with the remainder of the larger divided by the smaller until the remainder is zero; the last non-zero divisor is the HCF. Once you have the HCF of two numbers, the LCM follows from:

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

For three or more numbers, extend step by step: compute the HCF or LCM of the first two, then combine that result with the next number, and so on.

2. Prime factorisation. Break each number into prime factors. The HCF is the product of the common primes raised to their lowest powers; the LCM is the product of all primes raised to their highest powers. Both methods give the same answer, and the calculator uses the faster Euclid approach internally.

Worked Example

Find the HCF and LCM of 12, 18 and 24.

Prime factors: 12 = 2² × 3, 18 = 2 × 3², 24 = 2³ × 3.

HCF uses the lowest power of each common prime: 2 appears at least once in all (lowest power 2¹), 3 appears at least once in all (lowest power 3¹). So HCF = 2 × 3 = 6.

LCM uses the highest power of every prime present: 2³ from 24 and 3² from 18, giving LCM = 8 × 9 = 72.

You can verify with the formula approach: HCF(12, 18) = 6 and LCM(12, 18) = (12 × 18) ÷ 6 = 36; then LCM(36, 24) = (36 × 24) ÷ HCF(36, 24) = 864 ÷ 12 = 72. Both routes confirm HCF 6 and LCM 72.

Where LCM and HCF Are Used

These two quantities show up in many everyday and exam problems:

  • Adding fractions. The LCM of the denominators is the lowest common denominator, making fractions easy to add or compare.
  • Simplifying fractions. Dividing numerator and denominator by their HCF reduces a fraction to its lowest terms.
  • Scheduling. If one event repeats every 12 days and another every 18, they coincide every LCM = 36 days.
  • Equal grouping. The HCF tells you the largest equal group size, such as the biggest identical bundles you can make from items of different counts.

A useful check for two numbers: HCF × LCM always equals the product of the two numbers, so HCF(12, 18) × LCM(12, 18) = 6 × 36 = 216 = 12 × 18.

Frequently Asked Questions

The HCF is the largest number that divides all the given numbers exactly, while the LCM is the smallest number that all of them divide into. HCF is always less than or equal to the smallest input, and LCM is always greater than or equal to the largest input.

Yes. HCF (Highest Common Factor), GCD (Greatest Common Divisor) and GCF (Greatest Common Factor) are three names for exactly the same thing: the largest number that divides the given numbers without leaving a remainder.

For two numbers use LCM = (a × b) ÷ HCF. For example, with a = 12 and b = 18, HCF is 6, so LCM = (12 × 18) ÷ 6 = 36. For more numbers, combine two at a time.

Yes. It extends the method across the whole list, computing the running HCF and LCM step by step. Enter as many numbers as you like, separated by commas or spaces, and it returns the HCF and LCM of the full set.

If two numbers share no common factor other than 1, they are coprime, so their HCF is 1 and their LCM is simply their product. For example, 8 and 9 have HCF 1 and LCM 72.

For any two numbers, HCF × LCM = a × b. This holds because the HCF collects the shared prime powers and the LCM collects the highest prime powers, so multiplying them recreates every prime factor of both numbers exactly once.

Related Calculators & Converters




Disclaimer : The results provided by these calculators are for informational purposes only and should not be considered as financial, medical, or professional advice. The accuracy of the calculations depends on the information entered, and actual results may vary. We recommend consulting a financial advisor or healthcare professional for personalized guidance.