Greatest Common Factor Calculator

Published on: November 11, 2026
Final Answer: Free | Full Steps: Free

This Greatest Common Factor Calculator finds the biggest whole number that divides every number in a list exactly, and shows the working at every step. For smaller numbers it lists the factors of each one, marks the factors they share, and picks the greatest. For bigger numbers it breaks each one into prime factors instead and multiplies the primes they have in common. Following the same pattern every time is what makes the greatest common factor easy to find, check, and repeat on your own.

Step-by-step method

  1. Set up the problem.
  2. List the factors of each number.
  3. Find the factors that appear in every list.
  4. Pick the greatest of those common factors.

Required knowledge

The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. For more practice, the notes page goes further with extra worked examples and fuller explanations of the ideas behind each step. Use them together to check your answers and to understand why each step works.

See Example 1 Hide Example 1

Problem

\(\text{GCF}(12, 18)\)

Approach

Step-by-step method

  1. Set up the problem.
  2. List the factors of each number.
  3. Find the factors that appear in every list.
  4. Pick the greatest of those common factors.

Step 1

Step 1 - Set up the problem.

In this problem: We are finding the greatest common factor of \(12\) and \(18\).

\(\text{GCF}(12, 18)\)

Step 2

Step 2 - List the factors of each number.

In this problem: The factors of \(12\) are \(1\), \(2\), \(3\), \(4\), \(6\) and \(12\). The factors of \(18\) are \(1\), \(2\), \(3\), \(6\), \(9\) and \(18\).

\(12\)1234612
\(18\)1236918

Step 3

Step 3 - Find the factors that appear in every list.

In this problem: Comparing the lists, \(1\), \(2\), \(3\) and \(6\) are in every list.

\(12\)1234612
\(18\)1236918

Step 4

Step 4 - Pick the greatest of those common factors.

In this problem: The greatest of \(1\), \(2\), \(3\) and \(6\) is \(6\), so \(\text{GCF}(12, 18) = 6\).

\(12\)1234612
\(18\)1236918

Final Answer

\(\text{GCF}(12, 18) = 6\)
See Example 2 Hide Example 2

Problem

\(\text{GCF}(84, 126)\)

Approach

Step-by-step method

  1. Set up the problem.
  2. List the factors of each number.
  3. Find the factors that appear in every list.
  4. Pick the greatest of those common factors.

Step 1

Step 1 - Set up the problem.

In this problem: We are finding the greatest common factor of \(84\) and \(126\).

\(\text{GCF}(84, 126)\)

Step 2

Step 2 - Write each number as a product of prime factors, covered in the Prime Factorization Calculator.

In this problem: Each of \(84\) and \(126\) is broken down into primes one at a time.

\(\text{GCF}(84, 126)\)

Step 2a

Step 2a - Write the first number as a product of prime factors.

In this problem: Breaking \(84\) down gives \(84 = 2 \times 2 \times 3 \times 7\), worked through below.

\(84 = 2 \times 2 \times 3 \times 7\)

Step 2b

Step 2b - Write the second number as a product of prime factors.

In this problem: Breaking \(126\) down gives \(126 = 2 \times 3 \times 3 \times 7\), worked through below.

\(126 = 2 \times 3 \times 3 \times 7\)

Step 3

Step 3 - Find the prime factors that every number shares.

In this problem: Every number has \(2\) once, \(3\) once and \(7\) once, so those are the shared prime factors.

\(\begin{aligned}84 &= \boxed{2} \times 2 \times \boxed{3} \times \boxed{7} \\ 126 &= \boxed{2} \times \boxed{3} \times 3 \times \boxed{7}\end{aligned}\,\)

Step 4

Step 4 - Multiply the shared prime factors together.

In this problem: Multiplying the shared prime factors gives \(2 \times 3 \times 7 = 42\), so \(\text{GCF}(84, 126) = 42\).

\(\text{GCF}(84, 126) = 2 \times 3 \times 7 = 42\)

Final Answer

\(\text{GCF}(84, 126) = 42\)

Example Problems

Click one to load it into the box and solve it.