How to use
Enter two non-negative whole numbers. The calculator repeatedly divides the larger value by the smaller and replaces the pair with the smaller value and the remainder. For example, 126 ÷ 84 leaves remainder 42; 84 ÷ 42 leaves remainder 0, so the greatest common factor is 42. A zero input is permitted when the other input is positive, because the GCF of n and 0 is n.
What the result means
The GCF is the largest positive integer that divides both inputs without a remainder. It can simplify fractions, group objects into equal sets or identify the largest shared unit. The Euclidean algorithm avoids listing every factor and works efficiently even for large safe integers. This page handles two integer inputs; for more than two numbers, apply the result successively to each additional value.
Further reading: OpenStax — Introduction to Factoring and Greatest Common Factor · Wolfram MathWorld — Euclidean Algorithm · OpenStax — Prime Factorization and the Least Common Multiple.
Related calculators