Find the Greatest Common Divisor and Least Common Multiple of two or more numbers — with prime factorisation and step-by-step working.
Enter your figures and click Calculate to see your results.
Enter two or more numbers separated by commas — the calculator finds both GCD and LCM with prime factorisation steps.
Press the Calculate button. All results appear instantly — no page reload, no waiting.
Results appear in the panel on the right with all key values clearly labelled. Use Copy to grab the result or Download to save a text file.
The Greatest Common Divisor (GCD), also called HCF (Highest Common Factor), is the largest number that divides all given numbers without remainder. GCD(48, 18) = 6, because 6 is the largest divisor shared by both. It is found using the Euclidean algorithm: GCD(a,b) = GCD(b, a mod b).
The Least Common Multiple (LCM) is the smallest positive integer divisible by all given numbers. LCM(4, 6) = 12 — the smallest number into which both 4 and 6 divide exactly. LCM is essential for finding common denominators when adding or subtracting fractions with different denominators.
For any two positive integers: GCD(a,b) × LCM(a,b) = a × b. Once you know the GCD, you can find the LCM: LCM = (a × b) / GCD. For 12 and 18: GCD = 6, so LCM = (12×18)/6 = 36. This relationship also means GCF × LCM always equals the product of the original numbers.
The Euclidean algorithm repeatedly applies GCD(a,b) = GCD(b, a mod b). For GCD(48,18): GCD(48,18) → GCD(18,12) → GCD(12,6) → GCD(6,0) = 6. It stops when the remainder is 0. This is one of the oldest known algorithms, described by Euclid around 300 BC, and is extremely efficient.
Apply the operation sequentially: GCD(a,b,c) = GCD(GCD(a,b),c). For three numbers 12, 18, 24: GCD(12,18)=6, then GCD(6,24)=6. Similarly for LCM: LCM(12,18)=36, then LCM(36,24)=72. This calculator handles multiple numbers automatically in one step.