← Math & statistics

GCD & LCM Calculator

Use commas or spaces to separate up to 32 integers.

Paste a list of integers to find their greatest common divisor via Euclid’s algorithm and the least common multiple via successive reduction.

Other languages 日本語 | English | 简体中文 | 繁體中文 | 繁體中文(香港) | Español | Español (México) | Português (Brasil) | Português (Portugal) | Bahasa Indonesia | Tiếng Việt | 한국어 | Français | Deutsch | Italiano | Русский | हिन्दी | العربية | বাংলা | اردو | Türkçe | ไทย | Polski | Filipino | Bahasa Melayu | فارسی | Nederlands | Українська | עברית | Čeština
Embed this calculator

Input integers

Use commas or spaces to separate up to 32 integers.

Example: 12, 18, 24 or 64 48 16. Negative values and zeros are allowed.

Results

Greatest common divisor (GCD)
Enter integers
Least common multiple (LCM)
Enter integers

FAQ

How many integers can I enter at once?

You can enter up to 32 integers separated by commas or spaces.

Can I include negative numbers or zero?

Yes. Zero yields an LCM of zero and signs are ignored when calculating the GCD and LCM.

How does this calculator find the GCD?

It applies Euclid's algorithm to absolute integer values. For a list, the calculator reduces the numbers one pair at a time until one greatest common divisor remains.

How is the LCM calculated for several numbers?

It combines each pair with lcm(a, b) = |a x b| / gcd(a, b). If any input is zero, the LCM is zero; if a result grows beyond the supported range, the calculator shows an overflow warning.

What should I check before comparing with another tool?

Use the same integer list and confirm how signs and zeros are handled. Some tools reject zero or keep negative signs in intermediate displays, while this page ignores signs for divisibility and reports a non-negative GCD and LCM.

How to use GCD & LCM Calculator effectively

What this calculator does

Paste up to 32 integers to compute their greatest common divisor and least common multiple. The GCD uses the Euclidean algorithm, and the LCM is built by reducing the list pair by pair with the current GCD.

Input meaning

Enter whole numbers separated by commas or spaces. Negative signs are ignored for divisibility, zero is accepted, and the LCM becomes zero whenever any input is zero.

Use-case sequence

Start with the smallest set you need to check, such as two denominators or two repeating cycle lengths. Add more values only after the first GCD and LCM match your expectation, then copy the result URL for notes or classroom review.

Common mistakes to avoid

Interpretation guidance

Use the GCD when you need the largest shared factor, such as reducing a fraction. Use the LCM when you need the first shared multiple, such as aligning repeating intervals. For a proof-style walkthrough, open the steps version linked below.