Common Factor Calculator: Common Factors, GCF and LCM
Enter two to six whole numbers. You will see all the factors of each, the factors they share, the greatest common factor, the least common multiple and the prime factorisation.
Last reviewed
Greatest common factor
6
4 common factors
- Common factors
- 1, 2, 3, 6
- Least common multiple
- 36
- The fraction in lowest terms
- 2 / 3
12 = 2² × 3
6 factors: 1, 2, 3, 4, 6, 12
18 = 2 × 3²
6 factors: 1, 2, 3, 6, 9, 18
The greatest common factor is the largest number that divides every one of them exactly. It is found with the Euclidean algorithm, and every common factor divides it.
Factors and common factors
A factor of a whole number is a whole number that divides it with nothing left over. The factors of 12 are 1, 2, 3, 4, 6 and 12. The factors of 18 are 1, 2, 3, 6, 9 and 18.
The common factors of two or more numbers are the factors that every one of them has. For 12 and 18 they are 1, 2, 3 and 6. The biggest, 6, is the greatest common factor, or GCF. It is also called the greatest common divisor (GCD) or the highest common factor (HCF). The three names mean the same thing.
A neat fact: all common factors divide the GCF
The common factors of a set of numbers are exactly the factors of their GCF. The factors of 6 are 1, 2, 3 and 6, which is the list of common factors of 12 and 18. So once you have the GCF, you have all the common factors.
That is why the calculator works the GCF out first, and then lists its factors.
Three ways to find the GCF
1. List the factors
Write out the factors of each number, and pick the largest one they share. It works for small numbers and is slow for big ones.
2. Use prime factors
Break each number into primes, and multiply the primes they have in common, each to the lower of its powers.
- 12 = 2² × 3
- 18 = 2 × 3²
- Common: one 2 and one 3, so GCF = 2 × 3 = 6
3. The Euclidean algorithm
This is the fast method, and it is the one the calculator uses. It is in Euclid’s Elements, written around 2,300 years ago. Divide the larger number by the smaller. Then divide the smaller by the remainder, and keep going until the remainder is zero. The last divisor is the GCF.
For 48 and 180:
- 180 = 3 × 48 + 36
- 48 = 1 × 36 + 12
- 36 = 3 × 12 + 0
The last divisor is 12, so the GCF of 48 and 180 is 12. It takes a few steps even for numbers with fifteen digits.
The least common multiple
The least common multiple (LCM) is the smallest number that all of them divide into. For two numbers:
LCM = a × b ÷ GCF
For 12 and 18: 12 × 18 ÷ 6 = 36. For 48 and 180: 48 × 180 ÷ 12 = 720. For more than two numbers, the calculator takes them pair by pair. The LCM can be much larger than the numbers themselves, so it is worked out in exact big-number arithmetic.
Worked results
| Numbers | Common factors | GCF | LCM |
|---|---|---|---|
| 12, 18 | 1, 2, 3, 6 | 6 | 36 |
| 48, 180 | 1, 2, 3, 4, 6, 12 | 12 | 720 |
| 24, 36, 60 | 1, 2, 3, 4, 6, 12 | 12 | 360 |
| 17, 31 | 1 | 1 | 527 |
| 7, 91 | 1, 7 | 7 | 91 |
In the last row, 7 divides 91, so 7 is the GCF and the LCM is 91 itself.
Coprime numbers
If the only common factor is 1, the numbers are coprime, or relatively prime. 17 and 31 are coprime because both are prime. But numbers do not have to be prime to be coprime: 8 and 15 share only 1.
With three or more numbers there is a distinction. 6, 10 and 15 have a GCF of 1, because no factor is shared by all three, even though every pair has one: 6 and 10 share 2, 10 and 15 share 5, and 6 and 15 share 3.
Simplifying fractions
The GCF is what you divide by to put a fraction in its lowest terms. For 12/18, divide both by 6 to get 2/3. When you enter exactly two numbers, the calculator shows the fraction made of them in lowest terms.
Where common factors are used
- Simplifying fractions and ratios. 48:180 is 4:15.
- Splitting things evenly. 48 apples and 180 oranges can be put into at most 12 identical bags, each with 4 apples and 15 oranges.
- Tiling and cutting. The largest square tile that fits a 48 by 180 floor exactly is 12 by 12.
- Finding when cycles meet. If one thing repeats every 12 days and another every 18, they coincide every 36 days, the LCM.
Prime numbers
A number with exactly two factors, 1 and itself, is prime. The calculator marks a prime when you enter one, and shows the prime factorisation of the rest. The number 1 is not prime: it has only one factor.
Every whole number above 1 is a product of primes in exactly one way, apart from the order. This is the fundamental theorem of arithmetic, and it is why the prime-factor method always works.
What you can enter
- Two to six whole numbers, separated by commas, spaces or new lines.
- Each up to 1,000,000,000,000,000 (a quadrillion).
- Whole numbers of 1 or more. Zero and negative numbers are not handled, and decimals have no factors in this sense.
If a number has a lot of factors, the list is shortened on the page. For example, 360,360 has 192.
Common mistakes
- Mixing up GCF and LCM. The GCF is the biggest number that goes into all of them. The LCM is the smallest number they all go into. The GCF is never larger than the smallest number, and the LCM is never smaller than the largest.
- Forgetting 1 and the number itself. They are factors.
- Stopping at the first common factor. The GCF is the largest, not the first you spot.
- Using the product as the LCM. It is only the LCM when the numbers are coprime.
For lists of numbers that follow a pattern, see the number sequence calculator. For arithmetic on very large integers, the big number calculator. For percentages and ratios, the percentage calculator.
How it is calculated
The GCF is found with the Euclidean algorithm, repeated for each additional number. The factors of a number come from its prime factorisation, found by trial division up to the square root, by combining every power of each prime. The common factors are the factors of the GCF. The LCM is worked out in exact arbitrary-size integers, pair by pair, as a × b ÷ GCF.
Frequently asked questions
What are the common factors of 12 and 18?
The factors of 12 are 1, 2, 3, 4, 6 and 12, and of 18 are 1, 2, 3, 6, 9 and 18. The ones in both lists are 1, 2, 3 and 6, so the greatest common factor is 6.
What is the greatest common factor?
The largest whole number that divides all the numbers exactly. It is also called the greatest common divisor or highest common factor. Every common factor of the numbers is a factor of it.
How do I find the GCF quickly?
Use the Euclidean algorithm, which goes back to Euclid's Elements: divide the larger number by the smaller, then the smaller by the remainder, and continue until the remainder is zero. For 48 and 180: 180 = 3 × 48 + 36, 48 = 1 × 36 + 12, 36 = 3 × 12, so the GCF is 12.
What is the least common multiple?
The smallest number that every one of them divides into. For two numbers it is their product divided by the GCF, so for 12 and 18 it is 12 × 18 ÷ 6 = 36.
What does it mean if the GCF is 1?
The numbers are coprime, or relatively prime: they share no factor except 1. 17 and 31 are coprime, and so are 8 and 15, even though 8 and 15 are not prime themselves.
How do I simplify a fraction with this?
Divide the top and bottom by their GCF. For 12/18 the GCF is 6, so the fraction in lowest terms is 2/3. With two numbers entered, the calculator shows this.
Related calculators
- Number Sequence CalculatorChoose the type of sequence, give the first term and the rule, and say how many terms.
- Big Number CalculatorEnter whole numbers of any size, up to 10,000 digits, and choose an operation.
- Statistics CalculatorEnter your numbers, separated by commas, spaces or new lines.
- Percentage CalculatorPick the question you are actually asking.
- Distance CalculatorChoose what you are measuring between.
- Weight CalculatorEnter a mass and choose where it is.