GCF Calculator
Greatest common factor and lowest common multiple of up to five numbers.
- Numbers used—
- Common factors—
- Simplified ratio—
- GCF × LCM—
How to use this GCF calculator
- Enter two or more whole numbers. You can use up to five; leave the rest blank.
- Read the greatest common factor at the top, with the lowest common multiple beside it, since the two are almost always needed together.
- Check the working underneath. It shows the prime factorisation of every number you entered and then runs the Euclidean algorithm line by line, which is the method most exam boards want to see.
Decimals are rounded to whole numbers and negatives are treated as positive, because factors are only defined for positive integers.
What is the greatest common factor?
The greatest common factor of two or more numbers is the largest number that divides into all of them without leaving a remainder. It goes by several names that all mean exactly the same thing:
- GCF — greatest common factor, the usual term in American schools.
- HCF — highest common factor, the usual term in British schools.
- GCD — greatest common divisor, the term used in mathematics and computing.
Take 48 and 180. The factors of 48 are 1, 2, 3, 4, 6, 8, 12, 16, 24 and 48. The factors of 180 are 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 30, 36, 45, 60, 90 and 180. The numbers appearing in both lists are 1, 2, 3, 4, 6 and 12, and the largest of those is 12. That is the GCF.
Three ways to find the GCF
1. Listing the factors
Write out every factor of each number, find the ones they share, and take the biggest. This is fine for small numbers and hopeless for large ones. Nobody lists the factors of 1,037.
2. Prime factorisation
Break each number into prime factors, then multiply the primes they have in common, taking the lowest power of each:
180 = 2^2 × 3^2 × 5
Shared: 2^2 × 3 = 4 × 3 = 12
Both numbers contain at least two 2s and at least one 3, so those are the factors they share. The 5 appears only in 180 and the extra 3 only in 180, so neither counts.
3. The Euclidean algorithm
This is the fastest method and the one computers use. Divide the larger number by the smaller, keep the remainder, then repeat with the two smaller numbers until the remainder is zero. The last non-zero remainder is the GCF:
48 = 1 × 36 + 12
36 = 3 × 12 + 0
GCF = 12
It looks like more work than prime factorisation on small numbers, but it scales enormously better. Finding the GCF of two twenty-digit numbers takes a handful of steps this way and is effectively impossible the other way.
GCF and LCM together
The lowest common multiple is the smallest number that both numbers divide into. GCF is about what they share going down; LCM is about where they meet going up. For any two numbers they are linked by a neat identity:
For 48 and 180, that is 12 × 720 = 8,640, which is indeed 48 × 180. The calculator checks this for you whenever you enter exactly two numbers. The identity does not extend to three or more numbers, which is a common misconception.
| Greatest common factor | Lowest common multiple | |
|---|---|---|
| Question it answers | What divides into both? | What do both divide into? |
| Size | Never larger than the smaller number | Never smaller than the larger number |
| Typical use | Simplifying fractions, splitting into groups | Adding fractions, repeating events |
| For 48 and 180 | 12 | 720 |
What the GCF is actually for
- Simplifying fractions. To reduce 48/180, divide both parts by their GCF of 12 to get 4/15. Dividing by anything smaller leaves the fraction only partly simplified, which is why a single GCF step beats cancelling repeatedly.
- Splitting things into equal groups. With 48 pencils and 180 sheets of paper, the GCF tells you the largest number of identical packs you can make: 12 packs, each with 4 pencils and 15 sheets.
- Tiling and cutting. The largest square tile that fills a 48 by 180 cm area without cutting is 12 cm across.
- Simplifying ratios. A ratio of 48:180 divides down to 4:15, and the calculator shows this directly.
- Cryptography. The Euclidean algorithm underpins RSA key generation, where the GCF of two very large numbers has to be computed quickly and repeatedly.
Coprime numbers
When the GCF of two numbers is 1, they share no factors beyond 1 and are called coprime or relatively prime. 8 and 15 are coprime even though neither is itself prime. A fraction whose numerator and denominator are coprime is already in its simplest form.
Frequently asked questions
What is a GCF calculator?
A GCF calculator finds the greatest common factor of two or more whole numbers, which is the largest number that divides into all of them with no remainder. This one also gives the lowest common multiple, the prime factorisation of each number, and the Euclidean algorithm worked line by line.
What is the GCF of 48 and 180?
The GCF of 48 and 180 is 12. In prime factors, 48 is 2^4 x 3 and 180 is 2^2 x 3^2 x 5. They share two 2s and one 3, and 2 x 2 x 3 gives 12.
Is GCF the same as HCF?
Yes. Greatest common factor (GCF) is the American term, highest common factor (HCF) is the British one, and greatest common divisor (GCD) is used in mathematics and computing. All three describe the same number.
How do I find the GCF of three or more numbers?
Find the GCF of the first two, then take that result and find its GCF with the third number, and so on. The order does not matter. This calculator handles up to five numbers at once using exactly that method.
What is the fastest way to find the GCF?
The Euclidean algorithm. Divide the larger number by the smaller and keep the remainder, then repeat with the smaller number and that remainder until the remainder is zero. The last non-zero remainder is the GCF, and it stays fast even for very large numbers.
What is the GCF used for?
Simplifying fractions to their lowest terms, reducing ratios, splitting quantities into the largest possible equal groups, and finding the biggest tile or cut length that fits a space exactly. The Euclidean algorithm behind it is also used in cryptography.
What does it mean if the GCF is 1?
The numbers share no common factor other than 1, and are described as coprime or relatively prime. Neither number needs to be prime itself for this to happen: 8 and 15 are coprime. A fraction built from coprime numbers is already fully simplified.
How are the GCF and LCM related?
For any two numbers, the GCF multiplied by the LCM equals the two numbers multiplied together. For 48 and 180 that is 12 x 720 = 8,640, which is 48 x 180. This shortcut works only for two numbers, not for three or more.
