Prime Factorization Calculator

The prime factorization calculator breaks any whole number up to one trillion into prime factors, showing the factor tree step by step – and tells you whether the number is prime.

Source: Wolfram MathWorld – Prime factorization. Updated: .

whole number from 2 to 1,000,000,000,000
My ToolboxYour inputs are saved in this browser only.

Result

Prime factorization
360 = 2³ · 3² · 5
Written out
2 · 2 · 2 · 3 · 3 · 5
Prime number?
No – 360 is composite. Nearest primes: 359 and 367.
Steps (factor tree)
  • 360 = 2 · 180
  • 180 = 2 · 90
  • 90 = 2 · 45
  • 45 = 3 · 15
  • 15 = 3 · 5
  • 5 is prime – done.
Divisors
24 divisors, sum of all divisors 1,170
All factors
1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360

How it is calculated

Prime factorization writes a number as a product of primes: 360 = 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5. By the fundamental theorem of arithmetic, every whole number from 2 upwards has exactly one such factorization, apart from the order of the factors.

How to find the prime factors

  1. Divide by the smallest prime that goes in exactly: 360 ÷ 2 = 180.
  2. Repeat with the result: 180 ÷ 2 = 90, 90 ÷ 2 = 45, 45 ÷ 3 = 15, 15 ÷ 3 = 5.
  3. Stop when what is left is prime (5). Group repeated factors as powers.

Divisibility rules speed this up: 2 if the last digit is even, 3 if the digit sum is divisible by 3, 5 if it ends in 0 or 5. You only need to test primes up to the square root – if none divides, the number is prime.

What prime factorization is used for

Number and sum of divisors

The exponents give the number of divisors directly: (3 + 1)(2 + 1)(1 + 1) = 24 divisors for 360. The calculator also shows the sum of all divisors and lists them when there are not too many.

Frequently asked questions

How do you do prime factorization?

Keep dividing by the smallest prime that fits until a prime is left: 84 ÷ 2 = 42, 42 ÷ 2 = 21, 21 ÷ 3 = 7, so 84 = 2² × 3 × 7.

Is 1 a prime number?

No. A prime has exactly two factors, 1 and itself; 1 has only one. The smallest prime is 2, which is also the only even prime.

How can I tell if a number is prime?

Try dividing by all primes up to its square root. If none divides evenly, it is prime. For 97, √97 ≈ 9.8 and 2, 3, 5, 7 all fail – so 97 is prime.

How many factors does a number have?

Add 1 to each exponent in the prime factorization and multiply: 72 = 2³ × 3² has (3 + 1)(2 + 1) = 12 factors.

What is a factor tree?

A diagram that splits a number into two factors, then splits each factor again until only primes remain at the ends of the branches.

Sources and legal basis

As of:

Related tools