Tools

Prime Factorization & GCF/LCM

Prime check, factorization, divisors, GCF, LCM and prime lists

Prime check and factorization

Prime?
–
Prime factorization
–

All divisors

GCF and LCM

Greatest common factor (GCF / GCD / HCF)
–
Least common multiple (LCM)
–

List primes

How to use the prime factor calculator

  1. Type a whole number in the first box to see whether it is prime, its prime factorization in exponent form, all its divisors, and the nearest primes.
  2. Type two or more numbers in the second box to get their greatest common factor (GCF) and least common multiple (LCM).
  3. Set a limit in the third box to list every prime up to that number.

Prime numbers and factorization

A prime number has exactly two divisors, 1 and itself: 2, 3, 5, 7, 11, 13… Every whole number above 1 can be written as a product of primes in exactly one way, which is called its prime factorization. For example 360 = 2³ × 3² × 5. The number of divisors follows from the exponents: (3+1)(2+1)(1+1) = 24.

Factorization uses trial division by 2, 3 and then numbers of the form 6k ± 1 up to the square root, which is instant for numbers up to about 15 digits. The list of primes uses the Sieve of Eratosthenes.

GCF and LCM

The greatest common factor is the largest number that divides all your numbers; it is used to simplify fractions and to split things into equal groups. The least common multiple is the smallest number that all of them divide into; it gives the common denominator for adding fractions and tells you when repeating cycles line up. For two numbers, GCF × LCM = the product of the numbers. Both are computed with Euclid's algorithm, and the LCM uses exact big integers so it never overflows.

Is 1 a prime number?

No. A prime needs exactly two different divisors, and 1 has only one. Excluding 1 keeps prime factorizations unique.

Are GCF, GCD and HCF the same?

Yes. Greatest common factor, greatest common divisor and highest common factor are three names for the same thing.

How many primes are there below 1,000,000?

78,498. Set the list limit to 1000000 to check.