AI Tools Free

Prime Factorization Calculator

Enter any whole number from 2 to 1,000,000,000 into this prime factorization calculator to decompose it into its ascending product of repeated prime factors (2 × 2 × 2 × 3 × 3 × 5). All factorizations run directly in your browser using trial division with one-click copy and .txt export.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Calculate result.

Your result
Enter your details

Result will appear here

How to calculate prime factors with this prime factor calculator

By the Fundamental Theorem of Arithmetic, every composite integer greater than 1 has a unique prime factorization up to the order of the factors. You can also test whether an integer is prime first in our Prime Number Checker.

Trial Division Loop: extract p = 2 while x % 2 === 0; then test odd divisors p = 3, 5, 7, ... while p * p <= x; finally append x if x > 1.

Because the maximum input is 1,000,000,000, the loop tests at most odd divisors up to floor(sqrt(10^9)) = 31,622 (15,811 iterations worst-case) and formats the prime factor array with a.join(' × ').

Diagram showing trial division decomposing 360 into 2 × 2 × 2 × 3 × 3 × 5 (2^3 × 3^2 × 5)
Trial division extracts three factors of 2, two factors of 3, and one factor of 5 from 360.

Prime Factorization Reference Table (Expanded Factors, Exponents & Divisors)

Compare 10 benchmark integers from 12 to 1,000,000,000 alongside their expanded prime factor product, prime-power notation, distinct primes, and total divisor count d(n) = Π(e_i + 1).

Integer (n)Expanded Prime Factors (×)Prime Power NotationDistinct PrimesTotal Divisors d(n) = Π(e_i + 1)Mathematical Classification
122 × 2 × 32^2 × 3^12, 3(2+1)(1+1) = 6Smallest abundant number
602 × 2 × 3 × 52^2 × 3^1 × 5^12, 3, 53 × 2 × 2 = 12Highly composite (sexagesimal base)
979797^1971 + 1 = 2Largest two-digit prime number
1442 × 2 × 2 × 2 × 3 × 32^4 × 3^22, 3(4+1)(2+1) = 15Perfect square (12^2, odd divisor count)
3602 × 2 × 2 × 3 × 3 × 52^3 × 3^2 × 5^12, 3, 54 × 3 × 2 = 24Highly composite (preloaded sample)
1,0242 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 22^10210 + 1 = 11Pure power of two (1 KiB)
2,3102 × 3 × 5 × 7 × 112^1 × 3^1 × 5^1 × 7^1 × 11^12, 3, 5, 7, 112^5 = 325th primorial (p_5#, square-free)
5,0402 × 2 × 2 × 2 × 3 × 3 × 5 × 72^4 × 3^2 × 5^1 × 7^12, 3, 5, 75 × 3 × 2 × 2 = 60Factorial 7! (superior highly composite)
999,999,937999999937999999937^19999999371 + 1 = 2Largest prime under 1,000,000,000
1,000,000,0002 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 5 × 5 × 5 × 5 × 5 × 5 × 5 × 5 × 52^9 × 5^92, 5(9+1)(9+1) = 100Maximum supported input (10^9)

How to calculate prime factors in 3 steps

Decompose any positive integer from 2 to 1,000,000,000 in three steps.

Enter a whole number up to 1B

Type or paste a whole number between 2 and 1000000000 into the Integer to factor field (360 is preloaded as the default example).

Input and settings
Prime Factorization Calculator input field populated with 360
Step 1: Enter any whole number from 2 to 1,000,000,000 in the Integer to factor input box.

Click Calculate result to run trial division

Select Calculate result to divide out 2 and odd primes in ascending order and build the complete multiplication chain ( × ).

Tool result
Prime Factorization Calculator result panel showing 2 × 2 × 2 × 3 × 3 × 5 for 360
Step 2: Click Calculate result to decompose the integer into ascending prime factors.

Copy or download the factor chain

Read the factor string in Your result, or use Copy and Download (result.txt) to save long factorizations like 1,000,000,000.

Review the details
Prime Factorization Calculator Copy and Download result.txt actions for the prime product
Step 3: Copy the factor product to your clipboard or download result.txt.

Worked examples: prime factorization for GCF, LCM, and square roots

See how repeated prime factors convert into exponential form, greatest common factors, least common multiples, and exact square roots.

Factoring 360 into repeated primes

Entering 360 divides by 2 three times (360 -> 180 -> 90 -> 45), by 3 twice (45 -> 15 -> 5), and stops at prime 5, returning 2 × 2 × 2 × 3 × 3 × 5. Grouping identical primes gives 2^3 × 3^2 × 5^1, which you can evaluate back to 360 in our Exponent Calculator.

Worked example decomposing 360 into 2 × 2 × 2 × 3 × 3 × 5 (2^3 × 3^2 × 5)
Repeated trial division factors 360 into 2 × 2 × 2 × 3 × 3 × 5 (2^3 × 3^2 × 5).

Finding GCF and LCM from factor trees

Decomposing 360 gives 2^3 × 3^2 × 5^1, while 756 factors into 2^2 × 3^3 × 7^1. Picking the smallest shared prime exponents yields GCF(360, 756) = 2^2 × 3^2 = 36, whereas picking the largest prime exponents yields LCM(360, 756) = 2^3 × 3^3 × 5 × 7 = 7,560. Verify both with the GCF Calculator, LCM Calculator, or Fraction Simplifier.

Worked example comparing prime exponents of 360 and 756 to compute GCF = 36 and LCM = 7,560
Comparing the prime-power exponents of 360 and 756 yields GCF = 36 and LCM = 7,560.

Extracting square roots and counting divisors

For the perfect square 1,764, the tool returns 2 × 2 × 3 × 3 × 7 × 7 (2^2 × 3^2 × 7^2). Because every exponent is even, halving each exponent gives the exact square root 2^1 × 3^1 × 7^1 = 42 (check with the Nth Root Calculator). Adding 1 to each exponent and multiplying gives (2+1)(2+1)(2+1) = 27 positive divisors.

Worked example extracting sqrt(1,764) = 42 and 27 divisors from 2^2 × 3^2 × 7^2
Halving even prime exponents in 1,764 = 2^2 × 3^2 × 7^2 gives sqrt(1,764) = 42 and 27 total divisors.

How to read the prime factorization calculator output

When the tool finishes factoring your input, it formats the ascending prime product according to three output patterns:

For composite numbers (such as 360 -> 2 × 2 × 2 × 3 × 3 × 5), every factor in the chain is prime, and multiplying all listed numbers together reconstructs your exact starting integer. To write exponential notation (p_1^e_1 × p_2^e_2 ...), count how many times each distinct prime repeats in the string.

For prime numbers (such as 97 -> 97 or 999999937 -> 999999937), the output contains a single integer identical to your input because it has no proper divisors between 2 and floor(sqrt(x)). Whenever a formatted factor chain reaches 40 characters or longer (such as 1,000,000,000, which expands to 18 factors and 65 characters), #result-main displays 'Result ready' and #result-extra holds the complete factor chain with Copy and Download (result.txt) buttons.

Comparison of composite factor chains, single-prime outputs, and 40+ character factor outputs
Composite numbers expand into ' × ' prime chains, primes return themselves, and 40+ char chains open in #result-extra.

Prime factorization calculator input range (2 to 1,000,000,000) and rules

Keep these validation boundaries in mind before clicking Calculate result:

First, enter a whole number of at least 2 (x >= 2) and at most 1,000,000,000 (10^9). Why aren't 0 and 1 allowed? Zero has infinitely many divisors (0 = 0 × p), and 1 is a multiplicative unit rather than a prime. Capping x at 10^9 limits the trial division loop to at most 15,811 iterations (floor(sqrt(10^9)) = 31,622), so even a nine-digit prime like 999,999,937 completes in under two milliseconds in your browser.

Second, decimal numbers (36.5), negative integers (-360), fractions (3/4), or commas trigger 'Enter a valid Integer to factor.' To factor a negative integer -n, factor its positive magnitude n and prepend -1 ×. To test individual remainders on larger numbers, use our Modulo Calculator.

Summary of the 2 to 1,000,000,000 integer input range and sqrt(x) <= 31,622 trial division bound
Accepts whole numbers from 2 to 1,000,000,000 with worst-case trial division bounded by sqrt(10^9) <= 31,622.

Frequently asked questions about prime factorization

Answers about using Prime Factorization Calculator and understanding its results.

How do you calculate the prime factorization of a number by hand?

Start by dividing your number by the smallest prime, 2, as many times as it divides evenly. Once the quotient becomes odd, test 3, then 5, 7, 11, and subsequent primes in ascending order until the final quotient reaches 1. Multiplying all the prime divisors you extracted reconstructs the original number.

Why is 1 not included in prime factorization?

By definition, a prime number must have two distinct positive divisors (1 and itself), whereas 1 has only one positive divisor. If 1 were treated as prime, you could attach 1 × 1 × 1 to any factorization and lose the single unique prime decomposition required for every n >= 2.

How do I convert expanded prime factors (2 × 2 × 2 × 3 × 3 × 5) into exponents?

Group identical prime factors together and count how many times each prime appears. In 2 × 2 × 2 × 3 × 3 × 5, the prime 2 appears 3 times, 3 appears 2 times, and 5 appears 1 time, which condenses to 2^3 × 3^2 × 5^1 (or 2^3 * 3^2 * 5 in plain text).

How can I find the total number of divisors from a prime factorization?

First write the prime factorization in exponential form n = p_1^e_1 × p_2^e_2 × ... × p_k^e_k. Then add 1 to each exponent and multiply those sums together: d(n) = (e_1 + 1)(e_2 + 1)...(e_k + 1). For 360 (2^3 × 3^2 × 5^1), the total number of positive divisors is (3+1)(2+1)(1+1) = 4 × 3 × 2 = 24.

Why does the calculator stop testing divisors at the square root of the number?

If a composite number x has a factor greater than sqrt(x), its matching cofactor x / p must be smaller than sqrt(x) (since sqrt(x) × sqrt(x) = x). Therefore, if no integer between 2 and floor(sqrt(x)) divides x evenly, x cannot have any larger proper factor either and must be prime.

Can I factor numbers larger than 1,000,000,000 in this tool?

The input field caps values at 1,000,000,000 (10^9) so that trial division finishes in milliseconds without freezing your browser tab. If you have an even number or a multiple of 10 above 1,000,000,000 (such as 36,000,000,000), divide out obvious powers of 10 (10 = 2 × 5) or 2 first, factor the remaining quotient under 10^9, and combine the prime factors.

Decompose your integer into prime factors now

Choose another tool for your next calculation, conversion, or text task.

Calculate result