Calculator Place
Ad

LCM & HCF Calculator

Find the Least Common Multiple (LCM) and Highest Common Factor (HCF/GCD) of two or more numbers. Uses prime factorisation and the Euclidean algorithm with step-by-step working.

Ad

What Is a LCM & HCF Calculator?

The LCM and HCF calculator finds two fundamental properties of any set of whole numbers. The Highest Common Factor (HCF), also called the Greatest Common Divisor (GCD), is the largest number that divides evenly into all given numbers. The Least Common Multiple (LCM) is the smallest number that all given numbers divide into evenly. Together, they are the building blocks of number theory and appear throughout mathematics.

The Euclidean algorithm, first described by the Greek mathematician Euclid around 300 BC, is the most efficient method for computing the HCF. It works by repeatedly replacing the larger number with the remainder of dividing the two numbers until the remainder is zero. The last non-zero remainder is the HCF. This ancient algorithm is still used in modern computing for cryptography, simplifying fractions, and solving Diophantine equations.

Practical applications are everywhere. Adding fractions requires the LCM of the denominators to find a common denominator. Scheduling problems use LCM — if bus A comes every 12 minutes and bus B every 18 minutes, they coincide every LCM(12, 18) = 36 minutes. The HCF simplifies ratios and fractions to their lowest terms. Engineers use HCF to determine the largest tile that fits evenly into a room, and LCM to synchronise gear rotations.

How Do You Use This LCM & HCF Calculator?

Enter two or more numbers separated by commas. Click Calculate to find both the LCM and HCF. The results include the prime factorisation of each number and the step-by-step working using the Euclidean algorithm.

  1. Enter two or more whole numbers separated by commas in the input field.
  2. Click Calculate to find the HCF and LCM.
  3. Review the prime factorisation of each number shown in the working.
  4. Read the HCF — the product of the lowest powers of all common prime factors.
  5. Read the LCM — the product of the highest powers of all prime factors present.
  6. Verify the result using the relationship: LCM × HCF = product of the two numbers.

How Does the LCM & HCF Calculator Formula Work?

The formula used: HCF by Euclidean algorithm: HCF(a,b) = HCF(b, a mod b) until remainder = 0; LCM(a,b) = |a × b| / HCF(a,b)

The Euclidean algorithm finds the HCF by repeated division. Divide the larger number by the smaller, take the remainder, and repeat until the remainder is zero. The last non-zero remainder is the HCF.

HCF(a, b) = HCF(b, a mod b), stopping when a mod b = 0
LCM(a, b) = |a × b| / HCF(a, b)

Alternatively, use prime factorisation. The HCF is the product of the shared prime factors raised to their lowest powers. The LCM is the product of all prime factors raised to their highest powers. For example, 12 = 2² × 3 and 18 = 2 × 3². HCF = 2¹ × 3¹ = 6. LCM = 2² × 3² = 36.

What Are Some Example Calculations?

For 12 and 18: 12 = 2² × 3, 18 = 2 × 3². HCF = 2 × 3 = 6. LCM = 2² × 3² = 36. Check: 12 × 18 = 216 = 6 × 36.

Find the HCF and LCM of 48 and 180 using the Euclidean algorithm

180 = 3 × 48 + 36 → HCF(180,48) = HCF(48,36). 48 = 1 × 36 + 12 → HCF(48,36) = HCF(36,12). 36 = 3 × 12 + 0 → HCF = 12. LCM = (48 × 180) / 12 = 720.

HCF(48, 180) = 12. LCM(48, 180) = 720.

Find the HCF and LCM of 24, 36, and 60

HCF(24,36) = 12. HCF(12,60) = 12. So HCF(24,36,60) = 12. LCM(24,36) = 72. LCM(72,60) = 360. So LCM(24,36,60) = 360.

HCF = 12. LCM = 360.

Add fractions 5/12 + 7/18 using LCM

LCM(12,18) = 36. Convert: 5/12 = 15/36, 7/18 = 14/36. Sum = 29/36.

5/12 + 7/18 = 29/36. The LCM provides the common denominator.

Ad

When Should You Use a LCM & HCF Calculator?

Use the LCM and HCF calculator whenever you work with divisibility, fractions, or scheduling. Adding or subtracting fractions with different denominators requires the LCM to find the lowest common denominator. Simplifying fractions to their lowest terms requires the HCF to divide both the numerator and denominator. These operations are foundational in algebra, arithmetic, and number theory.

In real-world contexts, LCM solves synchronisation problems. Two traffic lights cycling at different intervals, two machines producing at different rates, or two musical notes creating harmony all depend on LCM. HCF solves partitioning problems: the largest square tile that evenly covers a rectangular floor, the largest group size that divides a class evenly, or the highest denomination that divides several amounts without remainder.

What Do These Terms Mean?

Highest Common Factor (HCF/GCD)
The largest positive integer that divides each of the given numbers without a remainder.
Least Common Multiple (LCM)
The smallest positive integer that is divisible by each of the given numbers.
Euclidean Algorithm
An efficient method for computing HCF by repeatedly replacing the larger number with the remainder of the division.
Prime Factorisation
Expressing a number as a product of prime numbers. For example, 60 = 2² × 3 × 5.
Co-prime (Relatively Prime)
Two numbers are co-prime if their HCF is 1, meaning they share no common factor other than 1.

What Are the Best Tips to Know?

  • Use the identity LCM(a,b) × HCF(a,b) = a × b as a quick check for two numbers.
  • For three or more numbers, compute HCF and LCM pairwise — HCF(a,b,c) = HCF(HCF(a,b), c).
  • The HCF of any number and 1 is always 1; the LCM of any number and 1 is the number itself.
  • Co-prime numbers (HCF = 1) have an LCM equal to their product — e.g., LCM(7,9) = 63.
  • Prime factorisation is easier to visualise, but the Euclidean algorithm is faster for large numbers.

What Mistakes Should You Avoid?

  • Confusing LCM and HCF — HCF is always less than or equal to the smaller number; LCM is always greater than or equal to the larger number.
  • Forgetting to apply the Euclidean algorithm iteratively — you must continue until the remainder is zero.
  • Taking the highest powers for HCF instead of the lowest — highest powers give the LCM, lowest give the HCF.
  • Assuming LCM(a,b) = a × b, which is only true when a and b are co-prime (HCF = 1).

Frequently Asked Questions

What is the difference between HCF and GCD?

They are the same thing. HCF (Highest Common Factor) is the term used in British mathematics, while GCD (Greatest Common Divisor) is more common in American usage. Both refer to the largest number that divides all given numbers.

How does the Euclidean algorithm work?

Divide the larger number by the smaller, note the remainder. Replace the larger number with the smaller, and the smaller with the remainder. Repeat until the remainder is 0. The last non-zero remainder is the HCF.

Can LCM be smaller than HCF?

No. The LCM is always greater than or equal to the HCF. The LCM equals the HCF only when all input numbers are the same. For distinct numbers, LCM is always larger.

How do I find LCM and HCF of three numbers?

Compute pairwise. HCF(a,b,c) = HCF(HCF(a,b), c). LCM(a,b,c) = LCM(LCM(a,b), c). This extends to any number of inputs.

Why is LCM useful for adding fractions?

To add fractions with different denominators, you need a common denominator. The LCM of the denominators is the smallest such denominator, keeping the numbers manageable.

What if one number is a multiple of the other?

If a is a multiple of b, then HCF(a,b) = b and LCM(a,b) = a. For example, HCF(12,4) = 4 and LCM(12,4) = 12.

Is HCF × LCM always equal to the product of the two numbers?

Yes, for exactly two numbers: HCF(a,b) × LCM(a,b) = a × b. This identity does not hold for three or more numbers without adjustment.

More Maths & Conversion Calculators