Greatest Common Factor Calculator

BASIC MATH · EUCLIDEAN ALGORITHM

Greatest Common Factor (GCF / GCD)

Calculated on this device
Enter at least 2 whole integers separated by commas, up to 32 characters total.

GREATEST COMMON FACTOR

12

GCF(24, 36, 60) = 12

Algorithm Euclidean division: GCD(a, b) = GCD(b, a mod b)

Companion LCM360Least common multiple
Integers Parsed3Exact BigInt values

HOW IT WORKS

Euclidean algorithm for GCF & GCD

The greatest common factor (GCF)—also called the greatest common divisor (GCD)—is the largest positive integer that divides every integer in a set without leaving a remainder.

01

Euclidean remainder step

Repeatedly replace the larger integer with the remainder of dividing it by the smaller integer until the remainder reaches zero:

GCD(a, b) = GCD(b, a mod b), GCD(a, 0) = |a|
02

Folding across 3+ integers

For multiple integers, the GCD operation is associative, so folding pairwise produces the exact GCF of the entire list:

GCF(a, b, c) = GCF(GCF(a, b), c)
03

Exact BigInt arithmetic

All remainders are evaluated in BigInt integer arithmetic so large integers never lose precision.

GCF(24, 36, 60) = 12

GCF GUIDE

Reducing fractions, coprime integers & Euclidean efficiency

How GCF simplifies fractions and ratios

Dividing both the numerator and denominator of a fraction by their GCF puts the fraction in lowest terms in a single step. For example, 24/36 simplifies immediately to 2/3 after dividing both parts by GCF(24, 36) = 12.

What does a GCF of 1 mean?

When GCF(a, b) = 1, the integers are coprime (mutually prime)—they share no prime factors. Note that coprime numbers do not have to be prime themselves (for example, 8 and 15 are both composite, yet GCF(8, 15) = 1).

Need the smallest shared multiple instead? Visit the LCM Calculator, list all divisors with the Factor Calculator, or simplify fractions with the Fraction Calculator.

Frequently asked questions

Is GCF the same as GCD and HCF?

Yes. Greatest Common Factor (GCF), Greatest Common Divisor (GCD), and Highest Common Factor (HCF) are different names for the exact same value.

What is the GCF of 0 and a non-zero integer?

Every non-zero integer divides 0, so GCF(0, n) = |n|. However, GCF(0, 0) is undefined and rejected inline.

Why use the Euclidean algorithm instead of listing all factors?

Factoring very large integers is computationally expensive, whereas the Euclidean algorithm finishes in logarithmic steps using only integer division remainders.

Can I enter negative numbers?

Yes. Since divisors of −n are the same as divisors of n, the GCF is always a positive integer.

Your inputs are calculated in this browser and are not sent to a server.