Prime Factorization Calculator

Find the prime factorization of any whole number up to one quadrillion, with exponent form, division steps, number of divisors and perfect square checks.

Prime factorization calculator
Prime factorization

    Division method (repeated division by primes)

    Divide byNumberResult

    Works for whole numbers from 2 up to 1,000,000,000,000,000 (1015). Every whole number greater than 1 has exactly one prime factorization, apart from the order of the factors.

    On this page

    A prime factorization calculator breaks a whole number down into the prime numbers that multiply together to make it, and writes the result in exponent form. It shows the step-by-step division method, tells you whether the number is prime, and uses the factorization to give the number of divisors, the sum of the divisors and whether the number is a perfect square or cube.

    For example, 360 = 2³ × 3² × 5, 3,600 = 2⁴ × 3² × 5², and 600,851,475,143 = 71 × 839 × 1,471 × 6,857. The number 97 is prime, so its factorization is just 97.

    How to use the calculator

    1. Enter a whole number from 2 up to 10¹⁵. Commas are ignored.
    2. Press Factorize.
    3. Read the factorization in exponent form and expanded form, then follow the division table to see how it was found.

    What is prime factorization?

    A prime number is a whole number greater than 1 with exactly two factors: 1 and itself. The first few are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. Every whole number greater than 1 is either prime or can be written as a product of primes. Writing a number this way is called its prime factorization, and the primes are its prime factors.

    The fundamental theorem of arithmetic says that this factorization is unique: apart from the order, there’s only one way to write a number as a product of primes. That’s why primes are often called the building blocks of the whole numbers.

    Method 1: repeated division

    1. Divide the number by the smallest prime, 2, as many times as it goes exactly.
    2. Move on to the next prime, 3, then 5, 7, 11 and so on, dividing each time it goes exactly.
    3. Stop when the result is 1. The primes you divided by are the prime factors.

    For 360: 360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45, 45 ÷ 3 = 15, 15 ÷ 3 = 5 and 5 ÷ 5 = 1. The divisors are 2, 2, 2, 3, 3 and 5, so 360 = 2³ × 3² × 5. You only need to test primes up to the square root of what’s left; if nothing divides, the remaining number is itself prime.

    Method 2: factor tree

    Split the number into any two factors, then keep splitting each factor until every branch ends in a prime. For 360, you might split it into 36 × 10, then 36 into 6 × 6 and 10 into 2 × 5, then each 6 into 2 × 3. The prime leaves are 2, 3, 2, 3, 2 and 5, which give the same answer, 2³ × 3² × 5. Different trees always lead to the same primes, which is the uniqueness theorem in action.

    Exponent form

    When a prime appears more than once, write it with an exponent. Instead of 2 × 2 × 2 × 3 × 3 × 5, write 2³ × 3² × 5. Exponent form is shorter, easier to read and makes the properties of the number obvious, as the next sections show.

    What the factorization tells you

    Number of divisors

    Add 1 to each exponent and multiply. For 360 = 2³ × 3² × 5¹, the number of divisors is (3 + 1) × (2 + 1) × (1 + 1) = 24.

    Perfect squares and cubes

    A number is a perfect square if every exponent is even, and a perfect cube if every exponent is a multiple of 3. 3,600 = 2⁴ × 3² × 5² is a perfect square, and halving the exponents gives its square root: 2² × 3 × 5 = 60. 216 = 2³ × 3³ is a perfect cube, with cube root 2 × 3 = 6.

    GCF and LCM

    To find the greatest common factor of two numbers, take each shared prime at its lowest power. For the least common multiple, take every prime at its highest power. 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.

    Simplifying fractions and roots

    Cancelling common prime factors simplifies fractions: 84/360 = (2² × 3 × 7) ÷ (2³ × 3² × 5) = 7/30. Pairs of primes come out of square roots: √360 = √(2² × 3² × 2 × 5) = 6√10.

    Worked example: a larger number

    Factorize 5,148. It’s even, so divide by 2: 2,574, and again: 1,287. That’s odd, so try 3; its digits add to 18, so 3 divides it: 429, and again: 143. The digit sum of 143 is 8, so 3 no longer works, and 143 doesn’t end in 0 or 5, so 5 doesn’t either. Trying 7 leaves a remainder, but 11 works: 143 ÷ 11 = 13, which is prime. So 5,148 = 2² × 3² × 11 × 13. Divisibility rules such as these make the division method quick even by hand.

    Divisibility shortcuts that help

    A few quick tests save a lot of trial division. A number is divisible by 2 if it ends in an even digit, by 3 if its digits add to a multiple of 3, and by 5 if it ends in 0 or 5. For 11, alternately add and subtract the digits; if the result is a multiple of 11, including 0, so is the number. For 143, 1 − 4 + 3 = 0, so 11 divides it. For 7 and 13 there are rules too, but direct division is usually just as fast.

    Why factoring large numbers is hard

    Multiplying primes together is easy, but working backwards from a large product to its prime factors is very hard. This calculator uses trial division, which is fast for numbers up to about 10¹⁵. Numbers used in internet security have hundreds of digits and are the product of two huge primes; even the best known methods and powerful computers can’t factor them in any practical amount of time. This difficulty is what keeps RSA encryption secure.

    A brief history

    Prime numbers have fascinated mathematicians for thousands of years. Around 300 BC, Euclid proved that there are infinitely many primes, and that every number can be built from them. Eratosthenes devised a simple sieve for listing primes by crossing out multiples. In the 1800s, Gauss formally proved that the factorization of every number is unique. Today, primes power the encryption that protects online banking and shopping, and the search for ever larger primes continues with the help of thousands of volunteers’ computers around the world.

    Prime numbers 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 and 97. There are 25 of them. Note that 2 is the only even prime, and 1 is not prime.

    Tips

    • Always start with 2 and work upwards through the primes, so you never miss a factor.
    • Check your answer by multiplying the prime factors back together; you should get the original number.
    • Write the final answer in exponent form with the primes in increasing order, which is the standard way to present it.
    • Remember that you only need to test primes up to the square root of the number that’s left.

    Common mistakes

    • Including 1 as a prime factor. It isn’t prime and doesn’t change a product.
    • Stopping with a composite factor such as 4 or 9 instead of breaking it into primes.
    • Forgetting a repeated factor, such as writing 2 × 3 × 5 for 60 instead of 2² × 3 × 5.
    • Assuming that odd numbers are prime. 9, 15, 21 and 91 are all composite.

    Related calculations

    Two other tools work well alongside this one: the factor calculator, to list all the factors and factor pairs of a number, and the common factor calculator, to list all the common factors of two or more numbers.

    Frequently asked questions

    2³ × 3² × 5, which is 2 × 2 × 2 × 3 × 3 × 5.

    Divide repeatedly by the smallest prime that goes in exactly, starting with 2, until you reach 1. The primes you used are the factors.

    No. A prime has exactly two factors, and 1 has only one. It has no prime factorization.

    Yes. The fundamental theorem of arithmetic guarantees that every number greater than 1 has exactly one prime factorization, apart from the order.

    A diagram that splits a number into factors, then splits those factors, until every branch ends in a prime.

    Just the number itself. For example, the prime factorization of 97 is 97.

    Add 1 to each exponent and multiply. 360 = 2³ × 3² × 5 has 4 × 3 × 2 = 24 divisors.

    All the exponents in its prime factorization are even. 3,600 = 2⁴ × 3² × 5² is a perfect square.

    Up to 10¹⁵, one quadrillion. Results appear almost instantly.

    It's used to simplify fractions and roots, find GCFs and LCMs, and it underpins modern cryptography.

    2² × 5², which is 2 × 2 × 5 × 5. Both exponents are even, so 100 is a perfect square.

    2. Every other even number is divisible by 2, so it can't be prime.