Toolvito

Works on this device

Prime & Factor Calculator

Split a whole number into its prime factors, list every factor and factor pair, or check whether a number is prime. The answers are exact, and the page shows the working.

Enter your values

Writes a whole number as a product of prime numbers, with a division ladder or a factor tree.

Your values

Digits only, without commas. For example 360.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose the button below them.

How to use this calculator

  1. Choose what you want to find, for example Prime factorisation of a number.
  2. Type a whole number with digits only. Do not use commas or spaces inside the number.
  3. For a prime factorisation, choose a division ladder or a factor tree for the working.
  4. Choose the button under the form. You can copy the result, print it, or download it as a CSV file.

What the words mean

  • A factor (or divisor) of a number divides it with no remainder. The factors of 12 are 1, 2, 3, 4, 6 and 12.
  • A prime number is a whole number above 1 with exactly two factors: 1 and itself. The first primes are 2, 3, 5, 7 and 11.
  • A composite number is a whole number above 1 that is not prime. The numbers 0 and 1 are neither prime nor composite.
  • The prime factorisation writes a number as a product of primes, such as 360 = 2^3 × 3^2 × 5. Every whole number above 1 has exactly one such product.
  • The number of factors is found from the powers: add 1 to each power and multiply. For 360 this is 4 × 3 × 2 = 24.
  • The common factors of several numbers are the factors of their greatest common factor.

Worked example

Take 360. Divide by 2 three times: 360, 180, 90, 45. Divide by 3 twice: 45, 15, 5. Then 5 is prime. So 360 = 2 × 2 × 2 × 3 × 3 × 5 = 2^3 × 3^2 × 5.

360 has (3 + 1) × (2 + 1) × (1 + 1) = 24 factors. The factor pairs start with 1 × 360, 2 × 180 and 3 × 120, and end with 18 × 20.

The number 97 is prime: no prime up to its square root (2, 3, 5 and 7) divides it. The prime before it is 89 and the next one is 101.

The common factors of 36, 48 and 60 are 1, 2, 3, 4, 6 and 12, the factors of their greatest common factor 12.

How the page works and its limits

  • Factorisation and factor lists work for whole numbers up to 1,000,000,000,000,000,000 (19 digits). The page divides by the primes below 100,000, then uses a primality test and Pollard's rho method for what is left.
  • The prime check works for whole numbers below 1,000,000,000,000,000,000,000,000 (24 digits). It uses the Miller–Rabin test with the first 13 primes as bases, which is proved to be correct for numbers of this size.
  • A list of factors is shown when a number has at most 10,000 factors. Larger lists are counted but not printed.
  • A list of primes can end at 1,000,000,000,000 at most, and its two ends can be at most 100,000 apart.
  • This page works with whole numbers only. To factor an expression with letters, such as x^2 + 5x + 6, use an algebra tool.

Related tools