Greatest Common Divisor Calculator


This online Greatest Common Divisor Calculator calculates the greatest common divisor (GCD) of a set of integer numbers which is the largest positive integer that divides each of the numbers. Enter the set of numbers in the input field of the calculator and click the ‘Calculate’ button. You can paste the input data copied from a spreadsheet or csv-file or enter manually using comma, space or enter as separators. The input numbers can be positive or negative integers. In case all of the numbers are zero the GCD = 0.


Dataset

GCD:


Greatest Common Divisor

The greatest common divisor (also known as the greatest common factor, highest common factor, greatest common measure or highest common divisor) of a group of integer numbers is the largest positive integer that divides each of the numbers in the group. The GCD is useful for reducing fractions and can be used to calculate the least common multiple of integer numbers.

There are a few algorithms to calculate the GCD. This Greatest Common Divisor Calculator uses the Euclidean algorithm, which is simple yet powerful enough. It uses a division algorithm in combination with the observation that the GCD of two numbers also divides their difference. The algorithm can be described as follows:

GCD(a, 0) = a,

GCD(a, b) = GCD(b, a mod b),


where

a mod b = a – b [a / b]

is a modulo operation.


Related calculators

Check out our other math calculators such as Factoring Calculator or Least Common Denominator Calculator.