GCF Calculator
Enter two or more whole numbers. Get the greatest common factor, the least common multiple, and each number’s prime factors.
- Runs in your browser
- Any number of values
- LCM included
- Free
Find the GCF
Whole numbers, separated by spaces, commas or new lines.
Show the working
How to find the greatest common factor
Factor each number
24 = 2³ × 3, 36 = 2² × 3², 60 = 2² × 3 × 5.
Keep the shared primes
Take each prime that appears in every number, at its lowest power: 2² and 3.
Multiply them
2² × 3 = 12. The GCF of 24, 36 and 60 is 12. For the LCM, take every prime at its highest power: 2³ × 3² × 5 = 360.
GCF is also called GCD (greatest common divisor) and HCF (highest common factor). Same thing.
Questions people ask
What is the GCF of two numbers?
The largest whole number that divides both of them exactly. The GCF of 12 and 18 is 6.
Is GCF the same as GCD and HCF?
Yes. Greatest common factor, greatest common divisor and highest common factor all mean the same thing.
What is the difference between GCF and LCM?
GCF is the biggest number that divides into all of them; LCM is the smallest number they all divide into. For 4 and 6, the GCF is 2 and the LCM is 12.
What is the GCF if one number is 0?
The GCF of 0 and any number n is n itself, because every number divides 0. The LCM with 0 is undefined.
Can I use decimals or negative numbers?
GCF and LCM are defined for whole numbers. Negative numbers are treated as positive; decimals are rounded down to whole numbers. For ratios with decimals, use the ratio calculator.