GCF Calculator

Find the Greatest Common Factor (GCF), also called Greatest Common Divisor (GCD), of two or more integers. Also shows LCM and Euclidean algorithm steps.

Input

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.

GCF / GCD
12
of 48, 36, 24
LCM
144

Prime Factorizations

NumberPrime Factors
482^4 × 3
362^2 × 3^2
242^3 × 3
GCF = 122^2 × 3
TermMeaning
GCF / GCDLargest integer that divides all given numbers evenly
LCMSmallest positive integer divisible by all given numbers
Co-primeGCF = 1 (no common factors except 1)

Euclidean Algorithm Steps

Step-by-step for the first two numbers.

StepDivisionRemainder
148 = 1 × 36 + 1212
236 = 3 × 12 + 00
GCF(48, 36) = 12

Multi-number GCF Chain

StepCalculationResult
1GCF(48, 36)12
2GCF(12, 24)12

GCF × LCM Relationship

PropertyFormula
For two numbersGCF(a,b) × LCM(a,b) = a × b
LCM from GCFLCM = (a × b) / GCF(a,b)
Euclidean stepGCF(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.

84, 126 and 210, then the input rules

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.

How to Use This Calculator

  1. Type two or more positive whole numbers into the Numbers box. Separate them with spaces, semicolons, or a comma and a space. The default is 48, 36, 24.
  2. Do not type thousands separators. An entry like 1,000 triggers a message explaining the ambiguity; write 1000 instead.
  3. Read the GCF / GCD and LCM tiles, then the Prime Factorizations table, which also factors the GCF itself.
  4. Open the Euclidean Algorithm Steps card for the divisions on the first two numbers. With three or more numbers a Multi-number GCF Chain follows.
  5. Each number must be at most 1,000,000,000,000 and you can enter up to 20. Zero, negatives, decimals and letters show a message that names the offending entry.
  6. The answer is worked out live from the box contents. With only one valid number the page asks for at least two.

Frequently Asked Questions

What does a GCF of 1 tell me?

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.

How do I simplify 84/126 with this?

Enter 84 126. The GCF is 42, so dividing numerator and denominator by 42 reduces the fraction to 2/3.

Why was 1,000 rejected?

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.

Can I find the GCF of decimals?

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.

Does the order of the numbers change the answer?

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.