Skip to main content

Calcu.fit

Prime Factorization Calculator: Find the Prime Factors of Any Number

Use this free prime factorization calculator to break a whole number into its prime factors. Enter a number, and the calculator shows its prime factorization, the exponent form (such as 2² × 3 × 5), a factor tree, whether the number is prime, and extras like the number of divisors. Steps are included. No signup needed.

Prime factorization calculator

Your number

Commas, spaces and underscores are ignored. Up to 1,000,000,000,000,000.

Add one to also get the GCF and LCM from the prime factors.

Prime factorization
–

Factor tree

Division steps

    Uses exact integer arithmetic. Primes are tested only up to the square root of what is left. 0 and 1 have no prime factorization. For decimals or fractions, factor the numerator and denominator separately. Not designed for cryptography. Try the problem by hand first and use the calculator to check your work.

    How to Use This Prime Factorization Calculator

    You can use commas, spaces, or underscores to make a long number easier to read. The calculator removes them. For decimals, negative numbers, and fractions, see the notes below.

    1. Enter a whole number greater than 1, such as 360.
    2. Click Calculate.

    What You’ll See in Your Results

    • The prime factorization as a product of primes
    • The exponent form (such as 2³ × 3² × 5)
    • A factor tree
    • Whether the number is prime or composite
    • The number of divisors and the sum of divisors
    • The division steps (dividing by primes one at a time)
    • Quick links to find the GCF and LCM with another number

    What Is a Prime Number?

    A prime number is a whole number greater than 1 that has exactly two factors: 1 and itself. Examples: 2, 3, 5, 7, 11, 13.

    A composite number is a whole number greater than 1 that has more than two factors, such as 12 (1, 2, 3, 4, 6, 12).

    The number 1 is neither prime nor composite. The number 2 is the only even prime.

    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 primes below 100, and 168 primes below 1,000.

    What Is Prime Factorization?

    Prime factorization writes a number as a product of prime numbers. The Fundamental Theorem of Arithmetic says that every whole number greater than 1 can be written as a product of primes in exactly one way (apart from the order of the factors).

    For 60:

    60 = 2 × 2 × 3 × 5 = 2² × 3 × 5

    Methods for Prime Factorization

    Method 1: The Division Method

    1. Divide the number by the smallest prime that divides it evenly.
    2. Divide the result by the smallest prime that divides it evenly.
    3. Keep going until the result is 1.
    4. The primes you divided by are the prime factors.

    Method 2: The Factor Tree

    1. Write the number, and split it into any two factors.
    2. Split each factor that is not prime into two factors.
    3. Continue until all the “leaves” are prime.
    4. The primes at the ends are the prime factors.

    Different trees give the same prime factors.

    Quick Rule: How Far to Check

    You only need to test primes up to the square root of the number. If none of them divides the number, the number is prime.

    Prime Factorization Calculator Examples

    Example 1: 60 (Division Method)

    • 60 ÷ 2 = 30
    • 30 ÷ 2 = 15
    • 15 ÷ 3 = 5
    • 5 ÷ 5 = 1
    • 60 = 2² × 3 × 5
    • Divisors: (2 + 1)(1 + 1)(1 + 1) = 12, and the sum of divisors is 168.

    Example 2: 84

    • 84 = 2 × 42 = 2 × 2 × 21 = 2 × 2 × 3 × 7
    • 84 = 2² × 3 × 7

    Example 3: 360

    • 360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45, ÷ 3 = 15, ÷ 3 = 5, ÷ 5 = 1
    • 360 = 2³ × 3² × 5
    • Divisors: (3 + 1)(2 + 1)(1 + 1) = 24, and the sum of divisors is 1,170.

    Example 4: A Factor Tree for 36

     
            36
           /  \
          6    6
         / \  / \
        2   3 2   3
    • 36 = 2² × 3²

    Example 5: 1,001

    • 1,001 = 7 × 143 = 7 × 11 × 13
    • 1,001 = 7 × 11 × 13

    Example 6: A Prime Number

    97 is not divisible by any prime up to √97 ≈ 9.8 (2, 3, 5, 7).

    • 97 is prime.

    Example 7: A Number That Looks Prime

    91 is not divisible by 2, 3, or 5, but 91 ÷ 7 = 13.

    • 91 = 7 × 13, so it is composite.

    Example 8: A Large Power

    • 1,000,000 = 10⁶ = (2 × 5)⁶
    • 1,000,000 = 2⁶ × 5⁶
    • Divisors: (6 + 1)(6 + 1) = 49

    Example 9: 123,456

    • 123,456 = 2⁶ × 1,929 = 2⁶ × 3 × 643
    • 123,456 = 2⁶ × 3 × 643 (643 is prime)

    Example 10: The Product of the First Primes

    • 2,310 = 2 × 3 × 5 × 7 × 11 (the product of the first 5 primes)
    • 30,030 = 2 × 3 × 5 × 7 × 11 × 13

    Example 11: A Perfect Square

    • 2,025 = 3⁴ × 5²
    • Every exponent is even, so 2,025 is a perfect square: 2,025 = (3² × 5)² = 45².

    A number is a perfect square exactly when all the exponents in its prime factorization are even.

    Example 12: Simplifying a Square Root

    • 72 = 2³ × 3²
    • √72 = √(2² × 3² × 2) = 2 × 3 × √2 = 6√2

    Example 13: GCF and LCM from Prime Factorization

    • 84 = 2² × 3 × 7
    • 90 = 2 × 3² × 5
    • GCF = lowest powers of shared primes = 2 × 3 = 6
    • LCM = highest powers of all primes = 2² × 3² × 5 × 7 = 1,260

    Example 14: A Famous Large Number

    • 600,851,475,143 = 71 × 839 × 1,471 × 6,857
    • The largest prime factor is 6,857.

    Example 15: A Famous Non-Prime

    • 2³² + 1 = 4,294,967,297
    • 4,294,967,297 = 641 × 6,700,417

    Fermat thought numbers of the form 2^(2ⁿ) + 1 were all prime, but Euler found that this one is not.

    Example 16: A Large Prime

    • 2³¹ − 1 = 2,147,483,647 is prime. It is a Mersenne prime.

    Example 17: A Year

    • 2,024 = 2³ × 11 × 23
    • 2,025 = 3⁴ × 5²

    What You Can Learn from the Prime Factorization

    If n = p₁^a × p₂^b × p₃^c × …, then:

    Number of divisors: (a + 1)(b + 1)(c + 1)…

    Sum of divisors: the product of (1 + p + p² + … + p^a) for each prime

    GCF of two numbers: multiply the lowest power of each shared prime

    LCM of two numbers: multiply the highest power of every prime that appears

    Perfect square: all exponents are even

    Perfect cube: all exponents are multiples of 3

    Square root, simplified: take out each prime in pairs

    Divisibility Rules

    These help you find prime factors quickly.

    Divisible byRule
    2The last digit is even
    3The sum of the digits is divisible by 3
    5The last digit is 0 or 5
    7Double the last digit and subtract it from the rest. The result is divisible by 7 (or is 0).
    11The alternating sum of the digits is 0 or divisible by 11

    Rules for 4, 6, 8, 9, and 10 follow from these (4 is 2 × 2, 6 is 2 × 3, 9 is 3 × 3, and so on).

    Where Prime Factorization Is Used

    • Fractions: simplifying and finding common denominators
    • GCF and LCM: a reliable method for large numbers
    • Simplifying radicals
    • Number theory: the study of primes and divisors
    • Cryptography: the security of some systems depends on how hard it is to factor very large numbers (this is an idea, not something this calculator is meant for)
    • Computer science: hashing and algorithms
    • School math

    Common Mistakes

    • Stopping too early. Check that every factor in your answer is prime.
    • Calling 1 a prime number. It is not.
    • Forgetting that 2 is prime. It is the only even prime.
    • Leaving out repeated factors. 12 = 2 × 2 × 3, not 2 × 3.
    • Mixing up prime factors and factors. The factors of 12 are 1, 2, 3, 4, 6, and 12. The prime factors are 2 and 3.
    • Treating a composite number as prime (like 91 = 7 × 13).
    • Using the highest powers for the GCF. For the GCF, take the lowest powers of the shared primes.
    • Skipping the check. Multiply your factors back together to verify.

    Tips for Using a Prime Factorization Calculator

    • Check by multiplying the prime factors. You should get your original number.
    • Use the exponent form to keep the answer short.
    • Start dividing by 2, then 3, then 5, then 7, and so on.
    • Stop trying primes when the prime squared is greater than what is left.
    • If the number is prime, its factorization is just itself.
    • To find the GCF or LCM, factor both numbers and compare.
    • Use the divisibility rules to speed things up.

    Notes About Other Kinds of Numbers

    • Negative numbers: you can factor the positive part and write −1 as an extra factor (−12 = −1 × 2² × 3). This calculator works with positive numbers.
    • 0 and 1: these have no prime factorization.
    • Decimals and fractions: factor the numerator and denominator separately.
    • Very large numbers: factoring numbers with hundreds of digits is a very hard problem. This calculator is for numbers up to the limit shown on the tool.

    Prime Factorization Calculator vs. Other Tools

    • LCM Calculator: the least common multiple of two or more numbers.
    • Common Factor Calculator: all the common factors and the GCF.
    • Fraction Calculator: add, subtract, multiply, and divide fractions.
    • Root Calculator: square roots, cube roots, and nth roots.
    • Big Number Calculator: exact arithmetic with huge integers.

    Frequently Asked Questions (FAQ)

    What is prime factorization?

    Writing a number as a product of prime numbers. For example, 60 = 2² × 3 × 5.

    Divide the number by the smallest prime that divides it, and repeat with the result until you reach 1. For 60: 60 ÷ 2 = 30, 30 ÷ 2 = 15, 15 ÷ 3 = 5, and 5 ÷ 5 = 1, so the prime factors are 2, 2, 3, and 5.

    A diagram that splits a number into two factors, and keeps splitting until all the ends are prime.

    2³ × 3² × 5.

    Check if any prime up to its square root divides it. If none does, it is prime. 97 is prime, but 91 = 7 × 13 is not.

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

    Yes. It is the only even prime.

    Factor each number, and multiply the lowest power of each prime they share. For 84 = 2² × 3 × 7 and 90 = 2 × 3² × 5, the GCF is 2 × 3 = 6.

    Multiply the highest power of every prime that appears in either number. For 84 and 90, the LCM is 2² × 3² × 5 × 7 = 1,260.

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

    Numbers up to the limit shown on the tool. Very large numbers can take a long time, since factoring is a hard problem.

     Yes. It is free, with no registration and no limits on use (apart from the size limit shown on the tool).

    It uses exact integer arithmetic, so the factorization is exact.

    Disclaimer

    This calculator is for general and educational use. Factorizations are exact for numbers within the size limit of this tool. It is not designed for cryptography or security work. Try the problem by hand first and use the calculator to check your work. Follow your teacher’s rules on the method and the form of the answer.