SahlCalc سهل
Gulf Hubs:

Saudi Arabia: Labour: HRSD · Tax and zakat: ZATCA

GCF Calculator (Greatest Common Factor)

Find the greatest common factor of two or more whole numbers, also called the greatest common divisor (GCD) or highest common factor (HCF), with every step of Euclid's algorithm.

Whole numbers from 1 up, separated by commas or spaces, e.g. 48, 18

GCF(48, 18)

6

Least common multiple

144

Coprime?

No

Euclid steps

3

Euclid's algorithm: a = q × b + r (3)
StepDivision
148 = 2 × 18 + 12
218 = 1 × 12 + 6
312 = 2 × 6 + 0

Formula with your numbers

  • Euclid gcd(a, b) = gcd(b, a mod b) … last non-zero remainder = 6
  • Prime factors 48 = 2⁴ × 3; 18 = 2 × 3² → 2 × 3 = 6

Quick answer: The GCF of 48 and 18 is 6: 48 = 2 × 18 + 12, 18 = 1 × 12 + 6, 12 = 2 × 6 + 0, and the last non-zero remainder is 6.

How it's calculated

Euclid's algorithm divides the larger number by the smaller and keeps the remainder: gcd(a, b) = gcd(b, a mod b). When the remainder reaches 0, the last divisor is the GCF.

For three or more numbers, find the GCF of the first two, then the GCF of that result and the next number: gcd(a, b, c) = gcd(gcd(a, b), c).

The same answer comes from prime factors: multiply the primes that every number shares, each at its lowest power. 48 = 2⁴ × 3 and 18 = 2 × 3², so the GCF is 2 × 3 = 6.

The GCF is what you divide by to simplify a fraction or a ratio; see the fraction calculator and the LCM calculator.

Worked examples

  • 48 and 18: 48 = 2 × 18 + 12; 18 = 1 × 12 + 6; 12 = 2 × 6 + 0 → GCF 6
  • 12, 18 and 30: gcd(12, 18) = 6; gcd(6, 30) = 6 → GCF 6
  • 35 and 64: GCF 1 (coprime)

Frequently asked questions

Are GCF, GCD and HCF the same?

Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same number.

What does a GCF of 1 mean?

The numbers are coprime: they share no factor other than 1, such as 35 and 64.

How are GCF and LCM related?

For two numbers, GCF × LCM = a × b. For 48 and 18: 6 × 144 = 864 = 48 × 18.

What is the GCF of 48 and 18?

6. It's the biggest number that goes into both.

How do I simplify a fraction with the GCF?

Divide the top and bottom by it. 18 and 48 share a GCF of 6, so 18/48 simplifies to 3/8.

What is the GCF of 24, 36 and 60?

12. Find it for the first two (12), then for that and the next number (still 12).