GCD and LCM Calculator – Greatest Common Divisor (HCF) With Steps
common.you_need_to_be_loggedin_to_add_tool_in_favorites
Find the GCD (HCF) and LCM of up to 20 numbers, with the Euclidean algorithm and prime factors shown.
En Büyük Ortak Bölen (EBOB)
6
En Küçük Ortak Kat (EKOK)
180
Asal çarpanlar
- 12 = 2² × 3
- 18 = 2 × 3²
- 30 = 2 × 3 × 5
En Büyük Ortak Bölen'e bölünmüş: 2 : 3 : 5
Öklid algoritması (12, 18)
- 18 = 1 × 12 + 6
- 12 = 2 × 6 + 0
İçindekiler
The GCD and LCM calculator finds the greatest common divisor and the least common multiple of up to 20 whole numbers and shows the working. For 12, 18 and 30 the GCD is 6 and the LCM is 180. The GCD is also called the highest common factor (HCF) or greatest common factor (GCF).
How to use it
- Type the numbers separated by commas or spaces.
- Read the GCD and LCM, each number's prime factors, and the Euclidean algorithm steps for the first two numbers.
How to find the GCD
Euclidean algorithm: divide the larger number by the smaller and keep the remainder; repeat with the smaller number and the remainder until the remainder is 0. The last non-zero remainder is the GCD. For 48 and 18: 48 = 2 × 18 + 12, 18 = 1 × 12 + 6, 12 = 2 × 6 + 0, so the GCD is 6.
Prime factors: the GCD is the product of the primes the numbers share, each at its lowest power. 12 = 2² × 3 and 18 = 2 × 3², so the GCD is 2 × 3 = 6.
How to find the LCM
For two numbers, LCM = (a × b) ÷ GCD. For 12 and 18, that is 216 ÷ 6 = 36. With prime factors, take every prime at its highest power: 2² × 3² = 36. For more numbers, apply the rule pair by pair.
What they are used for
- Simplifying fractions and ratios: divide by the GCD. The calculator shows the reduced ratio, for example 12 : 18 : 30 becomes 2 : 3 : 5.
- Adding fractions: the LCM of the denominators is the lowest common denominator.
- Scheduling: two events every 12 and 18 days fall on the same day every 36 days.
Related: prime number checker, decimal to fraction and the percentage calculator.
Sıkça sorulan sorular
What is the GCD of 12 and 18?
The GCD of 12 and 18 is 6, and their LCM is 36.
Is GCD the same as HCF and GCF?
Yes. Greatest common divisor, highest common factor and greatest common factor are three names for the same number.
What is the formula linking GCD and LCM?
For two positive whole numbers, GCD(a, b) × LCM(a, b) = a × b.
What is the GCD of numbers with no common factor?
1. Such numbers are called coprime, and their LCM is simply their product.
How large can the numbers be?
Each number can be up to one quadrillion (10^15). If the LCM is too large to show exactly, the calculator says so.