The greatest common divisor (GCD) of two or more numbers is the largest number that divides all of them exactly, leaving no remainder. Put another way, it is the biggest divisor those numbers share. It is one of the first number-theory ideas kids learn at school, and it keeps showing up whenever a fraction needs simplifying or a set of objects needs splitting into equal parts. For example, the GCD of 12 and 18 is 6.
How to calculate the GCD of 12 and 18
One simple way is to list every divisor of each number and pick the largest one they share:
- Divisors of 12: 1, 2, 3, 4, 6, 12
- Divisors of 18: 1, 2, 3, 6, 9, 18
The largest divisor that appears in both lists is 6, so the GCD of 12 and 18 is 6. Another way is to break each number into prime factors: 12 = 2²×3 and 18 = 2×3²; the GCD is found by multiplying the shared factors at their lowest exponent, which gives 2×3 = 6. Do not confuse the GCD with the least common multiple (LCM), which looks for the smallest shared multiple rather than the largest shared divisor. These are opposite operations, usually taught side by side.

The Euclidean algorithm: another way to find the GCD
When numbers get large, breaking them into prime factors can take a while. The Euclidean algorithm is a faster shortcut: divide the larger number by the smaller one and note the remainder; then repeat the process using the previous divisor and that remainder, again and again, until the remainder reaches 0. The last divisor used before hitting a remainder of 0 is the GCD.
For example, to find the GCD of 48 and 18: 48 ÷ 18 = 2 with remainder 12; then 18 ÷ 12 = 1 with remainder 6; then 12 ÷ 6 = 2 with remainder 0. Since the remainder reached 0, the last divisor used (6) is the GCD of 48 and 18. This is the method calculators and computer programs actually use, because it works for any pair of numbers, however large, without needing their prime factors first.
Why does the GCD matter for kids?
The most common use of the GCD is to simplify fractions: to reduce 12/18 to its simplest form, divide both the numerator and denominator by their GCD (6), leaving 2/3. It also helps solve sharing problems, such as figuring out the largest number of equal groups a set of objects can be split into with nothing left over, or the biggest square tile size that covers a rectangular floor without cutting any piece.
An everyday example: if you have 24 cookies and 36 candies and want to make identical gift bags with nothing left over, the GCD of 24 and 36 (which is 12) tells you that you can make at most 12 bags, each with 2 cookies and 3 candies.
The GCD is learned in elementary school, around 5th or 6th grade, alongside the LCM, and stays useful throughout middle school whenever fractions or exact-sharing problems come up. Want your child to master math step by step? Book a free masterclass with an Algonova teacher.
Worked GCD examples
These examples show how to calculate the GCD with two and with three numbers using prime factors. Break down each number and keep every shared factor at its lowest exponent.
- GCD of 24 and 36: 24 = 2³×3 and 36 = 2²×3², so the GCD is 2²×3 = 12.
- GCD of 18, 24 and 30: 18 = 2×3², 24 = 2³×3 and 30 = 2×3×5, so the only shared factor is 2×3 = 6.
- GCD of 7 and 15: since they share no prime factor, the GCD is 1 (they are coprime).
The rule is to keep only the prime factors that repeat across every number, each raised to its lowest exponent. If nothing repeats, the GCD is 1. To practice the GCD with problems and games guided by a teacher, try a free coding class or check out Algonova's coding course for kids.




