Greatest Common Factor of 3 Numbers
Find the Greatest Common Factor (GCF) of three numbers
"Greatest Common Factor of 3 Numbers" Calculator
How to Find the Greatest Common Factor (GCF) of Three Numbers
What the GCF of three numbers is
The greatest common factor of three numbers is the largest positive integer that divides all of them without a remainder. English textbooks also call it the greatest common divisor (GCD) or highest common factor (HCF) — three names for one value. It always exists, because 1 divides everything, and it is never larger than the smallest of the three.
Where the formula comes from
Every integer above 1 is a unique product of primes, and d divides a exactly when every prime of d appears in a at least as many times. To divide all three at once, d may therefore contain each prime only as many times as the poorest of the three contains it — and taking that much makes it the largest such divisor.
A prime missing from even one of the numbers drops out of the product entirely, which is why adding a third number can only lower the answer, never raise it.
How to compute it in three steps
- Factor all three numbers into primes, for example 12 = 2² × 3, 18 = 2 × 3² and 30 = 2 × 3 × 5.
- Keep only the primes present in all three, each taken the smallest number of times: one 2 and one 3.
- Multiply what is left: 2 × 3 = 6. That is the greatest common factor.
Factorization against Euclid, worked on one example
Two routes lead to the same answer, and it is worth seeing them side by side on 12, 18 and 30. The first lays the prime powers out in a grid and reads the minimum of each row:
| Prime | 12 | 18 | 30 | Lowest power |
|---|---|---|---|---|
| 2 | 2² | 2 | 2 | 2 |
| 3 | 3 | 3² | 3 | 3 |
| 5 | — | — | 5 | — |
The 5 contributes nothing: it is absent from two of the three numbers, so no divisor of all three can carry it. The second route never factors anything. It leans on associativity — GCF(a, b, c) = GCF(GCF(a, b), c) — and runs the Euclidean algorithm twice:
18 = 12 × 1 + 6, then 12 = 6 × 2 + 0 → GCF(12, 18) = 6
30 = 6 × 5 + 0 → GCF(6, 30) = 6
GCF(12, 18, 30) = 6
Euclid described this procedure in the Elements around 300 BC, and it is still the reason the pairwise route wins on large numbers: it only ever divides with remainder, so it never has to factor anything. The grid, on the other hand, shows why the answer is what it is, which is what a worked school solution is usually asked for.
Common triples and their GCF
| Three numbers | GCF |
|---|---|
| 2, 3 and 4 | 1 |
| 3, 6 and 9 | 3 |
| 4, 6 and 8 | 2 |
| 4, 8 and 12 | 4 |
| 6, 12 and 18 | 6 |
| 8, 12 and 16 | 4 |
| 12, 18 and 24 | 6 |
| 20, 30 and 40 | 10 |
Where three numbers at once actually come up
- Simplifying a ratio of three terms — 12 : 18 : 24 divided by their GCF 6 becomes 2 : 3 : 4
- Cutting without waste — boards of 12 m, 18 m and 30 m split into equal pieces with no offcut only at lengths dividing 6 m
- Packing into equal boxes — 12, 18 and 30 items of three kinds fill at most 6 identical boxes with nothing left over
- Tiling a rectangle — the largest square tile that fits three side lengths exactly is their greatest common divisor
- Reducing a three-way recipe — scaling 12 g, 18 g and 30 g down by 6 keeps the proportions intact
- School problems — «the largest number that divides 12, 18 and 30» is this calculation word for word
Limits and caveats
- Order does not matter. GCF(12, 18, 24), GCF(24, 12, 18) and GCF(18, 24, 12) are one and the same 6, so this calculator keeps one page per unordered triple.
- The answer is never larger than the smallest number, and it equals it exactly when that number divides the other two — GCF(6, 12, 18) = 6.
- A 1 among the three forces the answer to 1, because nothing above 1 divides 1.
- Pairwise coprime is not the same as coprime as a set. 6, 10 and 15 have a GCF of 1 even though every pair among them shares a factor, so a GCF of 1 does not mean the numbers have nothing in common two by two.
- The GCF divides every difference. For 12, 18 and 30 it divides 18 − 12 = 6 and 30 − 18 = 12 — a quick way to check an answer by hand.
See Also
- Least Common Multiple of 3 Numbers - Find the Least Common Multiple (LCM) of three numbers
- Greatest Common Factor - Find the Greatest Common Factor (GCF) of two numbers
- Least Common Multiple - Find the Least Common Multiple (LCM) of two numbers
About "Greatest Common Factor of 3 Numbers" Calculator
The Greatest Common Factor of three numbers — also called the greatest common divisor (GCD) or highest common factor (HCF) — is the largest positive integer that divides all three of them with zero remainder