Find the greatest common divisor (also known as HCF, the highest common factor) of two or more whole numbers instantly, right in your browser.
Enter two or more whole numbers to calculate their GCD.
The greatest common divisor (GCD) is the largest positive integer that divides evenly into every number in a group, leaving no remainder. It's also known as the greatest common factor (GCF) or the highest common factor (HCF) — all three names refer to exactly the same value, just used more in some regions or curricula than others. It's commonly used to simplify fractions and ratios to their lowest terms.
Rather than testing every possible divisor, this calculator uses the Euclidean algorithm: divide the larger number by the smaller one, replace the larger number with the remainder, and repeat until the remainder is 0. The last non-zero remainder is the GCD.
The GCD of a group of integers is the largest positive integer that divides evenly into every one of them. The GCD of 12 and 18 is 6, since 6 is the biggest number that divides both.
Yes. GCD (greatest common divisor), GCF (greatest common factor), and HCF (highest common factor) are three different names for the exact same value. GCD and GCF are more commonly used in the US, while HCF is the standard term in the UK, India, and several other countries' math curricula — this calculator gives the same result no matter which name you use for it.
This calculator uses the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing it by the smaller one, until the remainder reaches zero. Whatever's left is the GCD. This converges in very few steps, even for large numbers, unlike checking every possible divisor one by one.
It equals the other number. Since every number divides 0 evenly, the largest number that divides both 0 and n is simply |n|. For example, GCD(0, 5) = 5.
This calculator defines GCD(0, 0) as 0, following the same convention used by most calculators and programming languages. Mathematically every number divides 0, so there's no single largest common divisor -- 0 is used as a practical, unambiguous convention rather than leaving the result undefined.
No. Divisibility doesn't depend on sign, so negative values are treated by their absolute value, and the result is always shown as a non-negative number.
Yes. Enter as many integers as you like, separated by commas, spaces, or line breaks, and the calculator finds the GCD across all of them.
No. Every calculation happens locally in your browser using JavaScript. Nothing you enter here is sent to Brekzy or stored anywhere.
Explore Brekzy's growing collection of free calculators, converters, AI tools, and practical resources.