Prime Factorization Calculator

Enter any whole number up to one trillion to get its prime factorization, whether it is prime, the number and sum of its divisors, the nearest primes and the full list of divisors.

A whole number from 2 to 1,000,000,000,000.

Results update as you type.

Result

Prime factorization of 360
2³ × 3² × 5
Written out
2 × 2 × 2 × 3 × 3 × 5
Is 360 prime?
No, it is composite
Number of divisors
24
Sum of divisors
1,170
Sum of proper divisors
810 (abundant number)
Previous prime
359
Next prime
367

Repeated division by primes

  1. 360 ÷ 2 = 180
  2. 180 ÷ 2 = 90
  3. 90 ÷ 2 = 45
  4. 45 ÷ 3 = 15
  5. 15 ÷ 3 = 5
  6. 5 ÷ 5 = 1

All 24 divisors of 360

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360

What is prime factorization?

A prime number is a whole number greater than 1 that can only be divided exactly by 1 and itself: 2, 3, 5, 7, 11, 13 and so on. Every other whole number greater than 1 is composite, and a composite number can always be broken down into a product of primes. That product is its prime factorization. The number 360, for example, is 2 × 2 × 2 × 3 × 3 × 5, written compactly with exponents as 2³ × 3² × 5. The factorization is the DNA of a number: once you have it, you can read off every divisor, test divisibility, simplify fractions and square roots, and compute greatest common factors without any further trial and error.

The factor tree method

Split the number into any two factors, then keep splitting each composite factor until only primes remain. The primes at the ends of the branches are the prime factorization. Starting from 360:

  1. 360 = 36 × 10
  2. 36 = 6 × 6 and 10 = 2 × 5
  3. 6 = 2 × 3, so each 6 becomes 2 × 3
  4. Collect the leaves: 2, 3, 2, 3, 2, 5 → sorted 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5

It does not matter which split you choose first; 360 = 4 × 90 or 360 = 12 × 30 produce the same leaves. An equivalent method, and the one the calculator uses, is repeated division: divide by 2 as many times as possible, then by 3, then 5, and continue with each larger prime until you reach 1. For 360 that is 360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45, 45 ÷ 3 = 15, 15 ÷ 3 = 5, 5 ÷ 5 = 1. Check the answer by multiplying back: 8 × 9 × 5 = 360.

The exponents also give the divisor count and divisor sum directly. Number of divisors = (3 + 1)(2 + 1)(1 + 1) = 24. Sum of divisors = (1 + 2 + 4 + 8)(1 + 3 + 9)(1 + 5) = 15 × 13 × 6 = 1,170.

The fundamental theorem of arithmetic

Every whole number greater than 1 is either prime or a product of primes, and that product is unique apart from the order of the factors. This is the fundamental theorem of arithmetic, proved in Euclid's Elements around 300 BC. Uniqueness is what makes the factorization useful: two people factoring 360 by different routes must arrive at 2³ × 3² × 5. It is also the reason 1 is not counted as a prime, since allowing factors of 1 would make the representation non-unique.

Divisibility rules

These shortcuts let you spot small prime factors without dividing:

Divisible byRuleExample
2Last digit is even (0, 2, 4, 6, 8)360 ends in 0
3Digit sum is divisible by 33 + 6 + 0 = 9
4Last two digits are divisible by 460 ÷ 4 = 15
5Last digit is 0 or 5360 ends in 0
6Divisible by both 2 and 3360 passes both tests
8Last three digits are divisible by 8360 ÷ 8 = 45
9Digit sum is divisible by 93 + 6 + 0 = 9
10Last digit is 0360 ends in 0
11Alternating digit sum (+ − + …) is 0 or divisible by 113 − 6 + 0 = −3, so not divisible

Where prime factorization is used

  • GCF and LCM: compare prime powers to find the greatest common factor and least common multiple of several numbers, as in the GCF and LCM calculator.
  • Simplifying fractions and roots: 360/84 reduces by the shared factor 2² × 3 to 30/7, and √360 = √(2² × 3² × 2 × 5) = 6√10.
  • Cryptography: RSA encryption multiplies two secret primes of around 300 digits each. Anyone can see the product, but recovering the primes by factoring it is infeasible with known methods, which is what keeps the key secure.
  • Counting: the number of divisors, perfect-square tests and problems about arranging items into equal rows all follow from the exponents.

How to use this calculator

  1. Type a whole number between 2 and 1,000,000,000,000 in the box.
  2. Read the prime factorization in the headline. If the number is prime, the headline says so.
  3. Check the rows for the divisor count and sum, whether the number is perfect, abundant or deficient, and the primes on either side of it.
  4. Scroll down for the division steps and the complete list of divisors.

Tips and common mistakes

  • 1 is not prime and 2 is the only even prime. A factor tree that ends with a 1 or a 4 is not finished.
  • Stop at the square root: if no prime up to √n divides n, then n itself is prime. For 97 you only need to test 2, 3, 5 and 7.
  • Multiply back to check. The product of the prime powers must equal the original number, or a factor was dropped.
  • Exponents are not multipliers: 2³ means 2 × 2 × 2 = 8, not 2 × 3. The exponent calculator evaluates powers like these.
  • Decimals and negatives have no prime factorization. Factor the absolute value of a negative number and keep the sign separately.

Frequently asked questions

Is 1 a prime number?

No. A prime is a whole number greater than 1 whose only divisors are 1 and itself. Excluding 1 keeps the fundamental theorem of arithmetic true: if 1 counted as prime, 6 could be written as 2 × 3, 1 × 2 × 3, 1 × 1 × 2 × 3 and so on, and factorizations would no longer be unique.

How do I check whether a large number is prime?

Try dividing it by every prime up to its square root. If none divides it exactly, it is prime. For a 12-digit number the square root is at most 1,000,000, which is why this calculator can answer instantly. Much larger numbers, like the 600-digit ones used in cryptography, need probabilistic tests such as Miller–Rabin instead.

What is the difference between factors and prime factors?

Factors (or divisors) are all the whole numbers that divide a number exactly: 360 has 24 of them, from 1 to 360. Prime factors are the primes among them, 2, 3 and 5, and the prime factorization 2³ × 3² × 5 records how many times each one is used. Every other factor is a product of some of those prime powers.

Why is the calculator limited to 1,000,000,000,000?

It factors by trial division, testing possible divisors up to the square root of the number. At one trillion that is a million candidates, which a browser handles in a fraction of a second. Beyond that the running time grows with the square root, so a 20-digit number could take minutes, and specialised algorithms are needed.

How many divisors does a number have?

Add 1 to each exponent in the prime factorization and multiply. For 360 = 2³ × 3² × 5 that is (3 + 1)(2 + 1)(1 + 1) = 24. A prime always has exactly 2 divisors, and a perfect square always has an odd number of them because its square root is paired with itself.

Related calculators