Free online tools

GCF and LCM Calculator

Enter whole numbers to get their greatest common factor, also called GCD or HCF, and their least common multiple. The result uses exact integers.

Enter your values

Enter 2 to 16 integers with up to 80 digits each, separated by commas, spaces, semicolons or new lines. Do not add grouping commas within numbers.

This tool processes your input in your browser.

Result

Find the largest factor they share

The GCF divides every number without leaving a remainder. For 18 and 24, the Euclidean algorithm repeats division with the previous remainder. The remainders are 18 and 6, then zero, so the GCF is 6. Combining that 6 with 30 leaves the same GCF.

Find the smallest positive shared multiple

For nonzero integers a and b, divide the magnitude of a by their GCF, then multiply by the magnitude of b. For 18 and 24 that gives 72. Combine 72 with the next number, 30, and the LCM of all three is 360. This is useful for scheduling repeating cycles or finding a common denominator.

Know how negatives and zero are handled

The tool uses the magnitudes of negative entries. A zero leaves the GCF of other nonzero entries unchanged. For an LCM containing any zero or a GCF containing only zeros, the tool follows the convention that the result is zero, as used by Python’s math library.

Frequently asked questions

Is HCF the same as GCF?

Yes. Highest common factor, greatest common factor and greatest common divisor are different names for the same result.

Can I type decimal values?

Use integers only. For example, 6 and 8 have a GCF of 2 and LCM of 24. A decimal point or scientific notation is rejected.

Are very large answers rounded?

No. The browser uses arbitrary-length integer arithmetic for the supported input sizes and displays all the digits.