Skip to content
🔗

GCD and LCM Calculator

Find the greatest common divisor and lowest common multiple of two numbers.

Runs in your browser

Updated

GCD (greatest common divisor)

6

LCM (lowest common multiple)

144

Simplified fraction

8/3

Prime factors

48 = 2^4 x 3 ; 18 = 2 x 3^2

Euclid for the divisor, multiplication for the multiple

The greatest common divisor is found by repeated remainder: divide the larger number by the smaller, replace the pair with the divisor and remainder, and stop when the remainder is zero. The least common multiple is the absolute product divided by that divisor. Both inputs are truncated to whole numbers first, so 48.9 is treated as 48 rather than rejected.

A worked example

For 48 and 18 the remainders are 12 and then 6, so the GCD is 6. The LCM is 864 divided by 6, which is 144. The same pair simplifies to 8 over 3, and the prime factorisation is listed as 2 to the fourth times 3 for 48 and 2 times 3 squared for 18.

What the extra panels show

Beyond the two answers, the page simplifies the first number over the second, lists prime factors by trial division up to the square root, and prints each Euclidean step so the arithmetic can be checked by hand. Prime factorisation is slow for very large inputs but fine for ordinary school and engineering numbers.

Where it stops

  • Negative inputs are rejected; the tool works with positive whole numbers.
  • Zero and zero is undefined and reported as an error.
  • Decimals are silently truncated instead of rounded.
  • No guard against inputs beyond safe integer precision.

Questions people ask

When would I use an LCM?

Adding fractions with different denominators, scheduling repeating events, or finding the smallest common size for a tile grid.

How do I simplify one fraction?

Use the fraction calculator for arithmetic with reduction built in, or the decimal to fraction calculator for a decimal input. Prime checks are in the prime number calculator.