Boneyard Tools

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

  1. Type your whole numbers into the Integers field, separated by commas or spaces.
  2. Enter at least two values so there is something to compare, for example 48, 36.
  3. Read the large highlighted result under Greatest common divisor.
  4. Check the line below it that echoes the numbers the GCD was taken from.
  5. 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

Related tools