Exact math and number tool

GCF Calculator

Enter two or more integers to find their greatest common factor, also called the greatest common divisor. The calculator shows the result and the steps used to find it.

Enter values and select Calculate.

How to use this calculator

  1. Enter two to 50 integers separated by commas, spaces, or line breaks.
  2. Negative signs are accepted and absolute values determine common factors.
  3. Calculate to see the exact GCF and bounded Euclidean steps.
  4. Use the related LCM calculator for the smallest common multiple instead.

Formula and method

The Euclidean algorithm repeatedly replaces (a, b) with (b, a mod b) until the remainder is zero. For a list, reduce the result pairwise.

Worked example

For 24, 36, and 60, gcd(24,36) is 12 and gcd(12,60) remains 12, so the GCF is 12.

Assumptions and limits

  • Integer components may contain up to 100 digits.
  • gcd(0,n) equals the absolute value of n.
  • Duplicate values are valid.
  • The displayed explanation is capped to avoid excessive output.

Understanding the result

The result follows the displayed deterministic method. Exact-integer operations use BigInt where appropriate, and any controlled precision limit is stated before the related output can be interpreted.

Common mistakes

  • Entering decimals or fractions
  • Confusing greatest common factor with least common multiple
  • Assuming negative signs make the GCF negative
  • Using prime-factor guessing for very large values

What is the GCF?

The greatest common factor is the largest positive integer that divides every entered integer without a remainder. GCF, GCD, and HCF name the same value here.

How to find the GCF

The calculator reduces the list with the Euclidean algorithm. Prime factorization offers another method: identify the prime factors shared by every number and multiply them using the smallest shared exponent.

GCF by prime factorization

For 24 and 36, 24 = 2³ × 3 and 36 = 2² × 3². The shared prime powers are 2² × 3, so the GCF is 12.

GCF vs LCM

GCF is the largest factor shared by the inputs. LCM is the smallest positive multiple shared by them. Use the LCM Calculator for least-common-multiple work.

Methodology note

The calculator uses the arithmetic definitions shown on this page. It does not call an external calculator service, evaluate expressions, or infer unselected mathematical conventions.

This deterministic utility is a calculation aid. Confirm required notation, precision, and course or professional conventions separately.