LCM and GCD Calculator

Find the Least Common Multiple and Greatest Common Divisor of up to 10 numbers

Enter Numbers

LCM and GCD Explained

The Greatest Common Divisor (GCD), also called the Highest Common Factor (HCF), is the largest number that divides all given numbers exactly. The Least Common Multiple (LCM) is the smallest number that is a multiple of all given numbers.

Methods and Formulas

Real-World Uses

GCD: Simplifying fractions (divide numerator and denominator by GCD). Distributing items equally. Finding the largest tile that fits a floor without cutting.

LCM: Finding when two events with different periods coincide (e.g. two buses with different intervals). Adding fractions (finding the common denominator). Scheduling problems.

Note: Inputs must be positive integers. Very large numbers may produce LCM values beyond standard display range.

// Key Relationship

For any two numbers a and b: LCM(a,b) × GCD(a,b) = a × b. This is a handy way to find LCM if you know the GCD.

// Fractions

To add fractions, use the LCM of the denominators as the common denominator. The GCD of the numerator and denominator simplifies fractions.

// Co-prime Numbers

If GCD(a,b) = 1, the numbers are "co-prime" (relatively prime). Their LCM equals their product: LCM = a × b.

// Euclidean Algorithm

The Euclidean algorithm is one of the oldest known algorithms. It finds the GCD by repeatedly dividing — far faster than prime factorization for large numbers.