GCD and LCM calculator

Find the greatest common divisor and least common multiple with exact integer steps.

Enter values

Start with the example below, or enter your own values.

How it works

Euclid’s algorithm repeatedly takes a remainder. For nonzero inputs, GCD × LCM equals the absolute product.

Try an example

First integer: 84; Second integer: 30. The form starts with these values; change them to explore your own case.

Example result: GCD = 6; LCM = 420

  1. 84 mod 30 = 24
  2. 30 mod 24 = 6
  3. 24 mod 6 = 0

Learn more in Exact arithmetic and number theory tools.

Results are calculated locally. Floating-point tools provide numerical approximations, not formal proof certificates.