100+ free calculators, no signup | 💰 Financial ❤️ Health & Fitness 📐 Math 🔧 Other
🇺🇸 USD | About Contact

Prime Factorization Calculator

Break any whole number up to 20 digits into primes, with exponent form, a factor tree, division steps, divisors and the simplified square root.

Commas and spaces are ignored. Negative numbers are factored as −1 times the prime factors.

Quick examples
Prime factorization of 360
2³ × 3² × 5Composite

360 = 2 × 2 × 2 × 3 × 3 × 5. Six primes multiply to give 360.

Factor tree

Each number splits into the two factors closest to its square root. Circled leaves are primes.

Your calculation

Ladder division by the smallest prime, then the values derived from the exponents.

    Prime powers

    One row per distinct prime. Multiply the e + 1 column to count divisors.

    Prime pExponent epᵉe + 1

    Every factor is confirmed prime before it is shown. Results are exact for whole numbers up to 20 digits.

    What Is Prime Factorization?

    The prime factorization of a whole number is the list of prime numbers that multiply together to give it. A prime is a whole number greater than 1 whose only factors are 1 and itself, such as 2, 3, 5, 7 and 11. A composite number has at least one other factor, so it can be broken down further: 360 = 2 × 2 × 2 × 3 × 3 × 5.

    Repeated primes are usually grouped with exponents. This is called exponent form or index form: 360 = 2³ × 3² × 5. The small raised number tells you how many times that prime appears. A prime that appears once has an exponent of 1, which is not written.

    The Fundamental Theorem of Arithmetic says every whole number greater than 1 has exactly one prime factorization, apart from the order of the factors. That uniqueness is why primes are called the building blocks of the whole numbers, and why the same factorization works for finding the GCF, LCM, number of divisors and simplified square roots.

    The numbers 0 and 1 have no prime factorization. Every prime divides 0, and 1 is neither prime nor composite, so the calculator explains these cases instead of showing a result.

    How to Use the Prime Factorization Calculator

    1. Enter a whole number. Any integer from 2 up to 20 digits works, including 99,999,999,999,999,999,999. Commas, spaces and underscores are removed before calculating. A negative number is written as −1 times its prime factors.
    2. Pick a tree style. Balanced splits each number into two factors near its square root, which gives a short, wide tree. Smallest prime first splits off one small prime at a time, which mirrors the ladder method taught in school.
    3. Read the result. The hero shows the exponent form, whether the number is prime or composite, and the expanded product. A badge marks perfect squares, perfect cubes and square free numbers.

    Below the hero you get the factor tree, six tiles (distinct primes, total prime factors, number of divisors, largest prime, simplified square root and Euler's totient), every division step with your numbers, and a table of prime powers. Results update as you type, and the example chips load common homework numbers.

    Factor Tree Method

    A factor tree splits a number into any two factors, then splits each composite branch again until every branch ends in a prime. Circle the primes as you reach them.

    360 = 18 × 20 18 = 3 × 6, 6 = 2 × 3 20 = 4 × 5, 4 = 2 × 2 Leaves: 3, 2, 3, 2, 2, 5 360 = 2³ × 3² × 5

    Starting with 2 × 180 or 10 × 36 gives a different tree but the same leaves. That is the Fundamental Theorem of Arithmetic at work, and it is a quick way to check your answer.

    Ladder (Division) Method

    The ladder method divides by the smallest prime that goes in evenly, writes the quotient underneath, and repeats until the quotient is 1. The primes down the left side are the factorization.

    2 | 360 2 | 180 2 | 90 3 | 45 3 | 15 5 | 5 | 1 → 360 = 2³ × 3² × 5

    This is the method the calculator shows in its steps, because the order is always the same and nothing gets missed.

    Prime Factorization Chart

    Prime factorizations of the composite numbers that come up most often in fractions, time and measurement problems. The divisor count comes from multiplying each exponent plus one.

    NumberPrime factorizationDivisors
    122² × 36
    182 × 3²6
    202² × 56
    242³ × 38
    302 × 3 × 58
    322⁵6
    362² × 3²9
    402³ × 58
    453² × 56
    482⁴ × 310
    502 × 5²6
    562³ × 78
    602² × 3 × 512
    642⁶7
    722³ × 3²12
    753 × 5²6
    802⁴ × 510
    842² × 3 × 712
    902 × 3² × 512
    962⁵ × 312
    982 × 7²6
    1002² × 5²9
    1202³ × 3 × 516
    1442⁴ × 3²15
    1802² × 3² × 518
    2102 × 3 × 5 × 716
    3602³ × 3² × 524
    10002³ × 5³16

    The primes below 50 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43 and 47. Any number below 2,500 that none of them divides is prime, because 50² = 2,500.

    What Prime Factorization Is Used For

    Greatest common factor and least common multiple

    Write both numbers in exponent form. The GCF uses each shared prime with its smallest exponent. The LCM uses every prime that appears with its largest exponent.

    24 = 2³ × 3 36 = 2² × 3² GCF = 2² × 3 = 12 LCM = 2³ × 3² = 72 Check: 12 × 72 = 864 = 24 × 36

    Simplifying fractions

    Factor the numerator and denominator, then cancel the shared primes. For 84/360: 84 = 2² × 3 × 7 and 360 = 2³ × 3² × 5 share 2² × 3 = 12, so 84/360 = 7/30.

    Simplifying square roots

    Each pair of equal primes moves outside the root as one copy. √72 = √(2² × 3² × 2) = 2 × 3 × √2 = 6√2. A number is a perfect square when every exponent is even, and a perfect cube when every exponent is a multiple of 3, as with 216 = 2³ × 3³.

    Counting divisors and Euler's totient

    n = p₁^a × p₂^b × p₃^c Divisors d(n) = (a + 1)(b + 1)(c + 1) Totient φ(n) = n × (1 − 1/p₁)(1 − 1/p₂)(1 − 1/p₃) 360: d = (3 + 1)(2 + 1)(1 + 1) = 24 360: φ = 360 × 1/2 × 2/3 × 4/5 = 96

    The divisor formula works because each divisor picks an exponent from 0 up to a for the first prime, 0 up to b for the second, and so on. Euler's totient counts the numbers from 1 to n that share no factor with n, which is used in modular arithmetic and RSA encryption.

    How to Check Whether a Number Is Prime

    You only need to test primes up to the square root of the number. If n = a × b and both factors were larger than √n, their product would be larger than n, so at least one factor is always at or below √n.

    For 97, √97 ≈ 9.849, so test 2, 3, 5 and 7. None divides 97, so 97 is prime. For 2117, √2117 ≈ 46.01, and testing up to 29 finds 2117 = 29 × 73.

    Numbers such as 51 = 3 × 17, 57 = 3 × 19 and 91 = 7 × 13 look prime but are not. The digit sum test catches the first two: 5 + 1 = 6 and 5 + 7 = 12 are multiples of 3.

    How the Calculator Factors Large Numbers

    Trial division alone is too slow for big inputs. A 20 digit number made of two 10 digit primes would need hundreds of millions of divisions. The calculator divides by 2 and every odd number below 1,000 first, then switches to two faster methods.

    The Miller–Rabin test with the 12 prime bases 2 through 37 decides whether a number is prime. Sorenson and Webster showed this set has no false positive below 3.18 × 10²³, far above any 20 digit input. Fewer bases are not enough: 3,825,123,056,546,413,051 = 149,491 × 747,451 × 34,233,211 passes every base from 2 to 31.

    Composite remainders are split with Pollard's rho method (Brent's version). It factors 600,851,475,143 = 71 × 839 × 1471 × 6857 and 2⁶⁴ − 1 = 3 × 5 × 17 × 257 × 641 × 65537 × 6700417 instantly.

    Common Mistakes in Prime Factorization

    • Stopping at a composite factor. Writing 360 = 2³ × 45 leaves 45 = 3² × 5 unfinished. Every factor in the final answer must be prime.
    • Counting 1 as a factor. 1 is not prime, so it never appears in a prime factorization. Writing 1 × 2 × 3 for 6 is incorrect.
    • Losing a repeated prime. 72 is 2³ × 3², not 2 × 3. Count the circled leaves on the tree or the rungs on the ladder before writing exponents.
    • Testing too few primes. Checking only 2, 3 and 5 misses factors such as 7 in 91 or 29 in 2117. Keep testing up to the square root.
    • Confusing factors with prime factors. The factors of 12 are 1, 2, 3, 4, 6 and 12. Its prime factors are only 2 and 3, and its prime factorization is 2² × 3.
    💡
    To check any factorization, multiply it back out. 2³ × 3² × 5 = 8 × 9 × 5 = 360. The calculator runs this check in its steps for every number.

    Related Calculations

    The Factor Calculator lists every divisor and factor pair, which is the full set that the divisor count above describes. The GCF Calculator and LCM Calculator compare several numbers using the lowest and highest exponent rules.

    Use the Fraction Calculator to reduce fractions, the Root Calculator for square and cube roots in decimal form, and the Exponent Calculator to evaluate prime powers such as 2¹⁰ = 1,024.

    Frequently Asked Questions

    What is the prime factorization of 360?

    The prime factorization of 360 is 2³ × 3² × 5, which is 2 × 2 × 2 × 3 × 3 × 5. Divide by the smallest prime each time: 360 ÷ 2 = 180, 180 ÷ 2 = 90, 90 ÷ 2 = 45, 45 ÷ 3 = 15, 15 ÷ 3 = 5, and 5 is prime. The exponents show that 360 has (3 + 1)(2 + 1)(1 + 1) = 24 divisors, and pairing equal primes gives √360 = 6√10. Other common results are 36 = 2² × 3², 48 = 2⁴ × 3, 72 = 2³ × 3², 84 = 2² × 3 × 7 and 100 = 2² × 5².

    How do you find the prime factorization of a number?

    Divide the number by the smallest prime that goes into it evenly, then repeat with the quotient until the quotient is 1. Try 2 first, then 3, 5, 7, 11 and so on. You only need to test primes up to the square root of what is left: if none divides it, the remaining number is prime. For 84: 84 ÷ 2 = 42, 42 ÷ 2 = 21, 21 ÷ 3 = 7, and 7 is prime, so 84 = 2² × 3 × 7. A factor tree gives the same answer by splitting the number into any factor pair and splitting again until every branch ends in a prime.

    Is 1 a prime number?

    No. A prime number has exactly two different factors, 1 and itself, and 1 has only one factor. OpenStax Contemporary Mathematics states that 1 is neither prime nor composite. Leaving 1 out keeps prime factorization unique: if 1 counted as prime, 6 could be written as 2 × 3, 1 × 2 × 3 or 1 × 1 × 2 × 3, and the Fundamental Theorem of Arithmetic would fail. For the same reason this calculator does not factor 1. The smallest prime is 2, and it is the only even prime.

    Why is the prime factorization of a number unique?

    The Fundamental Theorem of Arithmetic states that every natural number other than 1 can be written in exactly one way, apart from the order of the factors, as a product of primes. Different factor trees therefore always end with the same primes. For 360 you can start with 18 × 20 or with 2 × 180, and both trees finish with three 2s, two 3s and one 5. Uniqueness is what makes prime factorization useful for finding the GCF, the LCM and the number of divisors, because each number has one fixed list of prime building blocks.

    How do you use prime factorization to find the GCF and LCM?

    Write each number in exponent form. The GCF takes every prime the numbers share, with the smallest exponent. The LCM takes every prime that appears in any of the numbers, with the largest exponent. For 24 = 2³ × 3 and 36 = 2² × 3², the GCF is 2² × 3 = 12 and the LCM is 2³ × 3² = 72. As a check for two numbers, GCF × LCM = 12 × 72 = 864, which equals 24 × 36. The GCF Calculator and LCM Calculator on this site compare three or more numbers at once.

    How do you simplify a square root using prime factorization?

    Factor the number, then take one copy of each pair of equal primes outside the root. For 72 = 2³ × 3², the pairs are 2 × 2 and 3 × 3, so 2 × 3 = 6 comes out and one 2 stays inside: √72 = 6√2. For 360 = 2³ × 3² × 5, one pair of 2s and one pair of 3s come out, giving √360 = 6√10. If every exponent is even, the number is a perfect square: 3600 = 2⁴ × 3² × 5², so √3600 = 2² × 3 × 5 = 60. The Simplified √n tile shows this for any number.

    Sources & References

    • OpenStax. Prealgebra 2e, 2.5 Prime Factorization and the Least Common Multiple (factor tree and ladder methods, LCM from prime factors). openstax.org
    • OpenStax. Contemporary Mathematics, 3.1 Prime and Composite Numbers (definitions, 1 is neither prime nor composite, Fundamental Theorem of Arithmetic). openstax.org
    • Sorenson, J. and Webster, J. Strong Pseudoprimes to Twelve Prime Bases, Mathematics of Computation, 2017 (arXiv 1509.00864). arxiv.org
    • Pollard, J. M. A Monte Carlo method for factorization, BIT Numerical Mathematics 15, 331–334, 1975. link.springer.com

    Results are for educational purposes. Every number on this page was recomputed with the same factoring code the calculator uses. Methodology reviewed: 2026.