Find the greatest common divisor (HCF) and least common multiple of 2 to 20 whole numbers, with Euclid steps and prime factors.
Type between 2 and 20 whole numbers separated by commas, spaces, semicolons or new lines. Each must be 1 or more and can have up to 18 digits, so 999999999999999989 is fine. Zero, negative numbers, decimals and thousands commas are not accepted (1,000 would be read as 1 and 000, and the zero is refused). A message under the box says which rule was broken without repeating your text. GCD is the term in US and Canadian schools; HCF, highest common factor, is the same number and the usual term in the UK, India, Australia and New Zealand, which is why both appear.
The GCD comes from Euclid's method: divide the larger number by the smaller, replace the larger by the smaller and the smaller by the remainder, and stop when the remainder is 0. For 48 and 180: 180 = 3 × 48 + 36, then 48 = 1 × 36 + 12, then 36 = 3 × 12 + 0, so the GCD is 12. The LCM is a × b ÷ GCD, so 48 × 180 ÷ 12 = 720. With two numbers the page lists the Euclid steps (up to 40; the answer is complete even if a very long case is cut short). With more numbers it works left to right, two at a time, and shows the chain.
The LCM can be far larger than the numbers it comes from: two coprime 18-digit numbers have an LCM of 36 digits. The page uses BigInt, so every digit is exact. A browser without BigInt gets a message instead of a rounded number.
Each number up to 10^12 (1,000,000,000,000) is also broken into prime factors by trial division, written as 2^4 × 3 for 48. The number 1 is shown as having no prime factors. Numbers above 10^12 are skipped and a note says so; the GCD and LCM are still exact for them. Nothing you type is stored or sent anywhere.
None. Greatest common divisor, greatest common factor and highest common factor are three names for the same number: the largest whole number that divides all of yours. For 48 and 180 it is 12.
Take two at a time: lcm(48, 180) = 720, then lcm(720, 300) = 3600. The page does this left to right for up to 20 numbers and shows the chain of intermediate results.
It is 1, and the LCM is their product. For 7 and 13 the GCD is 1 and the LCM is 91. Coprime means they share no prime factor.
The page works with positive whole numbers only. Zero has every number as a divisor, which makes the GCD and LCM ambiguous, so it is refused with a message. Use the absolute value for a negative number.
Factorising by trial division is instant up to 10^12 but not beyond, so larger numbers are skipped and a note says so. The GCD and LCM above are still exact because Euclid's method does not need the factors.
Up to 18 digits each, and 2 to 20 numbers. The LCM of 20 such numbers can have hundreds of digits and is still exact.