GCD Calculator
Find the greatest common divisor (GCD) of two whole numbers quickly and easily.
How this calculator works
The GCD Calculator finds the largest positive whole number that divides both numbers without leaving a remainder.
Table of Contents

GCD Calculator – Find the Greatest Common Divisor Easily
Our free GCD Calculator helps you find the greatest common divisor of two or more whole numbers quickly and accurately. Whether you are simplifying fractions, solving mathematics problems, or studying number theory, understanding common divisors makes calculations easier.
The greatest common divisor is one of the most useful concepts in elementary mathematics. It helps identify the largest positive integer that divides a set of numbers without leaving a remainder.
You can calculate it using several methods, including listing factors, prime factorization, and the Euclidean algorithm.
What Is a GCD Calculator?
A GCD Calculator is an online mathematical tool that determines the greatest common divisor of two or more integers.
The greatest common divisor is also called the greatest common factor (GCF) or highest common factor (HCF).
For example, consider the numbers 12 and 18.
Factors of 12:
1, 2, 3, 4, 6, 12
Factors of 18:
1, 2, 3, 6, 9, 18
The common factors are:
1, 2, 3, 6
The greatest common factor is 6.
Therefore:
GCD(12, 18) = 6
How to Use the GCD Calculator
Follow these three simple steps:
Step 1: Enter the whole numbers you want to compare.
Step 2: Start the calculation using the available button.
Step 3: Review the greatest common divisor displayed in the result.
For example, suppose you enter:
24 and 36
Their common divisors include 1, 2, 3, 4, 6, and 12.
The greatest is 12.
Answer: GCD(24, 36) = 12
Method 1: Find the GCD by Listing Factors
Listing factors is a straightforward method for smaller numbers.
Example: Find the GCD of 16 and 24
First, list the positive factors of each number.
Factors of 16:
1, 2, 4, 8, 16
Factors of 24:
1, 2, 3, 4, 6, 8, 12, 24
Identify the common factors:
1, 2, 4, 8
The greatest common factor is 8.
GCD(16, 24) = 8
This method is easy to understand, but listing all factors can become time-consuming for large numbers.
Method 2: Find the GCD Using Prime Factorization
Prime factorization expresses a number as a product of prime numbers.
To find the greatest common divisor, identify the prime factors shared by both numbers and multiply them using the smallest exponent appearing in each factorization.
Example: Find the GCD of 36 and 60
Prime factorization of 36:
36 = 2² × 3²
Prime factorization of 60:
60 = 2² × 3 × 5
The common prime factors are:
2² × 3
Multiply them:
4 × 3 = 12
GCD(36, 60) = 12
Prime factorization is especially useful for understanding how numbers are related.
Method 3: Find the GCD Using the Euclidean Algorithm
The Euclidean algorithm is an efficient way to calculate the greatest common divisor of two integers.
It repeatedly replaces the larger number with the remainder obtained from division until the remainder becomes zero.
The last nonzero remainder is the greatest common divisor.
Example: Find the GCD of 48 and 18
Divide 48 by 18:
48 = 18 × 2 + 12
Next, divide 18 by 12:
18 = 12 × 1 + 6
Then divide 12 by 6:
12 = 6 × 2 + 0
The final nonzero remainder is 6.
Therefore:
GCD(48, 18) = 6
The Euclidean algorithm is especially helpful when working with large numbers.
How to Find the GCD of Three Numbers
You can calculate the greatest common divisor of three or more numbers by working with two numbers at a time.
For example, find the GCD of 24, 36, and 60.
First:
GCD(24, 36) = 12
Next:
GCD(12, 60) = 12
Therefore:
GCD(24, 36, 60) = 12
The same approach can be extended to larger groups of numbers.
GCD Examples Table
The following table shows common calculations.
| First Number | Second Number | GCD |
|---|---|---|
| 8 | 12 | 4 |
| 10 | 15 | 5 |
| 12 | 18 | 6 |
| 16 | 24 | 8 |
| 18 | 30 | 6 |
| 20 | 28 | 4 |
| 24 | 36 | 12 |
| 27 | 45 | 9 |
| 36 | 48 | 12 |
| 40 | 60 | 20 |
| 48 | 72 | 24 |
| 54 | 81 | 27 |
These examples help demonstrate how the greatest common divisor changes depending on the numbers being compared.
Why Is the Greatest Common Divisor Important?
Simplifying Fractions
One of the most common applications is reducing fractions to their simplest form.
For example:
24/36
The greatest common divisor of 24 and 36 is 12.
Divide both the numerator and denominator by 12:
24 ÷ 12 = 2
36 ÷ 12 = 3
Therefore:
24/36 = 2/3
Dividing Items into Equal Groups
Common divisors help determine how to divide items into identical groups without leftovers.
For example, suppose you have 24 pencils and 36 notebooks.
If every group must contain the same number of pencils and the same number of notebooks, you can create 12 groups.
Each group receives:
24 ÷ 12 = 2 pencils
36 ÷ 12 = 3 notebooks
Finding Equal-Length Sections
Suppose two ropes measure 48 meters and 60 meters.
You want to cut both ropes into equal-length pieces without waste.
The greatest possible whole-number length is:
GCD(48, 60) = 12
Each piece can measure 12 meters.
Solving Mathematics Problems
Greatest common divisors are useful in algebra, fractions, ratios, and number theory.
They also appear in algorithms and computer programming.
GCD vs. LCM: What Is the Difference?
The greatest common divisor and least common multiple describe different mathematical relationships.
GCD: The largest positive integer that divides each given number exactly.
LCM: The smallest positive integer that is a multiple of every given number.
For example, consider 12 and 18.
GCD(12, 18) = 6
LCM(12, 18) = 36
For two positive integers, the following relationship holds:
GCD(a, b) × LCM(a, b) = a × b
Using the example:
6 × 36 = 12 × 18
216 = 216
This identity is useful for checking calculations.
What Are Coprime Numbers?
Two integers are coprime when their greatest common divisor is 1.
For example:
GCD(8, 15) = 1
Although 8 and 15 are not both prime numbers, they do not share any positive divisor greater than 1.
Therefore, they are coprime.
Coprime numbers are important in fractions, modular arithmetic, and number theory.
Special Cases in GCD Calculations
When Both Numbers Are Equal
If both numbers are the same nonzero integer, the greatest common divisor is its absolute value.
For example:
GCD(25, 25) = 25
When One Number Is 1
The greatest common divisor of 1 and any integer is 1.
For example:
GCD(1, 100) = 1
When One Number Is Zero
For any nonzero integer a:
GCD(a, 0) = |a|
For example:
GCD(18, 0) = 18
The value GCD(0, 0) is conventionally undefined in many elementary mathematics settings.
When Numbers Are Negative
The greatest common divisor is normally reported as a nonnegative value.
For example:
GCD(-12, 18) = 6
Understanding the greatest common divisor is useful when simplifying fractions and solving number problems. Another important mathematical concept is the least common multiple, which helps identify shared multiples of numbers. Try our free LCM Calculator to calculate the least common multiple quickly and easily.
Common Mistakes When Finding the GCD
Confusing Factors with Multiples
A factor divides a number exactly, while a multiple is produced by multiplying that number by an integer.
Choosing the Smallest Common Factor
The objective is to find the greatest positive common factor, not the smallest.
Missing Prime Factors
When using prime factorization, include only the prime factors shared by all the numbers.
Forgetting to Check Divisibility
The result must divide every given number without leaving a remainder.
Confusing GCD with LCM
These calculations answer different questions and should not be used interchangeably.
Frequently Asked Questions
What does GCD mean?
GCD stands for greatest common divisor.
Is GCD the same as GCF?
Yes. Greatest common divisor and greatest common factor describe the same concept.
What is the GCD of 12 and 18?
The answer is 6.
What is the GCD of 24 and 36?
The answer is 12.
What is the GCD of 8 and 15?
The answer is 1 because the numbers are coprime.
How do I find the GCD of large numbers?
The Euclidean algorithm is an efficient method.
Can three numbers have a GCD?
Yes. Calculate the greatest common divisor of two numbers, then compare the result with the next number.
Can I use GCD to simplify fractions?
Yes. Divide the numerator and denominator by their greatest common divisor.
Is the GCD always smaller than both numbers?
No. If one positive number divides the other, the smaller number is the GCD.
For example:
GCD(6, 18) = 6
What is the difference between GCD and LCM?
GCD finds the greatest shared divisor, while LCM finds the smallest shared positive multiple.
Understanding factors and divisibility is an important part of mathematics. These concepts help with simplifying fractions, solving number problems, and learning number theory. To explore additional explanations and practice exercises, visit Khan Academy’s arithmetic lessons.
Final Thoughts
Understanding common divisors helps with fraction simplification, equal grouping, number theory, and many everyday mathematics problems.
You can find the greatest common divisor by listing factors, using prime factorization, or applying the Euclidean algorithm.
For larger numbers, the Euclidean algorithm is generally the most efficient manual method.
Use our free GCD Calculator to find common divisors quickly and check your calculations.