Greatest Common Factor Calculator
Paste two or more integers to get the largest positive integer that divides every one of them.
How it works
The greatest common factor is also called the greatest common divisor (GCD).
Euclid’s algorithm finds it without listing every factor: gcd(48, 18) replaces 48 with 48 mod 18 = 12, then 18 with 18 mod 12 = 6, then 12 with 12 mod 6 = 0, leaving 6.
For a list the same pairing is applied: gcd(12, 18, 30) = 6. gcd(n, 0) is |n|. Signs do not matter.
Formula
gcd(a, b) = gcd(b, a mod b), until the remainder is 0 gcd(48, 18) = 6
Worked examples
Two numbers
48 and 18 → 6
Three numbers
12, 18, 30 → 6
Useful notes
- GCF and GCD are the same function. HCF (highest common factor) is another name for it.
- To list every factor of a single number, use the factor calculator.
FAQ
- How do I find the GCF of two numbers?
Use Euclid’s algorithm: replace the larger number by the remainder when it is divided by the smaller, and repeat until the remainder is 0. The last non-zero remainder is the GCF.
- Is GCF the same as GCD?
Yes. Greatest common factor and greatest common divisor name the same integer.
- What is gcd(12, 0)?
12. Zero is a multiple of every integer, so the common factors of 12 and 0 are the factors of 12, and the greatest is 12.
Related tools
LCM Calculator
Find the least common multiple of two or more integers pasted as a list.
Factor Calculator
List every positive factor of an integer and see its prime factorization.
Ratio Calculator
Simplify two numbers to lowest terms and see the decimal relationship A ÷ B.
Fraction Calculator
Add, subtract, multiply or divide two fractions and see the simplified result, mixed number and decimal.
See all Math tools.