vmbo havo vwo
GCD and LCM calculator
Quick answer
The gcd (greatest common divisor; Dutch: GGD) is the largest whole number that divides both values. The lcm (least common multiple; Dutch: KGV) is the smallest positive common multiple.
For 12 and 18: gcd = 6 (because 18 = 1 × 12 + 6, then 12 = 2 × 6 + 0). lcm = |12 × 18| ÷ 6 = 36.
Calculator
Two whole numbers of 0 or greater. gcd(0, 5) = 5; gcd(0, 0) is not defined. Choose gcd or lcm mode; the steps use Euclid’s algorithm (division with remainder).
What are gcd and lcm?
The gcd of two whole numbers is the largest number that divides both. Factorising: 12 = 2 × 2 × 3 and 18 = 2 × 3 × 3 share 2 × 3 = 6. In class you usually use division with remainder (Euclid): keep dividing until the remainder is 0; the last divisor is the gcd.
The lcm is the smallest positive number that is a multiple of both. Formula: lcm(a, b) = |a × b| ÷ gcd(a, b). That is the same gcd you use when you simplify a fraction.
| Question in the exercise | Choose | School example |
|---|---|---|
| Write as small as possible / common factor | gcd | 12/18 → divide by 6 → 2/3 |
| Least common denominator / “when again at the same time” | lcm | 1/2 + 1/3 → denominator 6; buses every 12 and 18 min → 36 |
Three numbers: first gcd of the first pair, then gcd of that result and the third. No separate mode here.
Examples by level
Dutch secondary tracks appear as badges here once: vmbo (practical), havo (middle), vwo (pre-university). Euclid and the lcm formula stay the same; only the examples get denser.
gcd of 12 and 18
- Order18 and 12
- First remainder18 = 1 × 12 + 6
- Second remainder12 = 2 × 6 + 0
- gcd6
lcm of 12 and 18
- gcd6, as above
- Product12 × 18 = 216
- Divide216 ÷ 6 = 36
36 is a multiple of 12 and of 18, and the smallest positive one.
gcd(0, 5) and gcd(0, 0)
- One zeroEvery integer divides 0. The gcd of 0 and 5 is 5.
- Two zerosThere is no greatest common divisor. The tool rejects that input.
Common mistakes
Wrong
Mixing gcd and lcm: calling 36 the gcd of 12 and 18.
Right
gcd is smaller (or equal): 6. lcm is larger (or equal): 36.
Wrong
Taking the lcm as a + b, or as the product without dividing by the gcd.
Right
First gcd, then |a × b| ÷ gcd. 216 ÷ 6 = 36, not 216.
Wrong
Entering decimals, such as 12.5.
Right
gcd and lcm belong to whole numbers. Use an integer of 0 or greater.
Wrong
Writing gcd(0, 0) as 0 or as 1.
Right
gcd(0, 0) is not defined. gcd(0, 5) = 5 is fine.
Practice
vmbo What is gcd(8, 12)?
4
12 = 1 × 8 + 4, then 8 = 2 × 4 + 0.
vmbo What is lcm(8, 12)?
24
8 × 12 = 96, 96 ÷ 4 = 24.
havo Simplify 12/18. Which gcd do you use?
6, so 2/3
Divide numerator and denominator by gcd(12, 18) = 6. Same gcd as above; the fraction calculator does that internally.
havo gcd(0, 9)?
9
One number is 0; the gcd is the other number.
vwo gcd of 12, 18 and 30. How do you handle three numbers?
6
gcd(12, 18) = 6, then gcd(6, 30) = 6. No separate mode: two steps in a row.
In class
On vmbo, gcd is mainly for simplifying fractions and “equal pieces”. lcm returns as the least common denominator. Division with remainder is the same operation as on the division with remainder calculator.
GCD and LCM are in this one calculator: it is about the same two whole numbers, and the two answers are linked through the GCD.
Next step
- How does this work? The explanation and examples are further up this page.
Learning path
- Related: Fraction calculator · Division with remainder
Frequently asked questions
How do you find the gcd of 12 and 18?
18 = 1 × 12 + 6, 12 = 2 × 6 + 0. gcd = 6.
How do you find the lcm?
lcm = |a × b| ÷ gcd. 12 × 18 = 216, 216 ÷ 6 = 36.
What is gcd(0, 5)?
5. gcd(0, 0) is not defined.
How does gcd appear in fractions?
Simplifying divides numerator and denominator by their gcd. Open the fraction calculator.
When do you choose gcd and when lcm?
Use gcd to simplify or pull out a common factor. Use lcm for the least common denominator or “when do they meet again”.