LCM & GCF Calculator
Find the least common multiple and greatest common factor of 2 to 50 whole numbers. Shows the prime factorization of every value and how the GCF and LCM are built from it, with exact arithmetic and clear handling of negatives.
Find the least common multiple and greatest common factor of 2 to 50 whole numbers. Shows the prime factorization of every value and how the GCF and LCM are built from it, with exact arithmetic and clear handling of negatives.
LCM & GCF Calculator finds the least common multiple and the greatest common factor (also called the greatest common divisor or highest common factor) of a list of whole numbers. Enter 2 to 50 values separated by commas, spaces, tabs or new lines.
The tool shows the prime factorization of every value, then builds the GCF from the primes shared by all values at their lowest powers and the LCM from every prime at its highest power. Both results are cross-checked with the Euclidean algorithm, and the LCM is computed with exact BigInt arithmetic so even long results are exact. Negative numbers are treated by their absolute value, because the GCF and LCM are conventionally positive. Zero and decimals are rejected.
The greatest common factor is the largest whole number that divides every value exactly. The least common multiple is the smallest positive whole number that every value divides into exactly.
The GCF multiplies the primes shared by all values, each at its lowest power. The LCM multiplies every prime that appears in any value, each at its highest power.
They are replaced by their absolute values. −12 has the same factors as 12, and the GCF and LCM are conventionally given as positive numbers. The results note when this happened.
Every number divides 0, so it adds nothing to the GCF, and the LCM is not defined when one of the values is 0. Remove zeros from the list.
Between 2 and 50 values, each a non-zero whole number up to 1,000,000,000,000 in size. Values beyond that are rejected with a message.
Yes. Factorization and the GCF use exact whole-number arithmetic within JavaScript’s safe-integer range, and the LCM uses BigInt, so it is exact even when it has hundreds of digits. Both are cross-checked with the Euclidean algorithm.
No — commas are treated as separators, so 1,000 would be read as 1 and 000. Type 1000 instead.
No. Every calculation runs in your browser on your device. Inputs, settings and results are not uploaded and are not saved in browser storage. Reset clears them from the page.