Prime Factorization Calculator

Find the prime factorization of any number with factor tree and GCD/LCM using prime factors.

Prime Factorization

360 = 2^3 × 3^2 × 5

Prime Factors (list)

222335

Factor Tree (simplified)

360
  / \
  2   180
      180
        / \
        2   90
            90
              / \
              2   45
                  45
                    / \
                    3   15
                        15
                          / \
                          3   5
                              5
                                / \
                                5   1

GCD and LCM using Prime Factorization

360 = 2^3 × 3^2 × 5
84 = 2^2 × 3 × 7

GCD (greatest common divisor)

12

LCM (least common multiple)

2520

How to Use the Prime Factorization Calculator

  1. Enter any integer from 2 to 100,000. The calculator finds the complete prime factorization immediately.
  2. Read the prime factorization in exponential form (e.g., 2³ × 3² × 5) and as a flat list of prime factors.
  3. View the factor tree (for numbers up to 1,000) to see how the number is broken down step by step.
  4. Use the GCD and LCM section to find the greatest common divisor and least common multiple of two numbers, with the prime factorization method shown.

How Prime Factorization Works

Every integer > 1 can be written as a product of primes (Fundamental Theorem of Arithmetic).

Trial division method:
  Divide by 2 until odd, then try 3, 5, 7... up to √n.
  Example: 360
    360 / 2 = 180
    180 / 2 = 90
     90 / 2 = 45
     45 / 3 = 15
     15 / 3 = 5
      5 is prime → stop
  360 = 2³ × 3² × 5

GCD using prime factorization:
  Take the MINIMUM exponent for each shared prime.
  360 = 2³ × 3² × 5
   84 = 2² × 3 × 7
  GCD = 2² × 3 = 12

LCM using prime factorization:
  Take the MAXIMUM exponent for all primes.
  LCM = 2³ × 3² × 5 × 7 = 2520

Frequently Asked Questions

Prime factorization is expressing a number as a product of prime numbers. Primes are integers greater than 1 that have no divisors other than 1 and themselves (2, 3, 5, 7, 11...). By the Fundamental Theorem of Arithmetic, every integer greater than 1 has exactly one prime factorization (ignoring order). For example, 12 = 2² × 3. No other combination of primes multiplies to 12.

Related Calculators