🔢

GCD & LCM Calculator

Find the Greatest Common Divisor (GCD/GCF/HCF) and Least Common Multiple (LCM) of 2 or more integers via Euclidean algorithm.

MATH

Find the Greatest Common Divisor (GCD, also called GCF or HCF) and Least Common Multiple (LCM) of two or more integers using the Euclidean algorithm.

Identity: gcd(a, b) × lcm(a, b) = a × b. For 3+ numbers, both are computed iteratively: gcd(a, b, c) = gcd(gcd(a, b), c). The Euclidean algorithm is one of the oldest known algorithms — repeatedly replace the larger number with its remainder mod the smaller until you hit zero.

Disclaimer: Integers must fit in JavaScript's safe range (±2⁵³). For arbitrary precision, use BigInt.

GCD & LCM Calculator

Find the Greatest Common Divisor (GCD, also called GCF or HCF) and Least Common Multiple (LCM) of 2 or more integers using the Euclidean algorithm.

Positive integers. Zero is ignored.
Results for 24, 36, 60
GCD (Greatest Common Divisor)12
LCM (Least Common Multiple)360

GCD reduction steps

  • gcd(24, 36) = 12
  • gcd(12, 60) = 12

LCM steps

  • lcm(24, 36) = 72
  • lcm(72, 60) = 360

Identity

For two positive integers: gcd(a, b) × lcm(a, b) = a × b. For 3+ numbers, both are computed iteratively: gcd(a, b, c) = gcd(gcd(a, b), c).

Algorithm uses Euclidean reduction. Integers must fit in JavaScript's safe range (±2⁵³). For arbitrary precision, use BigInt.

Frequently Asked Questions

What is the GCD & LCM Calculator for?
Find the Greatest Common Divisor (GCD, also called GCF or HCF) and Least Common Multiple (LCM) of two or more integers using the Euclidean algorithm.
How do I use the GCD & LCM Calculator?
Identity: gcd(a, b) × lcm(a, b) = a × b. For 3+ numbers, both are computed iteratively: gcd(a, b, c) = gcd(gcd(a, b), c). The Euclidean algorithm is one of the oldest known algorithms — repeatedly replace the larger number with its remainder mod the smaller until you hit zero.
How accurate are my gcd & lcm results?
Integers must fit in JavaScript's safe range (±2⁵³). For arbitrary precision, use BigInt.
Is the GCD & LCM Calculator free to use?
Yes - every calculator on WhichCalc is completely free with no signup, no usage limits, and no tracking on the calculation itself. Results display instantly in your browser and your inputs are never sent to a server. Bookmark the page if you use this calculator regularly.