GCD Calculator (Greatest Common Divisor)
Type two or more whole numbers into the Integers box and read the greatest common divisor, the largest number that divides all of them with no remainder. The calculator folds the Euclidean algorithm across the entire list, so it works the same for a pair or a dozen values. It handles negatives by magnitude and treats zero correctly, and everything runs in your browser as you type.
How to find the greatest common divisor
- Type your whole numbers into the Integers field, separated by commas or spaces.
- Enter at least two values so there is something to compare, for example 48, 36.
- Read the large highlighted result under Greatest common divisor.
- Check the line below it that echoes the numbers the GCD was taken from.
- Click Copy to grab the result, or edit the list to recompute instantly.
Examples
GCD of two numbers
48, 36
12
GCD of a longer list
12, 18, 24
6
Negatives are taken by magnitude
-48, 36
12
Frequently asked questions
What is the greatest common divisor?
The greatest common divisor (GCD) of a set of integers is the largest positive integer that divides every one of them with no remainder. For 48 and 36 that value is 12, since 12 splits both evenly and nothing larger does.
Is the GCD the same as the GCF or HCF?
Yes. Greatest common divisor (GCD), greatest common factor (GCF), and highest common factor (HCF) are three names for the identical value. The tool computes it the same way whichever term your textbook uses.
How many numbers can I enter?
Two is the useful minimum, but you can paste a long list and the calculator folds the Euclidean algorithm across all of them, reducing the running divisor pair by pair until one value remains.
How does it handle negative numbers?
It works from absolute values, so the GCD of -48 and 36 is 12. A divisor is always reported as a positive integer regardless of the signs you enter.
What is the GCD when one number is zero?
The GCD of 0 and 5 is 5, because every integer divides 0 exactly. If every value you enter is zero, the result is defined here as 0, since no largest common divisor exists.
Why must the inputs be whole numbers?
The greatest common divisor is only defined for integers. If you type a decimal such as 2.5 or any non-numeric text, the tool shows a short message asking for whole numbers so the answer stays exact.
Can I separate numbers with spaces instead of commas?
Yes. Commas, spaces, tabs and line breaks all work as separators, and extra separators are ignored, so pasting a column of numbers from a spreadsheet is fine.
Is my data sent anywhere?
No. The whole calculation happens locally in your browser using client-side JavaScript, so the numbers you enter never leave your device or reach a server.
What if I need the least common multiple instead?
Use the linked LCM calculator. The GCD and LCM are related by the identity a times b equals GCD times LCM for two numbers, so the two tools pair up naturally.
Learn more
- The Euclidean algorithm, step by step
How the oldest algorithm still in use finds a greatest common divisor with repeated division, and why it stays fast for large numbers.
Related tools
LCM Calculator
Find the least common multiple of two or more positive integers. Folds the GCD-based formula across your list. Free, accurate, and private.
Prime Factorization Calculator
Break any whole number into its prime factors. Get the factorization in exponent form like 2^3 x 3^2 x 5, a factor table, and whether the number is prime.
Ratio Calculator
Solve a proportion A:B = C:D by leaving one value blank, or reduce any ratio to its lowest terms. Free, instant, and runs in your browser.
Annulus Area Calculator
Calculate the area of an annulus, the ring between two concentric circles, from its outer and inner radius. Returns both circumferences and width too. Free.
Area Calculator
Find the area of a circle, square, rectangle, triangle, trapezoid, parallelogram, ellipse, sector or rhombus. Free and runs in your browser.
Arithmetic Sequence Calculator
Find the nth term, the sum of n terms and the full term list for any arithmetic or geometric sequence. Enter the first term, step or ratio, and n.