GCF Calculator
Enter two or more whole numbers to find their greatest common factor (GCF), also called the greatest common divisor (GCD) or highest common factor (HCF). The calculator shows the Euclidean algorithm step by step, the prime factorisation of each number, all common factors, and the least common multiple as a bonus.
GCF calculator
Euclidean algorithm
Prime factorisation
Factors & Multiples Practice Pack
Printable GCF and LCM worksheets with answer keys, a factor tree template, a prime numbers chart to 200 and a fractions simplifying worksheet.
- GCF practice (PDF, DOCX)
- LCM practice (PDF, DOCX)
- Simplify fractions (PDF, DOCX)
- Primes chart (PDF)
Formats: PDF, DOCX. Instant download after payment (link valid 72 hours, up to 5 downloads). AI-assisted: the templates were drafted with AI help and reviewed and laid out by Kedop.
$3.00 USD, one-time
Secure card checkout by Stripe. Full refund within 7 days — see the refund policy and license.
What the greatest common factor is
The greatest common factor (GCF) of two or more whole numbers is the largest number that divides all of them exactly. For 84, 126 and 210 it is 42: 84 = 42 × 2, 126 = 42 × 3 and 210 = 42 × 5, and no larger number divides all three. The same idea is called the greatest common divisor (GCD) in higher mathematics and computing, and the highest common factor (HCF) in the UK and elsewhere.
Three ways to find the GCF
| Method | How it works | Best for |
|---|---|---|
| Listing factors | List all factors of each number and pick the largest shared one | Small numbers |
| Prime factorisation | Break each number into primes; multiply the primes they share, using the lowest power | Understanding why; also gives the LCM |
| Euclidean algorithm | Repeatedly replace the larger number with the remainder of dividing by the smaller | Large numbers; fastest |
The Euclidean algorithm, step by step
To find GCF(126, 84): divide 126 by 84 — quotient 1, remainder 42. Now find GCF(84, 42): 84 ÷ 42 = 2 remainder 0. When the remainder reaches zero, the last non-zero remainder, 42, is the GCF. The method works because any number that divides both 126 and 84 also divides their difference and remainders. It is over two thousand years old — it appears in Euclid’s Elements — and is still used in computers today because it is extremely fast even for huge numbers.
Using prime factorisation
Write each number as a product of primes: 84 = 2² × 3 × 7, 126 = 2 × 3² × 7 and 210 = 2 × 3 × 5 × 7. The GCF takes each prime that appears in every number, with its lowest power: 2¹ × 3¹ × 7¹ = 42. The least common multiple (LCM) takes every prime with its highest power: 2² × 3² × 5 × 7 = 1,260. The calculator shows the factorisation of each number and of the GCF.
Where the GCF is used
- Simplifying fractions — divide the numerator and denominator by their GCF: 84/126 = 2/3 after dividing by 42.
- Simplifying ratios — 84 : 126 : 210 simplifies to 2 : 3 : 5.
- Dividing things into equal groups — the largest group size that shares 84 red and 126 blue beads equally is 42.
- Tiling and cutting — the largest square tile that exactly covers a 84 × 126 cm area is 42 cm.
- Factoring algebraic expressions — take out the GCF of the coefficients: 12x + 18 = 6(2x + 3).
GCF vs LCM
The GCF is the largest number that divides into all the numbers; the LCM is the smallest number that all the numbers divide into. For two numbers, GCF × LCM = the product of the numbers: GCF(12, 18) × LCM(12, 18) = 6 × 36 = 216 = 12 × 18. Use the GCF to simplify, and the LCM to find common denominators and to line up repeating events.
Worked example
A teacher has 84 pencils, 126 erasers and 210 stickers and wants to make identical gift packs with nothing left over. The GCF of 84, 126 and 210 is 42, so she can make 42 packs, each with 2 pencils, 3 erasers and 5 stickers. The calculator shows the Euclidean steps — GCF(84, 126) = 42, then GCF(42, 210) = 42 — and the simplified ratio 2 : 3 : 5.
Special cases
- If one number divides the other, the GCF is the smaller number: GCF(15, 45) = 15.
- If the numbers share no factor except 1, they are relatively prime (coprime), and the GCF is 1: GCF(8, 15) = 1.
- The GCF of any number and 1 is 1.
- The GCF of consecutive whole numbers is always 1.
Listing factors for small numbers
For small numbers, listing factors is quick and builds number sense. Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24. Factors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36. The common factors are 1, 2, 3, 4, 6 and 12, so the GCF is 12. Find factors in pairs — 1 × 24, 2 × 12, 3 × 8, 4 × 6 — and stop when the pairs meet in the middle, so none are missed. The calculator lists all the common factors of your numbers, which are simply the factors of the GCF.
The GCF in algebra
Factoring out the greatest common factor is the first step in factoring any polynomial. For 18x³ + 27x², the GCF of the coefficients 18 and 27 is 9, and the lowest power of x shared by both terms is x², so the expression factors as 9x²(2x + 3). Always check for a common factor before trying other factoring methods; it makes the remaining expression smaller and easier to work with.
Teaching tips
- Start with real objects: sharing counters into equal groups shows why the GCF is the largest possible group.
- Use factor trees or the “ladder” (cake) method to find prime factors visually.
- Compare methods on the same pair of numbers so students see they agree.
- Introduce the Euclidean algorithm once students are confident with division and remainders.
- Connect GCF to simplifying fractions early, since that is where it is used most.
Privacy
All calculations run in your browser; nothing is stored or uploaded.
Frequently asked questions
What is the GCF of 12 and 18?
6.
Is GCF the same as GCD and HCF?
Yes — greatest common factor, greatest common divisor and highest common factor are the same thing.
How do I find the GCF of three numbers?
Find the GCF of the first two, then the GCF of that result and the third number.
What does relatively prime mean?
The numbers have no common factor other than 1.
How is the GCF used with fractions?
Divide the top and bottom by the GCF to simplify the fraction.
Is my data stored?
No, it runs in your browser.