Common Factor Calculator — GCF & All Common Factors
Enter two positive integers to find their greatest common factor (GCF) — also called the highest common factor (HCF) — and a complete list of all common factors. The GCF is the largest integer that divides both numbers exactly.
Largest integer that divides both numbers without a remainder
How does this calculator work?
GCF(a, b) is found with the Euclidean algorithm: repeatedly replace (a, b) with (b, a mod b) until b = 0; the last a is the GCF. All common factors are the divisors of the GCF. Enter two integers to see the GCF and every common factor listed.
Formula
How this is calculated
Two integers share a common factor if that factor divides both without a remainder. The greatest common factor (GCF), also called the GCD (greatest common divisor) or HCF, is the largest such number. The Euclidean algorithm finds it efficiently: divide the larger number by the smaller and keep the remainder; repeat with the smaller number and the remainder until the remainder is zero — the last non-zero divisor is the GCF.
All common factors of a and b are exactly the positive divisors of their GCF. If GCF(a, b) = g, then any divisor d of g also divides both a and b, because g | a and g | b imply d | a and d | b. So the set of common factors is found by listing all divisors of g, which are found by trial division up to √g.
The GCF has important applications: simplifying fractions (divide numerator and denominator by GCF), finding the LCD for adding fractions (LCD = a × b ÷ GCF), and in cryptography (RSA key generation depends on the GCF of candidate primes).
Frequently asked questions
The GCF (greatest common factor) is the largest number that divides both integers — useful for simplifying fractions. The LCM (least common multiple) is the smallest number both integers divide into — useful for finding common denominators. They are related by GCF(a,b) × LCM(a,b) = a × b.
A GCF of 1 means the only common factor is 1 — the numbers are said to be coprime (or relatively prime). For example, GCF(8, 15) = 1 because 8 and 15 share no common prime factors. Coprime numbers are important in fraction simplification and modular arithmetic.
Yes. The GCF of three or more numbers is found by applying the algorithm pairwise: GCF(a, b, c) = GCF(GCF(a, b), c). Each step reduces the problem to a two-number GCF until all numbers are covered.
Also known as
TG we-Calculate Editorial Team. (2026). Common Factor Calculator — GCF & All Common Factors [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/common-factor-calculator
TG we-Calculate Editorial Team. "Common Factor Calculator — GCF & All Common Factors." TG we-Calculate. 2026. https://we-calculate.com/calculator/common-factor-calculator.
TG we-Calculate Editorial Team, "Common Factor Calculator — GCF & All Common Factors," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/common-factor-calculator
@misc{wecalculate_common_factor_calculator, title = {Common Factor Calculator — GCF & All Common Factors}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/common-factor-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
