About this tool
Find the prime factorization of numbers up to 40 digits with a factor tree, exponent form, every divisor, a prime check, and GCF and LCM working.
This prime factorization calculator breaks any whole number up to 40 digits into its prime factors and shows the answer in exponent form (360 = 2³ × 3² × 5) and expanded form. It draws a factor tree you can download as SVG, lays out the division ladder, lists every divisor with its factor pairs, and reports the number of divisors, their sum, Euler's totient and whether the number is perfect, abundant or deficient. Small factors are found by trial division, large ones by Pollard's rho method, and each factor is confirmed with the Miller–Rabin primality test. Separate tabs find the GCF and LCM of a list and list the primes in a range. All of it runs in your browser.
Open Prime Factorization Calculator on AltFTool — it loads instantly in your browser.
Type a whole number into Whole number to factor — up to 40 digits, with commas or e-notation such as 1e15 allowed — or tap an example like 360.
Read the Prime factorization card: exponent form such as 2³ × 3² × 5, a Prime number or Composite badge, the divisor count and the sum of divisors.
Switch the Working tabs between Factor tree, Division ladder and Divisors, and use Download SVG to save the factor tree image.
Open the GCF & LCM tab and enter numbers like 12, 18, 30, or the Primes in a range tab and press List primes for every prime between two numbers.
Pollard's rho with Miller–Rabin checks factors 15- and 20-digit numbers in a fraction of a second, with a Try harder button for tougher cases.
A factor tree, a division ladder and a complete divisor list with factor pairs, so the method your teacher uses is covered.
Number of divisors, sum of divisors, Euler's totient, perfect / abundant / deficient and the next and previous primes are worked out from the same factorisation.
Find the greatest common factor and least common multiple of up to 20 numbers, or list every prime between two numbers with a twin prime count.
| Number | Prime factorization | Prime or composite | Number of divisors |
|---|---|---|---|
| 2 | 2 | Prime | 2 |
| 3 | 3 | Prime | 2 |
| 4 | 2² | Composite | 3 |
| 5 | 5 | Prime | 2 |
| 6 | 2 × 3 | Composite | 4 |
| 7 | 7 | Prime | 2 |
| 8 | 2³ | Composite | 4 |
| 9 | 3² | Composite | 3 |
| 10 | 2 × 5 | Composite | 4 |
| 11 | 11 | Prime | 2 |
| 12 | 2² × 3 | Composite | 6 |
| 13 | 13 | Prime | 2 |
| 14 | 2 × 7 | Composite | 4 |
| 15 | 3 × 5 | Composite | 4 |
| 16 | 2⁴ | Composite | 5 |
| 17 | 17 | Prime | 2 |
| 18 | 2 × 3² | Composite | 6 |
| 19 | 19 | Prime | 2 |
| 20 | 2² × 5 | Composite | 6 |
| 21 | 3 × 7 | Composite | 4 |
| 22 | 2 × 11 | Composite | 4 |
| 23 | 23 | Prime | 2 |
| 24 | 2³ × 3 | Composite | 8 |
| 25 | 5² | Composite | 3 |
| 26 | 2 × 13 | Composite | 4 |
| 27 | 3³ | Composite | 4 |
| 28 | 2² × 7 | Composite | 6 |
| 29 | 29 | Prime | 2 |
| 30 | 2 × 3 × 5 | Composite | 8 |
| 31 | 31 | Prime | 2 |
| 32 | 2⁵ | Composite | 6 |
| 33 | 3 × 11 | Composite | 4 |
| 34 | 2 × 17 | Composite | 4 |
| 35 | 5 × 7 | Composite | 4 |
| 36 | 2² × 3² | Composite | 9 |
| 37 | 37 | Prime | 2 |
| 38 | 2 × 19 | Composite | 4 |
| 39 | 3 × 13 | Composite | 4 |
| 40 | 2³ × 5 | Composite | 8 |
| 41 | 41 | Prime | 2 |
| 42 | 2 × 3 × 7 | Composite | 8 |
| 43 | 43 | Prime | 2 |
| 44 | 2² × 11 | Composite | 6 |
| 45 | 3² × 5 | Composite | 6 |
| 46 | 2 × 23 | Composite | 4 |
| 47 | 47 | Prime | 2 |
| 48 | 2⁴ × 3 | Composite | 10 |
| 49 | 7² | Composite | 3 |
| 50 | 2 × 5² | Composite | 6 |
There are 15 primes up to 50. The number of divisors comes from the exponents: for 2ᵃ × 3ᵇ × … it is (a + 1)(b + 1)…, so 48 = 2⁴ × 3 has 5 × 2 = 10 divisors.
Prime factorization is writing a whole number as a product of prime numbers, the numbers greater than 1 whose only divisors are 1 and themselves. For example 60 = 2 × 2 × 3 × 5, or 2² × 3 × 5 in exponent form. By the fundamental theorem of arithmetic, every whole number above 1 has exactly one prime factorization, apart from the order of the factors.
Divide by the smallest prime that goes in evenly, usually 2, and keep dividing the quotient. When 2 no longer works, try 3, then 5, 7, 11 and so on. Stop when the quotient is 1. The primes you divided by are the factorization. You only need to test primes up to the square root of what is left; if none divide it, it is prime.
Write the number at the top and split it into any two factors, such as 360 = 2 × 180. Circle any branch that is prime and keep splitting the others, 180 = 2 × 90 and so on, until every branch ends in a circled prime. The circled numbers multiplied together give the prime factorization. Different trees for the same number always end with the same primes.
360 = 2 × 2 × 2 × 3 × 3 × 5, which is 2³ × 3² × 5 in exponent form. Dividing step by step: 360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45, ÷ 3 = 15, ÷ 3 = 5 and ÷ 5 = 1. From the exponents, 360 has (3 + 1)(2 + 1)(1 + 1) = 24 divisors, and they add up to 1,170.
No. A prime has exactly two different divisors, 1 and itself, and 1 has only one. Leaving 1 out also keeps prime factorization unique: if 1 counted as prime you could write 6 = 2 × 3 = 1 × 2 × 3 = 1 × 1 × 2 × 3 and so on. So 1 is neither prime nor composite, and 2 is the smallest prime and the only even one.
Factor each number, then take every prime they all share, raised to the lowest power that appears. For 12 = 2² × 3, 18 = 2 × 3² and 30 = 2 × 3 × 5, the shared primes are 2 and 3, each at lowest power 1, so the GCF is 2 × 3 = 6. If no prime is shared the GCF is 1 and the numbers are coprime.
Factor each number, then take every prime that appears in any of them, raised to the highest power that appears. For 12 = 2² × 3, 18 = 2 × 3² and 30 = 2 × 3 × 5 that is 2² × 3² × 5 = 180. For two numbers there is a shortcut check: GCF × LCM equals the product of the two numbers.
Write the prime factorization in exponent form, add 1 to each exponent and multiply the results. For 360 = 2³ × 3² × 5¹ the count is (3 + 1)(2 + 1)(1 + 1) = 24. This works because each divisor picks a power of 2 from 0 to 3, a power of 3 from 0 to 2 and a power of 5 from 0 to 1.
It accepts whole numbers up to 40 digits. Numbers up to about 20 digits usually factor in well under a second. Beyond that it depends on the second-largest prime factor: if two factors both have 13 or more digits, the search may not finish in a browser, and the calculator says the leftover part is composite instead of guessing. Primality itself is checked for any size.
It first tries dividing by every prime below 10,000. Then it runs the Miller–Rabin test with the first 13 primes as bases. For numbers below about 3.3 × 10²⁴ this combination is proven to give the right answer every time. For larger numbers a pass is labelled Probable prime, because no composite number is known to pass all 13 bases.
Add the Prime Factorization Calculator widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/prime-factorization-calculator"
title="Prime Factorization Calculator — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/prime-factorization-calculator?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>