Skip to content
Toolspire

Education Tools

LCM and HCF Calculator

LCM and HCF Calculator is part of Toolspire and is ready as soon as this page loads. Type two whole numbers. Zero is rejected because every integer divides zero and the LCM would be undefined in ordinary school use.

Runs in this tabFreeNo account

On this page

What you can do here

Remainder loop, not a factor list

Euclid does not list every divisor. It only keeps replacing a with b and b with a mod b.

LCM from the HCF

Once the HCF is known, the LCM is fixed. The page does not search multiples.

Signs ignored for the size

The factors use absolute values. −12 and 18 still report HCF 6 and LCM 36.

The sequence

How to use the LCM and HCF Calculator

  1. 1

    Type whole numbers

    12.5 is not accepted. If a textbook problem has decimals, scale both numbers to integers first and say so in your working.

  2. 2

    Read HCF as the headline

    The large result is the highest common factor. The LCM is the sentence underneath.

  3. 3

    Check with the product

    For positive integers, HCF × LCM equals the product of the two numbers. 6 × 36 = 12 × 18.

Worth knowing

  • LCM and HCF Calculator on Toolspire: HCF is the Euclidean algorithm: replace the larger number by the remainder until the remainder is 0.
  • LCM is |a| ÷ HCF × |b|, which avoids multiplying the two numbers first and overflowing the school-sized product.
  • 12 and 18 give HCF 6 and LCM 36. That pair is the check on the page.
  • Decimals and zero are rejected. HCF and LCM in this school sense are for non-zero integers.

Why the LCM uses the HCF

Searching multiples is slow and easy to stop too early. Euclid’s loop finds the greatest common divisor with remainders, and the identity LCM(a, b) = |a × b| / HCF(a, b) then gives the least common multiple. Dividing before multiplying keeps the intermediate value smaller. The page stops at two numbers; three numbers need a second pass of the same idea.

FAQ

Questions about LCM and HCF Calculator

Where does LCM and HCF Calculator run?

LCM and HCF Calculator runs in this tab on Toolspire. What you type or drop in is not sent to us and is not stored on a server.

What is the difference between HCF and GCD?

They are the same function. HCF is the school name in India; GCD is the name in most programming libraries. Both mean the greatest positive integer that divides both numbers.

Can I enter three numbers?

Not on this page. Find the HCF of the first pair, then the HCF of that result and the third number. The LCM chains the same way.

Why is zero rejected?

Every non-zero integer divides 0, so the HCF is just the other number, and the LCM is 0 in some definitions. School questions do not use that case, so the page asks for a non-zero integer.

Does order matter?

No. HCF(18, 12) equals HCF(12, 18), and the LCM matches too.

Keep going

Open the full directory

Last updated Report a problem or suggest a feature