Calcoid
Math

GCF Calculator (Greatest Common Factor)

Find the greatest common factor of two or more numbers. Includes step-by-step Euclidean method and a list of all common factors.

Enter numbers

Enter at least two positive integers.

Greatest Common Factor

6

Step-by-step (Euclidean)

  1. Start with 12.
  2. gcd(12, 18) = 6
  3. gcd(6, 24) = 6

All common factors

1, 2, 3, 6

Frequently Asked Questions about the GCF Calculator (Greatest Common Factor)

What is the greatest common factor (GCF)?
The GCF is the largest positive integer that divides every number in a set without leaving a remainder. It is also called the greatest common divisor (GCD). For 12 and 18, that number is 6, because 6 divides both and no larger integer does.
How do I find the GCF by hand?
For small numbers, list all factors of each number and pick the largest one they share. For larger numbers, use the Euclidean algorithm: replace the bigger number with the remainder of dividing the two, and repeat until the remainder is 0. The last non-zero remainder is the GCF. For example, gcd(48, 18) gives gcd(18, 12), then gcd(12, 6), then gcd(6, 0) = 6.
What is the GCF of 12 and 18?
The GCF of 12 and 18 is 6. 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 largest factor both lists share is 6.
Can I find the GCF of more than two numbers?
Yes. The calculator reduces the list pair by pair: it computes gcd(first, second), then gcd(that result, third), and so on. Enter as many integers as you need, separated by commas or spaces, and you get the GCF of the entire set.
Is the GCF the same as the LCM?
No. The GCF is the largest integer that divides all inputs, while the LCM (least common multiple) is the smallest integer that all inputs divide evenly into. For any two positive integers a and b, GCF x LCM = a x b. For 12 and 18: GCF = 6, LCM = 36, and 6 x 36 = 12 x 18 = 216.
What if my numbers have no common factors other than 1?
Their GCF is 1, and the numbers are called coprime, or relatively prime. For example, 8 and 15 share no factors other than 1, so gcd(8, 15) = 1. This comes up often in fractions: a fraction is already in lowest terms when its numerator and denominator are coprime.
Does this calculator handle negative numbers?
Yes. GCF is conventionally defined as a positive integer, so the calculator takes the absolute value of each input before computing. Entering -12 and 18 gives the same result as 12 and 18: a GCF of 6.