About the GCD / LCM Calculator
The GCD / LCM Calculator finds the greatest common divisor and the least common multiple of a list of whole numbers in one step. Type two or more numbers separated by commas, such as 12, 18, 30, and both results appear side by side. It is a quick helper for fraction homework, scheduling puzzles, and number theory practice.
How it works
The GCD is found with the Euclidean algorithm: replace the pair (a, b) with (b, a mod b) until the remainder is zero; the last non-zero value is the GCD. For 48 and 180: (48, 180) → (180, 48) → (48, 36) → (36, 12) → (12, 0), so the GCD is 12. This is far faster than listing all factors, even for large numbers.
The LCM of two numbers uses the identity LCM(a, b) = |a × b| / GCD(a, b). For a longer list, both operations are applied cumulatively from left to right: GCD(12, 18, 30) = GCD(GCD(12, 18), 30) = GCD(6, 30) = 6, and the LCM works the same way. If any number is 0, the LCM is 0. Entries that aren't numbers are skipped, and decimals are cut to their whole-number part.
How to use
- 1
Type at least two whole numbers into the Numbers field, separated by commas.
- 2
Read the GCD and LCM in the two result cards.
- 3
Click the copy button under either result to copy it.
Worked examples
Three numbers
The default example.
Simplifying a fraction
Reducing 48/180.
Divide top and bottom by 12 to get 4/15.
Common denominator
Adding 1/4 + 1/6 + 1/10.
Rewrite as 15/60 + 10/60 + 6/60 = 31/60.
Repeating schedules
Three alarms ring every 15, 20, and 25 minutes.
All three ring together every 300 minutes, or 5 hours.
Frequently asked questions
What is the greatest common divisor used for?+
It's commonly used to simplify fractions to lowest terms by dividing the numerator and denominator by their GCD, and to split quantities into the largest equal groups.
What is the least common multiple used for?+
It's used to find a common denominator when adding or subtracting fractions, and to work out when repeating cycles, such as bus timetables or alarms, line up again.
Is GCD the same as GCF or HCF?+
Yes. Greatest common divisor, greatest common factor, and highest common factor are three names for the same thing.
Can I enter more than two numbers?+
Yes. Enter as many comma-separated whole numbers as you like; the calculator combines them one after another.
What happens if one of the numbers is 0?+
The LCM becomes 0, and the GCD equals the GCD of the remaining numbers, since every integer divides 0.