GCD, LCM & Prime Factors Calculator

Find what whole numbers have in common. Everything runs in your browser; nothing you enter is uploaded or stored.

  • Free, no sign-up
  • Runs in your browser
  • Verified

How to use it

  1. Enter two or more whole numbers.
  2. Read the GCD (also called HCF) and the LCM.
  3. Check the prime factors of the first ten numbers.

How it works

The GCD uses Euclid’s algorithm, which repeatedly replaces the pair (a, b) by (b, a mod b) until the remainder is zero. The LCM of two numbers is a ÷ GCD × b, applied across the list. Arithmetic is exact (BigInt). Prime factors are found by trial division up to the square root.

Examples

  • 12, 18 and 24 have GCD 6 and LCM 72. 360 = 2³ × 3² × 5.

Limitations

  • Numbers up to 18 digits; prime factors only for numbers up to 10^12 (about a trillion).
  • Zero is rejected because the LCM with zero is not defined. Signs are ignored.

Last verified . See our Accuracy & Editorial Policy. Found a problem? Email contact@tools.gift.