Prime factorization calculator with divisors and exponents

Type a whole number and get its prime factorization in exponent form, such as 360 = 2³ × 3² × 5, together with the number of divisors, their sum, Euler's totient and the full divisor list.

Live demo · real result from this tool
360 =2³ × 3² × 5
Number of divisors
24
Sum of divisors
1,170
Euler's totient φ(n)
96

Prime factors

PrimeExponentContribution
238
329
515

All divisors

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360

Processed on your device — nothing is uploaded.

How to use the prime factorization tool

  1. Type a whole number of 2 or more in Whole number (2 or more). You may include commas, such as 1,001.
  2. Read the factorization on the top line, written with exponents.
  3. Look at the Prime factors table for each prime, its exponent and what it contributes.
  4. Below that you get the number of divisors, their sum, Euler’s totient φ(n) and, when there are 500 or fewer, every divisor in order.

What it does and when to use it

Every whole number above 1 can be written as a product of primes in exactly one way. This is called the fundamental theorem of arithmetic. Writing a number this way is the first step for many school problems: simplifying fractions and square roots, finding the highest common factor and lowest common multiple, and spotting perfect squares and cubes.

For HCF and LCM directly, use the GCD and LCM calculator. To simplify a fraction in one step, try the fraction calculator.

How it works

The tool works with exact whole numbers of any size, then:

  1. Trial division by every prime up to 1,000. Each prime is divided out as many times as it fits.
  2. If something larger is left, a Miller–Rabin test checks whether it is prime. With 13 fixed bases this test is proven correct for numbers below about 3.3 × 10²⁴.
  3. A leftover that is a perfect square is split by taking its square root.
  4. Other composite leftovers are split with Pollard–Brent rho, a method that finds a factor much faster than trying every divisor.

From the factorization n = p₁^a × p₂^b × …, the extra lines use standard formulas:

  • number of divisors = (a + 1)(b + 1)…
  • sum of divisors = (p₁^(a+1) − 1)/(p₁ − 1) × …
  • φ(n) = (p₁ − 1)p₁^(a−1) × …

Step by step for 360, the way you would do it by hand:

  1. 360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45. That is three 2s.
  2. 45 ÷ 3 = 15, ÷ 3 = 5. That is two 3s.
  3. 5 is prime.
  4. So 360 = 2 × 2 × 2 × 3 × 3 × 5 = 2³ × 3² × 5.

The tool shows 2³ × 3² × 5, 24 divisors, a divisor sum of 1,170 and φ(360) = 96.

Worked examples

360. 2³ × 3² × 5 with Number of divisors: 24, listed as 1, 2, 3, 4, 5, 6, 8, 9, 10 and so on up to 360.

28, a perfect number. 28 = 2² × 7. Its divisors add up to 56, which is exactly 2 × 28, so the tool adds Perfect number: yes.

144, a perfect square. 144 = 2⁴ × 3². Every exponent is even, so the result includes Perfect square: yes and Number of divisors: 15.

A 12-digit number. 600851475143 splits into 71 × 839 × 1471 × 6857.

Limits and tips

  • Inputs above 60 digits are refused.
  • When every exponent is a multiple of 3, the number is a perfect cube, though the tool does not label it.
  • Your number is factored in the browser and is never sent anywhere.

Frequently asked questions

What is the largest number I can factor?
Up to 60 digits. Numbers up to about 10²⁰ almost always factor completely in a moment. If a number has two or more very large prime factors, the tool may stop after about a second and tell you which part it could not split.
What happens with 0, 1 or a negative number?
0 and 1 have no prime factorization, so the tool asks for 2 or more. For a negative number it factors the positive part and writes −1 × in front.
Why does the result say "is prime"?
A prime has no factors other than 1 and itself, so its factorization is just the number. The prime checker also gives the next and previous primes.
How do I get the number of factors from the exponents?
Add 1 to each exponent and multiply. For 360 = 2³ × 3² × 5¹ that is (3 + 1)(2 + 1)(1 + 1) = 24 divisors, which matches the tool.
Can I type 1e12 or numbers with commas?
Yes. Commas, spaces and underscores are ignored, and E notation such as 1e12 is read as a whole number. Decimals such as 12.5 are rejected.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close