
Published: 16 November 2026 · Updated: 16 November 2026
Find the greatest common factor (GCF) and least common multiple (LCM) of any list of whole numbers, with prime factorization and the Euclidean steps shown. It starts with 12, 18 and 30 (GCF 6, LCM 180). Free, no sign-up.
GCD comes from the Euclidean algorithm; LCM follows from GCD. Type your numbers separated by commas and read the GCF, the LCM, every prime factorization and the step-by-step working.
Researched by MixKhazana Team · Last updated 16 November 2026 · Data: standard number-theory methods; Maths is Fun reference pages
The greatest common factor (GCF), also called the greatest common divisor (GCD) or highest common factor (HCF), is the largest whole number that divides every number in your list exactly. The least common multiple (LCM) is the smallest positive number that is a multiple of every number in the list. For 12 and 18, the GCF is 6 and the LCM is 36.
Find the GCF and LCM of 12, 18 and 30:
Try it above: the default numbers give exactly these results.
| Numbers | GCF | LCM |
| 8, 12 | 4 | 24 |
| 12, 18 | 6 | 36 |
| 15, 25 | 5 | 75 |
| 7, 13 | 1 | 91 |
| 24, 36, 60 | 12 | 360 |
The GCF simplifies fractions (divide top and bottom by the GCF) and factors algebra. The LCM adds fractions with different denominators (the least common denominator), schedules repeating events (two buses every 12 and 18 minutes meet every 36 minutes), and aligns gear teeth, flashing lights and any cycles that must coincide. If two numbers share no factor except 1, they are coprime and their LCM is just their product.
Nothing: greatest common factor, greatest common divisor and highest common factor are three names for the same number. GCF is common in US schools, HCF in UK schools, and GCD in university mathematics.
Use the Euclidean algorithm: divide the larger by the smaller, then divide the previous divisor by the remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCF. For 18 and 12: 18 = 12 x 1 + 6, then 12 = 6 x 2 + 0, so the GCF is 6.
Multiply the two numbers and divide by their GCF: LCM(a, b) = a x b / GCF(a, b). For 12 and 18: 216 / 6 = 36. For three or more numbers, chain the pairs.
0. Any multiple of 0 is 0, so the least common multiple of a list containing 0 is 0. The GCF with 0 is the other number: GCD(0, n) = n.
Yes, by absolute value: GCD(-12, 18) = 6 and LCM(-12, 18) = 36. Factors and multiples are defined for the size of the number, so the sign is ignored.
Two numbers whose GCF is 1, such as 7 and 13 or 8 and 15. They share no factor except 1, and their LCM is their product. Consecutive whole numbers are always coprime.
No. GCF and LCM are defined for whole numbers only. If your problem has decimals, multiply through to clear them first (for example 1.2 and 1.8 become 12 and 18), or use the fraction calculator instead.
Each input may have up to 10 digits. The Euclidean algorithm itself is fast for far larger numbers, but the prime-factorization display and the LCM can overflow JavaScript's safe-integer range beyond that, so inputs are capped to keep results exact.
Disclaimer: a study aid for school and everyday mathematics. Results are exact for whole-number inputs within the stated limits.
Card photos: cottonbro studio / Pexels, Pexels licence · Héctor Rodríguez / Wikimedia Commons, CC BY 2.0 · Vyacheslav Argenberg / Wikimedia Commons, CC BY 4.0 · Joost J. Bakker / Wikimedia Commons, CC BY 2.0