← Back to All Math Tools

GCF Calculator

Choose a fast answer or optional teaching.

Step-by-step

Practice Mode

Find the greatest shared factor.

What to understand

The GCF is the largest whole number that divides both inputs with no remainder.

⚡ Smart GCF Shortcuts

Factor-pair shortcut: Test factor pairs from the outside toward the middle. Once the pair numbers meet or cross, stop.

Divisibility shortcut: Check easy shared factors first: 2 for even numbers, 5 for numbers ending in 0 or 5, 10 for numbers ending in 0, and 3 when the digit sum is divisible by 3.

Large-number shortcut: For larger numbers, repeated remainders can find the GCF efficiently: replace the larger number with the remainder after division until the remainder is 0.

When not to use: For young learners or small numbers, factor lists may be clearer than a faster algorithm.

Check: The GCF must divide both original numbers evenly.

How to find the greatest common factor

The GCF is the largest whole number that divides both numbers exactly. List the factors of each number and pick the largest shared one, or use the Euclidean algorithm: divide, keep the remainder, and repeat until the remainder is 0.

Example: 12 and 18. Factors of 12: 1, 2, 3, 4, 6, 12. Factors of 18: 1, 2, 3, 6, 9, 18. The GCF is 6. Euclid's way: 18 ÷ 12 leaves 6, and 12 ÷ 6 leaves 0, so the GCF is 6.

What is the GCF used for?

Simplifying fractions. Dividing 12/18 by the GCF 6 gives 2/3.

What if the numbers share no factors?

Then the GCF is 1. For example, the GCF of 17 and 5 is 1.

Related tools

See all math tools →