GCF tiles a rectangle
The greatest common factor is the side length of the largest square that perfectly tiles a rectangle with your two numbers as side lengths—no scraps left over.
LCM is reported as non-negative. If any input exceeds 9,007,199,254,740,991 (253−1), the calculator switches to BigInt mode automatically.
We use the Euclidean Algorithm for GCF/HCF and the identity \( \mathrm{LCM}(a,b)=\dfrac{|a\cdot b|}{\gcd(a,b)} \). For many numbers \(a_1,\dots,a_n\), we reduce pairwise: \( \gcd(a_1,\dots,a_n)=\gcd(\dots\gcd(a_1,a_2),\dots,a_n) \) and \( \mathrm{LCM}(a_1,\dots,a_n)=\mathrm{LCM}(\dots\mathrm{LCM}(a_1,a_2),\dots,a_n) \).
BigInt arithmetic.Commas, spaces, or new lines. Extra whitespace is ignored.
Yes. We use absolute values for GCF/LCM. Zeros are allowed; if any number is zero, the LCM of the list is zero.
Then GCF = |n| and LCM = |n|.
Everything runs in your browser; nothing is uploaded.
The greatest common factor is the side length of the largest square that perfectly tiles a rectangle with your two numbers as side lengths—no scraps left over.
Bus every 12 minutes and train every 18? They line up every 36 minutes—that’s the LCM at work. Any repeating schedules reunite at their least common multiple.
For any two non-zero integers, gcd(a,b) × lcm(a,b) = |a·b|. If your results break that identity, something went wrong.
GCF grabs the overlap of prime factors; LCM grabs the union. They’re two sides of the same prime “fingerprint” of your numbers.
Euclid’s algorithm for GCF is 2,300+ years old and still near-optimal. The subtraction-only version even works on paper without division.