Prime Factorization Calculator
Enter a number to see its prime factorization
Result
How it is calculated
The tool uses trial division. It tries each divisor d from 2 upward, divides the number by d as many times as it goes in evenly and counts how many times, then moves on. It stops when d × d is larger than what is left; any remainder above 1 is itself a prime. The result is shown as a product with exponents, as the list of every factor written out, and as the count of distinct primes.
The input must be a whole number of 2 or more. Decimals such as 1.5, negative numbers, 0 and 1 give no result because they have no prime factorization. A value like 360.0 is accepted as 360. Very large numbers become slow, and above roughly 15 digits the tool loses precision: 9007199254740993 comes back as 2⁵³, which is wrong, so treat results for numbers that long as unreliable.
Worked example
Factor 360. Divide by 2: 180, 90, 45, so 2 goes in three times and leaves 45. Divide by 3: 15, then 5, so 3 goes in twice and leaves 5. Since 5 is larger than the remaining search limit, 5 is prime itself. The compact form is 2³ × 3² × 5, with 3 distinct primes, and written out in full it is 2 × 2 × 2 × 3 × 3 × 5. Check: 8 × 9 × 5 = 360.
Common mistakes
- Entering 1 and expecting a factorization. 1 is not a prime and has no prime factors, so the tool shows nothing.
- Counting the factor list instead of the distinct primes. The count shows how many different primes appear (3 for 360), not the number of factors written out (6).
- Mixing up prime factors with all divisors. 360 has many divisors, such as 4, 6 and 12, but only 2, 3 and 5 are prime.
- Trusting results for numbers with 16 or more digits. The calculation uses floating-point numbers that can round the input.
- Typing a number with a thousands separator or a decimal part and expecting it to be read; only plain whole numbers work.
About this calculator
This calculator breaks any whole number down into its prime factors using trial division — testing 2, 3, 5, 7 and onward until only primes remain — and shows both the expanded product and the compact exponent form (like 2³ × 3² × 5).
Math students use it to check factoring homework, and prime factorization is the foundation of topics like finding the GCD/LCM of numbers and the basic number theory that underlies public-key cryptography like RSA.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)