GCD Calculator (Greatest Common Divisor)

Find the greatest common divisor (GCD) or greatest common factor (GCF) of two or more numbers using the Euclidean algorithm.

A GCD calculator finds the greatest common divisor (also called GCF or HCF) of two or more positive integers using the Euclidean algorithm and prime factorization.

Enter two or more positive integers, separated by commas or spaces. Click Calculate to find their greatest common divisor (GCD). The calculator shows the Euclidean algorithm steps and prime factorization, which can help when simplifying fractions.

Examples

GCD of 48 and 18

48 = 18×2 + 12; 18 = 12×1 + 6; 12 = 6×2 + 0. GCD is 6.

Frequently Asked Questions

What is the relationship between GCD and LCM?
For two numbers a and b, GCD(a, b) × LCM(a, b) = |a × b|.
Ad Space

Quick Tips

  • Use the GCD to simplify fractions — divide both numerator and denominator by the result.
  • Use the step-by-step breakdown to verify intermediate calculations.
  • Remember the identity GCD(a,b) x LCM(a,b) = |a x b| to quickly find the LCM after computing the GCD.

A GCD calculator finds the greatest common divisor (also called GCF or HCF) of two or more positive integers using the Euclidean algorithm and prime factorization.

How to Use This Calculator

Enter two or more positive integers, separated by commas or spaces. Click Calculate to find their greatest common divisor (GCD). The calculator shows the Euclidean algorithm steps and prime factorization, which can help when simplifying fractions.

Understanding the Formula

Euclidean Algorithm: a = bq + r. Continue until r = 0.

Examples

GCD of 48 and 18

48 = 18×2 + 12; 18 = 12×1 + 6; 12 = 6×2 + 0. GCD is 6.

Frequently Asked Questions

What is the relationship between GCD and LCM?

For two numbers a and b, GCD(a, b) × LCM(a, b) = |a × b|.

Assumptions & Limitations

  • Inputs must be positive integers; decimals and fractions are not supported.
  • Limited to real numbers; complex number operations are not supported.
  • Very large numbers may take longer to factor but will still produce an exact result.