Asistente RD

Prime factorization calculator

Break a positive integer (2 to 10^12) into its prime factors with exponents, e.g. 360 = 2^3 x 3^2 x 5, and find out if it is prime. Free, in your browser.

Free · No sign-up · In your browser

Type an integer between 2 and 1,000,000,000,000 (10^12) and get its prime factorization with exponents, the list of factors and whether the number is prime. Everything is computed in your browser.

Factorization

360 = 23 × 32 × 5

360 is a composite number.

Prime factors

2 × 2 × 2 × 3 × 3 × 5

Number of factors (with repetition)

6

Distinct prime factors

3

Share on WhatsApp Last reviewed: July 9, 2026

What prime factorization is

Prime factorization means rewriting a whole number as a product of prime numbers — the numbers greater than 1 whose only divisors are 1 and themselves (2, 3, 5, 7, 11, 13…). The fundamental theorem of arithmetic promises that every integer above 1 has exactly one prime factorization, apart from the order of the factors. That is why 360 always breaks down into 2 x 2 x 2 x 3 x 3 x 5, no matter how you get there.

When the same prime shows up more than once, we collect it with an exponent: 2 x 2 x 2 becomes 2^3. So the compact form of 360 is 2^3 x 3^2 x 5. This calculator gives you both views — the compact form with exponents and the full list of factors — and it tells you whether the number is prime (it cannot be broken down any further) or composite.

Every calculation runs in your browser; nothing is sent to a server.

How to use the calculator

  1. Type an integer from 2 up to 1,000,000,000,000 (10^12) in the field.
  2. Read the factorization with exponents in the dark card, and just below it whether the number is prime or composite.
  3. Check the list of prime factors (with repetition), the total number of factors and how many distinct primes there are.
  4. Press Copy to send the whole expression (for example 360 = 2^3 x 3^2 x 5) to your clipboard.

The result updates as you type — there is no “calculate” button to press.

The method: trial division

The algorithm tries to divide the number by increasing primes:

  1. Divide by 2 as many times as possible; each successful division adds 1 to the exponent of 2.
  2. Move on to the odd numbers 3, 5, 7, 9… and repeat for each.
  3. You only need to test divisors up to the square root of the number: once d x d is larger than what remains, that remainder is already prime.
  4. If a value greater than 1 is left at the end, that leftover is the final prime factor.

Testing only up to the square root is what keeps it fast: for a number close to 10^12 you check divisors up to a million, not up to a trillion.

NumberPrime factorsTotal (with repetition)DistinctPrime?
122^2 x 332No
842^2 x 3 x 743No
1002^2 x 5^242No
3602^3 x 3^2 x 563No
10002^3 x 5^362No
10242^10101No
131955 x 7 x 13 x 2944No
979711Yes

Worked example

Let us factorize 360 by hand, following the method:

  • 360 ÷ 2 = 180
  • 180 ÷ 2 = 90
  • 90 ÷ 2 = 45 → 2 appears three times, so 2^3
  • 45 ÷ 3 = 15
  • 15 ÷ 3 = 5 → 3 appears twice, so 3^2
  • 5 ÷ 5 = 1 → 5 appears once

Putting it together: 360 = 2^3 x 3^2 x 5. The list with repetition is 2 x 2 x 2 x 3 x 3 x 5 — six factors in total and three distinct primes (2, 3 and 5). Check: 8 x 9 x 5 = 360. Because it has more than one prime factor, 360 is composite, not prime.

Why it matters

Prime factorization is the backbone of a lot of middle-school arithmetic. From it you can read off the greatest common divisor (multiply the shared primes at their lowest exponent) and the least common multiple (take every prime at its highest exponent), simplify fractions, count divisors or spot perfect squares. It also underpins modern cryptography: multiplying two large primes is easy, but undoing that product — factoring it — is so slow that it keeps your messages safe.

Frequently asked questions

Is 1 a prime number?

No. By convention 1 is neither prime nor composite: it does not have exactly two distinct divisors. That is why the calculator only accepts numbers from 2 upward — 2 is the first prime and the only even one.

How do I tell whether a number is prime?

If its factorization is a single factor with exponent 1 (the number itself), then it is prime: it cannot be written as a product of smaller primes. The calculator states this for you with the message “is a prime number”.

Why only test divisors up to the square root?

Because divisors come in pairs: if a x b = n and a is at most the square root of n, then b is at least that square root. Searching for the smaller partner of each pair means you never have to look past the square root; if you found none by then, whatever remains is prime.

What is the largest number allowed?

The limit is 1,000,000,000,000 (10^12). With trial division, factoring larger numbers can take too long in a browser, so we cap it there to keep every answer instant.

Does it work for negative numbers or decimals?

No: prime factors are only defined for positive integers greater than 1. If you enter a decimal, a negative, 0 or 1, the tool shows a short message instead of returning a wrong answer.

Related tools