Find the Greatest Common Factor (GCF), also called Greatest Common Divisor (GCD), of two or more integers. Also shows LCM and Euclidean algorithm steps.
Separate numbers with spaces, semicolons, or a comma followed by a space. Do not type thousands separators: "1,000" is flagged as ambiguous (one thousand, or the list 1 and 000?), so write 1000.
| Number | Prime Factors |
|---|---|
| 48 | 2^4 × 3 |
| 36 | 2^2 × 3^2 |
| 24 | 2^3 × 3 |
| GCF = 12 | 2^2 × 3 |
| Term | Meaning |
|---|---|
| GCF / GCD | Largest integer that divides all given numbers evenly |
| LCM | Smallest positive integer divisible by all given numbers |
| Co-prime | GCF = 1 (no common factors except 1) |
Step-by-step for the first two numbers.
| Step | Division | Remainder |
|---|---|---|
| 1 | 48 = 1 × 36 + 12 | 12 |
| 2 | 36 = 3 × 12 + 0 | 0 |
| Step | Calculation | Result |
|---|---|---|
| 1 | GCF(48, 36) | 12 |
| 2 | GCF(12, 24) | 12 |
| Property | Formula |
|---|---|
| For two numbers | GCF(a,b) × LCM(a,b) = a × b |
| LCM from GCF | LCM = (a × b) / GCF(a,b) |
| Euclidean step | GCF(a,b) = GCF(b, a mod b) |
Two boards, 126 cm and 84 cm long, are to be cut into equal pieces with nothing left over. The longest piece that works is their greatest common factor, 42 cm, which gives 3 pieces from one and 2 from the other. The same number reduces fractions, and its partner, the least common multiple, tells you when two repeating cycles line up again. Type the numbers into the box and the page returns both, plus every division it used and the prime factors behind them.
Enter 84 126 210. The step table works on the first two numbers: 84 = 0 × 126 + 84, then 126 = 1 × 84 + 42, then 84 = 2 × 42 + 0. The last non-zero remainder, 42, is the GCF of 84 and 126. The rule behind each line is GCF(a, b) = GCF(b, a mod b). The Multi-number GCF Chain then folds in the rest: GCF(84, 126) = 42, then GCF(42, 210) = 42, so the GCF of all three is 42.
Prime factorizations check it: 84 = 2^2 × 3 × 7, 126 = 2 × 3^2 × 7 and 210 = 2 × 3 × 5 × 7. The GCF keeps each shared prime at its lowest power, 2 × 3 × 7 = 42. The LCM keeps each prime at its highest power, 2^2 × 3^2 × 5 × 7 = 1,260. For two numbers, GCF × LCM = a × b (42 × 252 = 84 × 126 = 10,584), but that identity fails for three or more, so the page applies LCM(a, b) = a ÷ GCF × b pair by pair.
Exactness. All arithmetic uses BigInt, so the LCM never loses digits. For 999999999989 and 999999999959 the page prints an LCM of 999,999,999,948,000,000,000,451, a 24-digit number far above 9,007,199,254,740,992 (2^53), the limit of ordinary JavaScript numbers. Each entry may be as large as 1,000,000,000,000, with at most 20 numbers.
Input rules. Separate numbers with spaces, semicolons, or a comma followed by a space. A comma with no space is read as a separator unless it looks like a thousands separator, so 12,18 works but 1,000 is flagged as ambiguous and the message suggests writing 1000. Any other token, such as 12.5 or -4 or abc, is named in the message, never silently dropped, and zero is rejected.
The numbers are co-prime: they share no factor except 1. For 35 and 64 the GCF is 1 and the LCM is simply their product, 2,240.
Enter 84 126. The GCF is 42, so dividing numerator and denominator by 42 reduces the fraction to 2/3.
A comma between digits could mean one thousand or the pair 1 and 000. Rather than guess, the page stops and asks you to remove the comma. List items are safest with a comma and a space, as in 100, 200.
Only after scaling to integers. For 1.2 and 1.8 enter 12 and 18, read a GCF of 6, then divide by 10 to get 0.6.
No. Only the Euclid table changes, because it always works on the first two. Entering 126 first shows 126 = 1 × 84 + 42 as its opening line, with the same GCF of 42.