Calculates the greatest common divisor of two integer numbers without the need to perform the decomposition into prime factors of each of them. With our online calculator you can find the value of the GCD automatically:
What is the greatest common divisor?
The greatest common divisor or GCD of two or more numbers is equal to the largest common integer to all of them, which makes it possible to divide them all by their value.
Expressed in other words, is the greatest common divisor to all the numbers involved in the operation.
This is especially useful for simplify fractions and other operations, since allows you to work with smaller numbers and that makes the calculations much easier.
How is the greatest common divisor calculated?
It is common practice to calculate the greatest common divisor of two or more numbers by calculating their decomposition into prime factors.
Once obtained, in order to obtain the GCD it is necessary to multiplying the common values raised to the lowest exponent as we can see below, taking as an example the numbers 48 and 60:
There are other methods to obtain the GCD, but this is undoubtedly the most widespread and it is also used for finding the greatest common divisor of three numbers.
As you can see much better with a solved example, we will calculate the GCD of three issues (24, 36, 40). To do this, the first thing we will do is to decompose it into prime factors:
24= 2 x 2 x 2 x 2 x 3 = 23 x 3
36 = 2 x 2 x 2 x 3 x 3 x 3 = 22 x 33
40 = 2 x 2 x 2 x 2 x 2 x 5 = 23 x 5
Now we only have to select the factors common to the three numbers, paying attention to choose the ones with the lowest power or exponent:
GCD (24, 36, 40) = 22 = 4
In the event that there is no common divisor, the following applies to all the numbers, the result will be 1. This will happen if all the numbers are prime, for example.
Now that you know how to calculate the greatest common divisor If you have several numbers, you can use our online calculator to save time and avoid possible mistakes in the calculations. Remember that we also have a tool to obtain the least common multiple of two numbers.
Greatest common divisor exercises
We will now look at several exercises in which we will calculate the greatest common divisor of two numbers.
Greatest common divisor of 8 and 12
As we have seen in the first point, the first thing we have to do is to decompose each of the numbers into prime factors:
- 8 = 2 x 2 x 2 x 2 = 23
- 12: 2 x 2 x 2 x 3 = 22 x 3
Once we already have the numbers expressed as a multiplication of prime factors, we look at those that are common to both and always we will keep those of lesser exponent (22).
In this example, the GCD of 8 and 12 equals 4.
How does the greatest common divisor calculator work?
Our greatest common divisor calculator has been developed to automate the above process.
This saves you a lot of time and avoids errors The calculator will factor the numbers for you, select the factors common to both numbers and multiply them correctly.
Calculate the greatest common divisor in Excel
If you have Excel installed on your computer, you can also calculate the GCD of multiple numbers instantly.
To do this you simply have to open the spreadsheet program and type in an empty cell the following function:
In this example we have used the formula for calculate the GCD of the numbers 36, 60 and 24and 12 is the result.
Excel allows calculating the greatest common divisor of two numbers as a minimum, although if we wish, we can find the GCD of up to 255 values.