Prime Factorization Calculator (with Factor Steps)

  • Free
  • No sign-up
  • Works on phones
  • Shows the working
Basic & Scientific#69

Prime Factorization

Prime factors with exponents, the division ladder, and all divisors of any whole number.

This prime factorization calculator breaks any whole number up to one trillion into its prime factors, written with exponents (like ( 360 = 2^3 times 3^2 times 5 )). It shows the division ladder step by step, tells you whether the number is prime, counts its divisors and, for numbers up to ten million, lists every divisor and their sum.

It’s free and needs no sign-up.

Prime Factorization Calculator (with Factor Steps): A factor tree for 360: keep splitting off a prime until only primes…
A factor tree for 360: keep splitting off a prime until only primes remain, giving 360 = 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5.

How to use it

  1. Enter a whole number of 2 or more, for example 360.
  2. Press Factor.

What prime factorization is and how a prime factorization calculator works

A prime number has exactly two factors: 1 and itself. Examples are 2, 3, 5, 7, 11, 13, … Every whole number greater than 1 has a unique prime factorization. This is the Fundamental Theorem of Arithmetic. You can find this product using a prime factorization calculator.

A hand pressing a button on a scientific calculator.

The division method

Divide by the smallest prime that goes in exactly, and repeat with the result until you reach 1.

Worked example: 360

Divide byNumberResult
2360180
218090
29045
34515
3155
551

So ( 360 = 2 times 2 times 2 times 3 times 3 times 5 = 2^3 times 3^2 times 5 ).

Factor trees

A factor tree gives the same result. Split the number into two factors. Continue until each branch ends in a prime. For 84: (84 = 4 times 21 = (2 times 2) times (3 times 7)). So, (84 = 2^2 times 3 times 7). A prime factorization calculator will show the same primes. You always end with them.

Worked example: a larger number

( 1001 = 7 times 11 times 13 ). It is not divisible by 2, 3 or 5, so the first prime that works is 7. To check whether a number is prime, you only need to test primes up to its square root: 97 is prime because none of 2, 3, 5 or 7 divides it, and ( 11^2 = 121 > 97 ).

A desk with a calculator, keyboard, pens, papers, coffee, and USB drive.

Number of divisors

From ( n = p_1^{a_1} p_2^{a_2} cdots ), the number of divisors is ( (a_1 + 1)(a_2 + 1)cdots ). For ( 360 = 2^3 cdot 3^2 cdot 5^1 ) that is ( 4 times 3 times 2 = 24 ) divisors: 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 prime factorization is used for

  • GCF and LCM: take the lowest or highest power of each prime. The GCF and LCM calculator shows this.
  • Simplifying fractions: ( frac{84}{360} = frac{2^2 cdot 3 cdot 7}{2^3 cdot 3^2 cdot 5} = frac{7}{30} ). See fractions.
  • Simplifying square roots: ( sqrt{360} = sqrt{2^2 cdot 3^2 cdot 10} = 6sqrt{10} ). See the square root calculator.
  • Cryptography: RSA encryption is secure because factoring very large numbers into primes is extremely slow.

Divisibility rules

Divisible byRule
2last digit is even
3digit sum divisible by 3
5last digit is 0 or 5
7double the last digit, subtract from the rest; result divisible by 7
11alternating digit sum divisible by 11

Common mistakes

  • Stopping at a composite factor. ( 360 = 4 times 90 ) isn’t finished: 4 and 90 are not prime.
  • Treating 1 as prime. It isn’t; primes have exactly two factors.
  • Missing repeated factors. Keep dividing by the same prime until it no longer goes in.

Worked example: 1260

( 1260 div 2 = 630 ), ( 630 div 2 = 315 ), ( 315 div 3 = 105 ), ( 105 div 3 = 35 ), ( 35 div 5 = 7 ), and 7 is prime. So

$$1260 = 2^2 times 3^2 times 5 times 7$$

It has ( (2 + 1)(2 + 1)(1 + 1)(1 + 1) = 36 ) divisors.

Worked example: a product of two large primes

( 9991 ) is not divisible by any prime up to 89, but ( 9991 = 97 times 103 ). Numbers like this, the product of two primes of similar size, are the hardest to factor, which is exactly what RSA encryption relies on (with primes hundreds of digits long).

A smartphone displaying a calculator app with various mathematical functions.

Simplifying fractions with prime factors

( frac{1260}{1680} ): ( 1260 = 2^2 cdot 3^2 cdot 5 cdot 7 ) and ( 1680 = 2^4 cdot 3 cdot 5 cdot 7 ). Cancel the shared factors ( 2^2 cdot 3 cdot 5 cdot 7 = 420 ):

$$frac{1260}{1680} = frac{3}{4}$$

Perfect squares and cubes

A number is a perfect square exactly when every exponent in its prime factorization is even: ( 3600 = 2^4 cdot 3^2 cdot 5^2 ), so ( sqrt{3600} = 2^2 cdot 3 cdot 5 = 60 ). It is a perfect cube when every exponent is a multiple of 3: ( 216 = 2^3 cdot 3^3 = 6^3 ).

Primes up to 100

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97. There are 25 of them, and 2 is the only even prime.

Practice problems

  1. 72
  2. 150
  3. 2310
  4. Is 221 prime?

Answers: 1. ( 2^3 times 3^2 ). 2. ( 2 times 3 times 5^2 ). 3. ( 2 times 3 times 5 times 7 times 11 ). 4. No: ( 221 = 13 times 17 ).

The sieve of Eratosthenes

To list all primes up to a number, write numbers from 2 upward. Circle 2 and cross out every multiple of 2. Circle the next uncrossed number, 3, and cross out its multiples. Continue with 5, 7, and so on. You can stop once you reach the square root of the limit. Every number left uncrossed is prime. This process is useful for a prime factorization calculator.

A person's hand writing on a chalkboard with chalk.

Two famous facts about primes

  • There are infinitely many primes. Euclid’s proof: multiply any finite list of primes together and add 1. The result leaves remainder 1 when divided by each prime on the list, so its prime factors must be new primes.
  • Goldbach’s conjecture says every even number greater than 2 is the sum of two primes (( 10 = 3 + 7 ), ( 28 = 11 + 17 )). It has been checked by computer for enormous numbers but has never been proved.

Prime factorization of products and powers

Powers are easy: ( 12^3 = (2^2 cdot 3)^3 = 2^6 cdot 3^3 ), just multiply each exponent. For a product, add exponents: ( 72 times 150 = (2^3 cdot 3^2)(2 cdot 3 cdot 5^2) = 2^4 cdot 3^3 cdot 5^2 = 10{,}800 ). Prime factorizations turn multiplication into adding exponents, just as logarithms do.

Related guides

Further reading

FAQ

What is the prime factorization of 100?

( 100 = 2^2 times 5^2 ).

Is 1 a prime number?

No. A prime has exactly two different factors, and 1 has only one.

How do I know when to stop dividing?

When the result is 1. Every divisor you used along the way is a prime factor.

Can a number have two different prime factorizations?

No. Apart from the order of the factors, the prime factorization of a number is unique.

What is the prime factorization of a prime number?

Just the number itself, for example ( 97 = 97 ).

What is the fastest way to factor a big number?

Test primes in order up to its square root, dividing out each one as often as it goes in. For very large numbers, special algorithms are needed.

Embed this calculator on your website

Teachers, tutors and bloggers are welcome to use this calculator for free. Copy the code below and paste it into any page (in WordPress, use a "Custom HTML" block). The small script makes the calculator grow to fit its answer; if your site removes scripts, it still works at a fixed height. Please keep the credit link.

More calculators

See all calculators