Prime Factorization Calculator

Every whole number greater than 1 is either prime or can be written in exactly one way as a product of primes. Enter a number to see its prime factorization, whether it is prime, how many divisors it has and a full list of those divisors.

Prime factorization2³ × 3² × 5
Prime number?
No
Number of divisors
24
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

How to use the Prime Factorization Calculator

  1. Enter a whole number from 2 up to one trillion.
  2. Read the prime factorization, with exponents shown as small numbers.
  3. Check whether the number is prime.
  4. See the count and list of all divisors.

Formula used

Divide by the smallest possible prime repeatedly (2, 3, 5, 7, …) until the quotient is 1. The number of divisors is the product of (exponent + 1) over all prime factors.

Worked example

Here is the Prime Factorization Calculator worked through with the example values shown above, so you can check each step by hand.

Inputs
Whole number (2 to 1,000,000,000,000)360
Result
Prime factorization2³ × 3² × 5
Prime number?No
Number of divisors24
Divisors1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360

How prime factorization works

Divide the number by the smallest prime that divides it, then repeat with the quotient until you reach 1. For 360: 360 ÷ 2 = 180, ÷ 2 = 90, ÷ 2 = 45, ÷ 3 = 15, ÷ 3 = 5, ÷ 5 = 1. The factorization is 2³ × 3² × 5, which means 2 × 2 × 2 × 3 × 3 × 5 = 360.

The Fundamental Theorem of Arithmetic guarantees that this factorization is unique, apart from the order of the factors.

Counting and listing divisors

The number of divisors comes from the exponents: add 1 to each and multiply. For 360 = 2³ × 3² × 5¹, the count is (3+1) × (2+1) × (1+1) = 24. The divisors are 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360.

A prime number has exactly two divisors. For example, 97 has 2: 1 and 97. A number such as 64 = 2⁶ has 7 divisors.

Primes and how to recognise them

A prime is a number greater than 1 whose only divisors are 1 and itself: 2, 3, 5, 7, 11, 13, 17, 19, 23 and so on. Two is the only even prime. The number 1 is not prime, because it has only one divisor. Numbers that are not prime are called composite.

The calculator tests a number by trying every divisor up to its square root. It can check numbers up to one trillion quickly, and, for example, confirms that 999,999,000,001 is prime: 999999000001 (prime).

Uses in maths

Factorizations let you find the greatest common divisor (HCF) and the least common multiple (LCM) of two numbers: take the lowest exponent of each shared prime for the HCF, and the highest exponent of every prime for the LCM. The HCF and LCM calculator on this site does this directly. Factorization also helps simplify fractions and radicals and underlies the security of some encryption systems, which rely on the difficulty of factoring very large numbers.

For everyday tasks, divisors tell you all the ways to split a number into equal groups. 360 has 24 divisors, which is one reason it was used for the number of degrees in a circle.

Divisibility tests

You can often find the smallest prime factor by inspection. A number is divisible by 2 if its last digit is even, by 5 if it ends in 0 or 5, and by 3 if the sum of its digits is divisible by 3. It is divisible by 9 if the digit sum is divisible by 9, and by 11 if the alternating sum of its digits is divisible by 11.

For example, 4,563 has a digit sum of 18, so it is divisible by 9 (and so by 3). These tests speed up factorizing by hand. To check whether a number is prime, you only need to test primes up to its square root.

Frequently asked questions

Is 1 a prime number?

No. A prime has exactly two divisors, 1 and itself. The number 1 has only one divisor.

Is 2 prime?

Yes. It is the only even prime number.

What is the largest number I can enter?

One trillion (1,000,000,000,000).

What does the small raised number mean?

It is an exponent. 2³ means 2 × 2 × 2.

How do I find the HCF from prime factors?

Multiply the primes shared by both numbers, using the lower exponent of each.

Can negative numbers or decimals be factored?

This calculator works with whole numbers of 2 or more.

How do I know if a number is divisible by 3?

Add its digits. If the sum is divisible by 3, so is the number.

This calculator gives estimates for information only. Actual figures from a bank, employer, tax authority or doctor may differ. It is not financial, tax, legal or medical advice.