LCM and HCF (GCD) Calculator

Find the LCM and HCF of two or more numbers, with prime factorisation and step-by-step working.

Last updated:

HCF / GCD
—
LCM
—

LCM and HCF calculator

The highest common factor and least common multiple are staples of school maths and competitive exams — and handy in real life when scheduling or cutting materials. This calculator finds both for any list of whole numbers, and shows the prime factorisation of each so you can see exactly how the answer is built.

How to use it

  1. Type two or more whole numbers, separated by commas or spaces.
  2. Read the HCF and LCM, and the prime factors of each number below.

Example

Three traffic lights change every 12, 18 and 30 seconds. They all change together everyLCM = 180 seconds (3 minutes). Cutting ribbons of 12 cm, 18 cm and 30 cm into equal pieces with no waste, the longest piece is the HCF = 6 cm. See any number's factors with theprime number checker, or simplify fractions with thefraction calculator.

Frequently asked questions

What is the difference between HCF and LCM?
The HCF (highest common factor, also called GCD) is the largest number that divides all the given numbers. The LCM (least common multiple) is the smallest number that all of them divide into. For 12 and 18, HCF = 6 and LCM = 36.
How do I find HCF and LCM by prime factorisation?
Write each number as a product of primes. HCF = product of the common primes with the lowest powers; LCM = product of all primes with the highest powers. 12 = 2² × 3 and 18 = 2 × 3², so HCF = 2 × 3 = 6 and LCM = 2² × 3² = 36.
Is HCF × LCM equal to the product of the numbers?
For exactly two numbers, yes: HCF × LCM = a × b (6 × 36 = 12 × 18 = 216). It does not hold for three or more numbers.
Where are LCM and HCF used?
LCM tells you when repeating events line up (two bells ringing every 12 and 18 minutes ring together every 36 minutes). HCF finds the largest equal size you can cut things into without waste.