Prime Factorization Calculator
Repeatedly divide by the smallest primes to express a number as a product of primes.
What this calculator does
Enter a whole number of 2 or more and the calculator breaks it into its prime factors, listing every prime and the total count. At the defaults, 84 factors as 2 × 2 × 3 × 7 — four prime factors total. The decomposition is unique: no other collection of primes multiplies to 84, which is the guarantee of the fundamental theorem of arithmetic and the reason factorizations serve as fingerprints for numbers.
The method: trial division by smallest primes
The algorithm divides repeatedly by the smallest candidate that works. Starting at 2, it pulls out every factor of 2 before moving to 3, then 4 (which fails, since all the 2s are gone), then 5, 6, 7, and so on. The stopping rule is the elegant part: once the trial divisor squared exceeds what remains, whatever is left is itself prime, because a composite remainder would have a factor no larger than its square root — and every such factor has already been tried. This keeps the work proportional to √n rather than n, which is the difference between seconds and years for a twelve-digit input.
Why uniqueness holds
The fundamental theorem of arithmetic says every integer above 1 factors into primes in exactly one way, up to ordering. The proof idea is short: if 84 also equaled a different product of primes, some prime in one list would have to divide a product of the others, forcing it to appear in both lists — a contradiction that repeats until the lists match. Uniqueness is what makes the factorization useful downstream: the GCF of two numbers is read off the primes they share, and the LCM off the union, with no searching required.
Worked example at the defaults
Divide, record, repeat
- 84 ÷ 2 = 42, so the first factor is 2.
- 42 ÷ 2 = 21, so the second factor is 2 again.
- 21 ÷ 3 = 7, so the third factor is 3.
- 7 is prime and the trial divisor 4 has 4 × 4 = 16 > 7, so stop.
- Result: 84 = 2 × 2 × 3 × 7, with 4 prime factors.
Written with exponents, the same result is 2² × 3 × 7. Both notations appear in textbooks, and the exponent form makes the factor count less obvious — remember that 2² contributes two factors, not one, so 2² × 3 × 7 is four primes, matching the calculator’s count of 4.
Factorizations of common numbers
| n | Prime factorization | Exponent form | Prime count |
|---|---|---|---|
| 60 | 2 × 2 × 2 × 3 × 5 | 2³ × 3 × 5 | 5 |
| 84 | 2 × 2 × 3 × 7 | 2² × 3 × 7 | 4 |
| 97 | 97 | 97 (prime) | 1 |
| 100 | 2 × 2 × 5 × 5 | 2² × 5² | 4 |
| 720 | 2 × 2 × 2 × 2 × 3 × 3 × 5 | 2⁴ × 3² × 5 | 7 |
| 1024 | ten 2s multiplied | 2¹&sup0; | 10 |
The 97 row shows the stopping rule from the other side: no trial divisor from 2 through 9 divides it (9 × 9 = 81 ≤ 97, and 10 × 10 = 100 > 97), so 97 is reported as its own single-prime factorization. The 1024 row shows the other extreme — a power of 2 needs no divisor beyond the first one, and its ten factors are all 2. Prime powers are the fastest possible factorizations; primes are the shortest.
What factorizations unlock
- GCF and LCM become reading exercises: gcd(84, 90) = 2 × 3 = 6 from the shared primes, and lcm(84, 90) = 2² × 3² × 5 × 7 = 1,260 from the union.
- Fraction simplification is division by the shared primes: 84/90 divides by 6 to give 14/15.
- Radical simplification pulls squares out of roots: √720 = √(2⁴ × 45) = 4√45, then √45 = √(9 × 5) = 3√5, giving 12√5.
- Cryptography rests on the reverse problem: multiplying two large primes is instant, but factoring their product back is infeasible, which is the one-way door RSA is built on.
The GCF reading deserves one explicit walk-through. Factor 84 as 2² × 3 × 7 and 90 as 2 × 3² × 5; the shared primes at their lowest powers are 2 and 3, so the GCF is 6, and 84 ÷ 6 = 14 while 90 ÷ 6 = 15. The LCM takes every prime at its highest power instead — 2² from the 84, 3² from the 90, plus 5 and 7 — landing on 1,260. Both answers fall out of the factor lists with no trial division at all.
Common mistakes
- Stopping at 1 as a factor: 1 is not prime, and appending it to every list adds no information. The list for 84 ends at 7.
- Accepting composite factors: writing 84 = 6 × 14 is a correct factorization but not the prime one. Keep dividing until every piece is prime.
- Forgetting repeated primes: 84 has two 2s, and dropping one turns 2 × 2 × 3 × 7 into 42, a different number entirely. Always re-multiply the list as a check.
- Trial-dividing past the square root: if the remaining value is 7, testing 8, 9 and 10 wastes time — the rule says anything left when the divisor squared exceeds it is prime.
The universal check is one multiplication: multiply every factor in the list and confirm the product equals the input. 2 × 2 × 3 × 7 = 84 verifies the default result in one line.
Primes, factors and where to go next
The full factor list of a number — every product of its prime subsets — is a different object from the prime factorization: 84 has twelve factors in total (1, 2, 3, 4, 6, 7, 12, 14, 21, 28, 42, 84), which the factor calculator enumerates, while a prime number checker answers the yes-or-no primality question that trial division also settles. The three tools share one engine — trial division — but report different slices of the same structure: the complete factor list, the prime-only decomposition, and the primality verdict.
Frequently asked questions
What is the prime factorization of 84?
84 = 2 × 2 × 3 × 7, or 2² × 3 × 7 in exponent form. It has 4 prime factors in total.
Is the prime factorization unique?
Yes. The fundamental theorem of arithmetic guarantees exactly one prime decomposition for every whole number above 1, up to the order of the factors.
How do I factor a number by hand?
Divide repeatedly by the smallest prime that works: 84 ÷ 2 = 42, 42 ÷ 2 = 21, 21 ÷ 3 = 7, and 7 is prime. Stop when the divisor squared exceeds what remains.
What is a prime number?
A whole number above 1 whose only divisors are 1 and itself. The first several are 2, 3, 5, 7, 11, 13, 17, 19 and 23.
How does prime factorization give the GCF?
Multiply the primes both numbers share, at their lowest powers. For 84 = 2² × 3 × 7 and 90 = 2 × 3² × 5, the shared primes give gcd = 2 × 3 = 6.
How does prime factorization give the LCM?
Take every prime that appears in either number, at its highest power. For 84 and 90 that is 2² × 3² × 5 × 7 = 1,260.
How many prime factors does 1024 have?
Ten, all of them 2, since 1024 = 2 to the power of 10. A prime power’s factor list repeats the same prime as many times as the exponent says.
Why is factoring hard for huge numbers?
Trial division costs about √n operations, which is trivial below a trillion but hopeless for the 600-digit products used in RSA encryption. No fast classical algorithm for that reversal is known, and the difficulty is the security guarantee itself.
Method and sources
- Fundamental theorem of arithmetic and trial-division factoring.