Change language

Learn to calculate by playing with GCD calculator

A short game to see where the result comes from. Pick a language and start; you can stop halfway and come back.

Loading the game…

← Back to GCD calculator

What you will practise

Find the GCD of two or more whole numbers using Euclid’s algorithm.

How it works

Euclid's algorithm is applied: the pair (a, b) is replaced by (b, remainder of a divided by b) until the remainder is zero. The last non-zero divisor is the GCD.

With more than two numbers the calculation is done pairwise and accumulated.

Formula

gcd(a, b) = gcd(b, a mod b)

gcd(a, 0) = a

gcd(a, b, c) = gcd(gcd(a, b), c)

Worked example

GCD of 48, 60 and 72

1. gcd(48, 60): 60 = 48 + 12 → gcd(48, 12) = 12
2. gcd(12, 72) = 12

Result: 12

How to play

First pick your language. Then work through the challenges one by one: each sets out a case with real numbers and, if you get stuck, you can ask for a hint. When you answer, you see whether you got it right and why. Progress is saved only in your browser, so you can stop halfway and carry on another day.