Skip to content
Calculator.hair

Prime Factorization Calculator

Press Calculate to see the results.

Enter a whole number and this prime factorization calculator writes it as a product of primes, in expanded and exponent form, with the factor tree steps and the full list of divisors.

What is a prime number?

A prime number is a whole number greater than 1 whose only positive divisors are 1 and itself. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. A whole number greater than 1 that is not prime is composite, because it can be built by multiplying smaller whole numbers; 12 = 3 × 4, for example. The number 1 is neither prime nor composite.

2 is the only even prime, since every other even number is divisible by 2. Euclid proved around 300 BC that there are infinitely many primes: multiply any finite list of primes together and add 1, and the result has a prime factor missing from the list. Primes thin out as numbers grow, but they never stop. The largest known primes have tens of millions of digits and are found by distributed computing projects.

What is prime factorization?

Prime factorization writes a composite number as a product of prime numbers. The fundamental theorem of arithmetic guarantees that every whole number greater than 1 has exactly one such factorization, apart from the order of the factors. So 100 = 2 × 2 × 5 × 5 = 2² × 5², and no other set of primes multiplies to 100. Primes are the building blocks of the whole numbers in the same way that atoms are the building blocks of molecules.

The simplest method is trial division. Divide the number by the smallest prime that goes into it evenly, write that prime down, and repeat with the quotient. Try 2 as long as the number is even, then 3, 5, 7 and so on. You only need to test primes up to the square root of what remains: if nothing up to that point divides it, what remains is itself prime. For 100, divide by 2 to get 50, by 2 again to get 25, then by 5 to get 5, which is prime.

A factor tree shows the same process as a diagram. Write the number at the top, split it into any two factors, and keep splitting each branch until every leaf is prime. 360 might split into 36 × 10, then 6 × 6 and 2 × 5, and finally 2 × 3 × 2 × 3 × 2 × 5. Different trees for the same number always end with the same leaves: 360 = 2³ × 3² × 5.

Factorizations make several other calculations easy. The greatest common factor of two numbers is the product of the primes they share, using the smaller exponent of each; the least common multiple uses every prime with the larger exponent. For 360 = 2³ × 3² × 5 and 84 = 2² × 3 × 7, the GCF is 2² × 3 = 12 and the LCM is 2³ × 3² × 5 × 7 = 2,520. The number of divisors is the product of each exponent plus one, so 360 has 4 × 3 × 2 = 24 divisors.

Factoring small numbers is easy, but no one knows a fast method for factoring very large numbers that are the product of two big primes. The RSA encryption that protects much internet traffic relies on that difficulty: multiplying two 300-digit primes is quick, while recovering them from the product would take ordinary computers an impractically long time.

NumberTrial divisionFactorization
100100 → 50 → 25 → 52² × 5²
360360 → 180 → 90 → 45 → 15 → 52³ × 3² × 5
8484 → 42 → 21 → 72² × 3 × 7
97no prime up to √97 ≈ 9.8 divides it97 (prime)

Prime factorization of common numbers

The table lists the prime factorizations of the whole numbers from 2 to 101. Numbers whose factorization is the number itself are prime. Notice how the primes become less frequent as the numbers grow: there are 15 primes up to 50 but only 10 between 51 and 101.

NumberPrime factorizationNumber (52–101)Prime factorization (52–101)
22 (prime)522² × 13
33 (prime)5353 (prime)
42²542 × 3³
55 (prime)555 × 11
62 × 3562³ × 7
77 (prime)573 × 19
82³582 × 29
93²5959 (prime)
102 × 5602² × 3 × 5
1111 (prime)6161 (prime)
122² × 3622 × 31
1313 (prime)633² × 7
142 × 7642⁶
153 × 5655 × 13
162⁴662 × 3 × 11
1717 (prime)6767 (prime)
182 × 3²682² × 17
1919 (prime)693 × 23
202² × 5702 × 5 × 7
213 × 77171 (prime)
222 × 11722³ × 3²
2323 (prime)7373 (prime)
242³ × 3742 × 37
255²753 × 5²
262 × 13762² × 19
273³777 × 11
282² × 7782 × 3 × 13
2929 (prime)7979 (prime)
302 × 3 × 5802⁴ × 5
3131 (prime)813⁴
322⁵822 × 41
333 × 118383 (prime)
342 × 17842² × 3 × 7
355 × 7855 × 17
362² × 3²862 × 43
3737 (prime)873 × 29
382 × 19882³ × 11
393 × 138989 (prime)
402³ × 5902 × 3² × 5
4141 (prime)917 × 13
422 × 3 × 7922² × 23
4343 (prime)933 × 31
442² × 11942 × 47
453² × 5955 × 19
462 × 23962⁵ × 3
4747 (prime)9797 (prime)
482⁴ × 3982 × 7²
497²993² × 11
502 × 5²1002² × 5²
513 × 17101101 (prime)

Frequently asked questions

What is the prime factorization of 100?

100 = 2 × 2 × 5 × 5, or 2² × 5² in exponent form.

Is 1 a prime number?

No. A prime must have exactly two distinct positive divisors, and 1 has only one. Excluding 1 keeps every factorization unique.

How do I find the prime factorization of a number?

Divide by the smallest prime that divides evenly, record it, and repeat with the quotient until the result is 1. Only primes up to the square root need to be tried.

Can a number have more than one prime factorization?

No. By the fundamental theorem of arithmetic, the prime factorization of every whole number greater than 1 is unique, apart from the order of the factors.

How is prime factorization used?

It is used to find greatest common factors and least common multiples, simplify fractions and radicals, count divisors, and underlies public-key cryptography.

Updated by Calculator.hair. How we build and check our calculators