How to use it
- Enter your numbers. Type or paste two or more positive whole numbers, separated by commas (
12, 18, 24) or spaces (12 18 24). There is no limit on how many you add. - Read the results. The GCF, LCM and count of numbers update the moment you stop typing, with no button to press.
- Check the breakdown. The prime factorization table underneath shows each number split into its prime factors, plus how those factors combine into the GCF and LCM.
- Copy or reset. Use Copy results to grab the figures (and the breakdown, if one is shown) as text, Load sample to see an example, or Clear to start over.
Only positive whole numbers count. Decimals, negative numbers, zero and any text that is not a number are skipped, and the small note under the box tells you how many entries were ignored.
LCM and GCF explained
The GCF (greatest common factor), also written HCF (highest common factor) or GCD (greatest common divisor), is the largest number that divides all of your numbers without leaving a remainder. The LCM (least common multiple) is the opposite idea: the smallest number that every one of your values divides into evenly.
To find the GCF this calculator uses the Euclidean algorithm, an ancient and very fast method that keeps replacing the larger number with the remainder of dividing the two until one of them reaches zero; whatever is left is the GCF. The LCM then follows directly from it, because for any two numbers LCM(a, b) = a × b ÷ GCF(a, b). With three or more numbers the tool carries each result forward, combining one number at a time across the whole set: GCF(a, b, c) is GCF(GCF(a, b), c), and LCM(a, b, c) works the same way.
The breakdown table shows a second way to reach the same answer: prime factorization. Every whole number above 1 is built from prime numbers multiplied together (its prime factors), and once you have that for each number, the GCF and LCM fall out directly. The GCF takes the lowest power of every prime that shows up inall of the numbers. The LCM takes the highest power of every prime that shows up inany of them.
A worked example
Take 12, 18, 24. For the GCF, the Euclidean algorithm gives GCF(12, 18) = 6, and then GCF(6, 24) = 6, so the greatest common factor is 6. For the LCM, LCM(12, 18) = 12 × 18 ÷ 6 = 36, and then LCM(36, 24) = 36 × 24 ÷ 12 = 72, so the least common multiple is 72. In other words 6 is the biggest number that divides 12, 18 and 24, while 72 is the smallest number all three divide into cleanly.
The same set through prime factorization: 12 = 2^2 x 3, 18 = 2 x 3^2 and24 = 2^3 x 3. The prime 2 shows up as 2^1, 2^1 and 2^3, so its lowest power is 2^1; the prime 3 shows up as 3^1, 3^2 and 3^1, so its lowest power is also 3^1. Multiplying those lowest powers together givesGCF = 2 x 3 = 6, matching the Euclidean result. For the LCM, take the highest power of each prime instead: 2^3 (from 24) and 3^2 (from 18), so LCM = 2^3 x 3^2 = 72, again matching.
Frequently asked questions
Are GCF, HCF and GCD the same thing?
Yes. Greatest common factor, highest common factor and greatest common divisor all describe the same value: the largest whole number that divides every number in your set with no remainder.
Why do I need at least two numbers?
A GCF and LCM describe a relationship between numbers, so they only make sense for two or more values. With a single number the result slots stay at "-" until you add another.
How many numbers can I enter at once?
Any amount, two is the minimum but there is no upper limit. Add a third, fourth or tenth number and the GCF and LCM update to cover the whole set.
What is the prime factorization breakdown?
It is the table under the results showing each number broken into its prime factors, plus how those factors combine into the GCF and LCM, so you can see why the answer is what it is rather than just the final figure. For very large numbers, or very long lists, the breakdown is skipped to keep things fast, though the GCF and LCM above it stay exact either way.
Why was one of my entries ignored?
Only positive whole numbers are used. Decimals, negatives, zero and stray text are skipped, and the note under the box tells you how many entries were left out so you can spot typos.