LCM & HCF Calculator

Free LCM and HCF (GCD) calculator for two or more numbers. Shows prime factorisation, the division (ladder) method and Euclid steps. Works in your browser.

This calculator finds the least common multiple (LCM) and the highest common factor (HCF, also called GCD or GCF) of two or more whole numbers. It shows the prime factorisation of each number, the division (ladder) method taught in school, and Euclid's algorithm, so students can check their working step by step. Numbers of any length are handled exactly using big-integer arithmetic.

Runs entirely in your browser and works offline. Nothing you enter or upload leaves your device. Free, no sign-up.

Features

How to use LCM & HCF Calculator

  1. Type or paste the numbers, separated by commas, spaces or new lines.
  2. Read the HCF and LCM at the top of the results.
  3. Scroll down for the prime factorisation table, the division method and Euclid's steps.
  4. Copy the answer or the full working to paste into notes.

Frequently asked questions

What is the difference between LCM and HCF?

The HCF (highest common factor) is the largest number that divides every number in the set exactly. The LCM (least common multiple) is the smallest number that every number in the set divides exactly. For 12 and 18 the HCF is 6 and the LCM is 36.

How do you find the HCF and LCM by prime factorisation?

Write each number as a product of prime powers. The HCF multiplies every prime common to all numbers, each raised to its lowest power. The LCM multiplies every prime that appears in any number, each raised to its highest power.

Are HCF, GCD and GCF the same thing?

Yes. Highest common factor (HCF), greatest common divisor (GCD) and greatest common factor (GCF) are three names for the same number. Indian and British textbooks usually say HCF, American ones GCD or GCF.

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

Only for exactly two numbers: HCF(a, b) × LCM(a, b) = a × b. For three or more numbers the rule does not hold in general, for example 2, 4 and 8 have HCF 2 and LCM 8, but their product is 64.

What is Euclid's division algorithm?

Divide the larger number by the smaller, then replace the pair with the smaller number and the remainder, and repeat. When the remainder becomes 0, the last non-zero divisor is the HCF. It is fast even for very large numbers.

What is the HCF of co-prime numbers?

Co-prime (relatively prime) numbers share no prime factor, so their HCF is 1 and their LCM is simply their product. For example 8 and 15 are co-prime: HCF 1, LCM 120.

Related tools

All free tools · This tool as Markdown