Enter two or more whole numbers, separated by commas, to find their greatest common factor.
How to Use the Greatest Common Factor Calculator
List two or more numbers separated by commas — it works the same way whether it's two numbers or five.
Listing every factor of two large numbers and comparing the lists works, but it's slow — a number like 123,456 has dozens of factors to check by hand. The Euclidean algorithm gets there in a handful of steps instead, and it's over 2,000 years old:
gcd(a, b) = gcd(b, a mod b), until b = 0
Divide the larger number by the smaller, replace the larger with the remainder, repeat. The last non-zero remainder is the greatest common factor. This Greatest Common Factor Calculator (also called GCD) runs that process on two or more whole numbers — for three or more, it finds the GCF of the first pair, then folds in each remaining number the same way.
A GCF of 1 means the numbers are coprime — no shared factor besides 1. Neither number needs to be prime itself for that to hold; 8 and 15 are coprime, and neither one is prime.