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⁡(17,31)\gcd(17, 31)

1\displaystyle 1

Using prime factors

17=17,31=31\displaystyle 17 = 17, \quad 31 = 31

LCM

527\displaystyle 527
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)

    31=1×17+1417=1×14+314=4×3+23=1×2+12=2×1+0\begin{gathered} 31 = 1 \times 17 + 14 \\ 17 = 1 \times 14 + 3 \\ 14 = 4 \times 3 + 2 \\ 3 = 1 \times 2 + 1 \\ 2 = 2 \times 1 + 0 \end{gathered}
  2. Result

    So the highest common factor of 17, 31 is 11, which means they have no common factor except 11 (they are coprime).

Worked examples