na.to.
📚 All keywords › 🧰 Free Web Tools › Finding the GCD and LCM: the Euclidean algorithm and uses
KO EN
🔢

Finding the GCD and LCM: the Euclidean algorithm and uses

Finding the greatest common divisor and least common multiple by prime factorisation and the Euclidean algorithm, their link to the product, and everyday uses.

📚 Free Web Tools · 32/52· ⏱ About 3min read ·Information updated 2026-11-03
📋 Key facts5
GCD
The largest number that divides both numbers
LCM
The smallest common multiple of both numbers
Relation
GCD × LCM = product of the two numbers
Euclidean algorithm
Repeatedly replace the larger number with the remainder
This tool
Two whole numbers from 1 to 100,000,000, with working shown

Start with the definitions

A divisor divides a number exactly; a multiple is that number times a whole number. The divisors of 48 are 1, 2, 3, 4, 6, 8, 12, 16, 24 and 48, and those of 18 are 1, 2, 3, 6, 9 and 18. The common ones are 1, 2, 3 and 6, and the largest, 6, is the greatest common divisor. Of the common multiples 144, 288, 432 …, the smallest, 144, is the least common multiple.

Using prime factorisation

Factorised, 48 = 2⁴ × 3 and 18 = 2 × 3². The GCD multiplies the shared primes at their lower powers, 2 × 3 = 6; the LCM multiplies every prime that appears at its higher power, 2⁴ × 3² = 144. This is intuitive for small numbers, but factorising large numbers is itself hard.

The Euclidean algorithm

The GCD of two numbers equals the GCD of the smaller number and the remainder when the larger is divided by the smaller. Repeat the division until the remainder is 0; the last divisor is the GCD. This old method appears in Euclid's Elements, written more than two thousand years ago, and needs only a few divisions with no factorising. The number of divisions never exceeds five times the number of digits in the smaller number, so it finishes quickly even for large numbers.

  • 48 = 18 × 2 + 12
  • 18 = 12 × 1 + 6
  • 12 = 6 × 2 + 0 → GCD 6

Get the LCM from the product

The GCD times the LCM equals the product of the two numbers, so the LCM is the product divided by the GCD: 48 × 18 = 864 and 864 ÷ 6 = 144. For three or more numbers, work in pairs. For 4, 6 and 10, first find the LCM of 4 and 6, which is 12, then the LCM of 12 and 10, which is 60.

Where they are used

To simplify a fraction, divide top and bottom by the GCD: 48/18 divided by 6 becomes 8/3. To add fractions with different denominators, use the LCM as the common denominator. They also line up cycles: a task every 6 days and another every 8 days fall on the same day every 24 days, the LCM (example). To split a 48 by 18 rectangle into equal squares with no gaps, the largest square has a side of 6, the GCD.

Coprime numbers

Two numbers whose GCD is 1 are called coprime. Numbers such as 8 and 15 can be coprime even though neither is prime, and their LCM is simply their product, 120. A fraction in lowest terms is one whose numerator and denominator are coprime. Two consecutive whole numbers, such as 9 and 10, are always coprime.

This site's calculator

The GCD and LCM calculator takes two whole numbers from 1 to 100,000,000, finds their GCD and LCM, and shows each division step of the Euclidean algorithm line by line. Even when the product of the two numbers is very large, it calculates the LCM exactly to the last digit. It is handy for checking a solution you worked out by hand.

Summary

Remember how the two relate and the arithmetic becomes simple.

  • GCD: the largest common divisor
  • LCM: the smallest common multiple
  • Euclidean algorithm: divide until the remainder is 0
  • LCM = product of the two numbers ÷ GCD
  • GCD to simplify fractions, LCM for common denominators

🔗 More in this category

🧰 Related tools

🌍 Search the web for this

Each button runs this keyword on that search engine