GCF Calculator

Find the greatest common factor of a list of whole numbers.

Two or more, separated by commas or spaces

Try

Result

You enteredgcd⁡(12,18)\gcd(12, 18)

6\displaystyle 6

Using prime factors

12=22×3,18=2×32\displaystyle 12 = 2^{2} \times 3, \quad 18 = 2 \times 3^{2}

LCM

36\displaystyle 36
Show the work
  1. Euclid's algorithm

    Here aa is the larger number, bb the smaller and rr the remainder when aa is divided by bb. Each line replaces the pair by bb and rr without changing the HCF, until the remainder is 00.

    Using gcd⁡(a,b)=gcd⁡(b,r)\gcd(a, b) = \gcd(b, r)

    18=1×12+612=2×6+0\begin{gathered} 18 = 1 \times 12 + 6 \\ 12 = 2 \times 6 + 0 \end{gathered}
  2. Result

    So the highest common factor of 12, 18 is 66, the largest number that divides every one of them.

Worked examples