Skip to content
ToolZone

GCD / LCM Calculator

Find the greatest common divisor and least common multiple of two or more numbers, useful for simplifying fractions or scheduling problems.

Runs in your browser. Nothing you enter or upload leaves your device.

GCD
6
LCM
180

Keyboard shortcuts

Run the main action
⌘ / Ctrl + Enter
Copy the result
⌘ / Ctrl + Shift + Enter
Download the result
⌘ / Ctrl + S
Paste a file or image into file tools
⌘ / Ctrl + V
Search all tools
⌘ / Ctrl + K
Show these shortcuts
?

You can also drop files anywhere on the page.

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. 1

    Type at least two whole numbers into the Numbers field, separated by commas.

  2. 2

    Read the GCD and LCM in the two result cards.

  3. 3

    Click the copy button under either result to copy it.

Worked examples

Three numbers

The default example.

Input
12, 18, 30
Result
GCD 6, LCM 180

Simplifying a fraction

Reducing 48/180.

Input
48, 180
Result
GCD 12, LCM 720

Divide top and bottom by 12 to get 4/15.

Common denominator

Adding 1/4 + 1/6 + 1/10.

Input
4, 6, 10
Result
GCD 2, LCM 60

Rewrite as 15/60 + 10/60 + 6/60 = 31/60.

Repeating schedules

Three alarms ring every 15, 20, and 25 minutes.

Input
15, 20, 25
Result
GCD 5, LCM 300

All three ring together every 300 minutes, or 5 hours.

Limitations
Decimals are silently truncated (2.5 becomes 2) and non-numeric entries are skipped without a warning. Very large LCMs, above about 9 × 10^15, lose precision because standard numbers are used. Only the results are shown, not the step-by-step working or prime factorizations.
Assumptions
GCD and LCM are reported as non-negative values.
Privacy
Calculations run in your browser and the numbers you enter are not sent or saved.

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.

Related tools