Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem
EasyFactors and MultiplesArithmetic

Find the greatest common factor of 12, 18 and 24.

Compare prime factorizations and keep the shared primes.

Try it first: work the problem on paper, then open the solution below and compare each step.
Show the step-by-step solution

Final answer

66

How we read your problem

Find the greatest common factor (also called GCD or HCF) of the numbers.

Step-by-step solution

  1. Prime factorization of each number

    12=22×3,18=2×32,24=23×312 = 2^{2} \times 3,\quad 18 = 2 \times 3^{2},\quad 24 = 2^{3} \times 3
  2. Euclidean algorithm for GCF(12, 18)

    18 = 1 × 12 + 6; 12 = 2 × 6 + 0

    18=1×12+612=2×6+018 = 1 \times 12 + 6 \\ 12 = 2 \times 6 + 0
  3. The last non-zero remainder is the GCF

    gcd⁡(12,18)=6\gcd(12, 18) = 6
  4. Euclidean algorithm for GCF(6, 24)

    24 = 4 × 6 + 0

    24=4×6+024 = 4 \times 6 + 0
  5. The last non-zero remainder is the GCF

    gcd⁡(6,24)=6\gcd(6, 24) = 6
  6. Confirm with shared prime factors

    Multiply the primes common to every number, each with its smallest exponent.

    2×3=62 \times 3 = 6

Formulas used

  • Euclidean algorithm

    gcd⁡(a,b)=gcd⁡(b, a mod b),gcd⁡(a,0)=a\gcd(a, b) = \gcd(b,\ a \bmod b),\quad \gcd(a, 0) = a

6 is the largest whole number that divides every number exactly.

Verification

  • 12 ÷ 6 = 2
  • 18 ÷ 6 = 3
  • 24 ÷ 6 = 4

About factors and multiples

Prime factorization, greatest common factor and least common multiple.

GCF and LCM

For two positive integers, the product of the GCF and the LCM equals the product of the numbers.

gcd⁡(a,b)⋅lcm⁡(a,b)=ab\gcd(a,b)\cdot\operatorname{lcm}(a,b) = ab

Check your own work