Skip to content

GCF Calculator

Find the greatest common factor of two numbers instantly.

How to use gcf calculator

  1. Type the first number into the "First number" box.
  2. Type the second number into the "Second number" box.
  3. The greatest common factor appears instantly, with the least common multiple shown underneath.
  4. Change either number or clear a box to start over.

Examples

GCF of 48 and 18

The largest number dividing both 48 and 18 is 6 — the same result you need to reduce 48/18 to 8/3.

GCF of 56 and 98

56 = 2³ × 7 and 98 = 2 × 7², so the shared prime factors are 2 and 7: the GCF is 14.

GCF of 17 and 5

Two different primes share no factors at all, so their greatest common factor is 1 — they are coprime.

What is GCF?

The greatest common factor (GCF) of two numbers is the largest whole number that divides both of them without a remainder. For 48 and 18 it is 6: the divisors of 48 are 1, 2, 3, 4, 6, 8, 12, 16, 24 and 48, the divisors of 18 are 1, 2, 3, 6, 9 and 18, and 6 is the largest number on both lists. The same idea is also called the greatest common divisor (GCD) or highest common factor (HCF).

You reach for the GCF whenever you need to simplify a fraction — dividing the numerator and denominator by their GCF reduces 48/18 to 8/3 in one step — or whenever you want to split things into the largest equal groups possible: cutting two ribbons into equal longest pieces, tiling a floor with the biggest square tiles that fit both dimensions, or dividing supplies evenly between teams.

This calculator finds the GCF with the Euclidean algorithm: divide, take the remainder, and repeat until the remainder is zero. It is fast even for very large numbers and runs entirely in your browser. Type the two numbers and the GCF appears as you type, with the related least common multiple shown underneath.

Frequently asked questions

What is the difference between GCF and LCM?

The GCF is the largest number that divides both inputs, while the LCM is the smallest number both inputs divide into. They are linked by GCF(a, b) × LCM(a, b) = |a × b|, which is why this page shows both together.

How do you find the GCF by prime factorization?

Write each number as a product of primes, then multiply the primes that appear in both factorizations, each at its lowest power. For 48 = 2⁴ × 3 and 18 = 2 × 3², the shared primes are 2 and 3, giving 2 × 3 = 6.

What is the GCF of negative numbers?

Factors are based on absolute values, so the sign does not matter: GCF(-48, 18) = GCF(48, 18) = 6. The result is always reported as a non-negative number.

What is the GCF when one number is 0?

Every whole number divides 0, so GCF(0, n) = |n|. In particular GCF(0, 18) = 18. The GCF of 0 and 0 is defined here as 0.

Can I enter decimals?

The calculator works with whole numbers and truncates any decimal input before computing, so 48.9 is treated as 48. Enter integers for exact results.