How the GCF is calculated
The calculator uses the Euclidean algorithm, the method in Euclid's Elements from about 300 BC. Divide the bigger number by the smaller, keep the remainder, and repeat with the smaller number and the remainder. When the remainder is 0, the last divisor is the GCF.
For more than two numbers, work in pairs: GCF(a, b, c) = GCF(GCF(a, b), c).
Worked example: 1071 and 462
462 = 3 × 147 + 21
147 = 7 × 21 + 0
The last nonzero remainder is 21, so GCF(1071, 462) = 21. Check with prime factors: 1071 = 3² × 7 × 17 and 462 = 2 × 3 × 7 × 11. The primes they share are 3 and 7, each with its lowest power, and 3 × 7 = 21.
Where the GCF is used
- Simplifying fractions. Divide the top and bottom by their GCF: 18/24 has GCF 6, so it simplifies to 3/4. The decimal to fraction converter (it simplifies too) does this too.
- Splitting into equal groups. With 48 apples and 180 oranges, the largest number of identical gift bags with nothing left over is GCF(48, 180) = 12.
- Factoring in algebra. 12x + 18 = 6(2x + 3), because GCF(12, 18) = 6.
When this doesn't apply
- The GCF is for whole numbers. Negative signs are ignored, and the answer is always positive.
- GCF(a, 0) = a, because every number divides 0. A list of only zeros has no GCF.
- A GCF of 1 doesn't mean a mistake. It means the numbers are relatively prime (coprime), like 8 and 15.