All tools · Utilities

Prime Checker

Check if a number is prime and find its factors.

Free to use, no sign-up required. Prime Checker is one of 198 tools built into Xenition, alongside a chat that can use them for you.

Tells you whether a whole number is prime and breaks it down into its prime factors.

How to use Prime Checker

  1. Enter an Integer of 2 or more. Decimals are rounded down.
  2. Read Prime? for a yes or no.
  3. Read Factors for how many prime factors there are, counting repeats, and the factorisation written out below.

How it works

Primality uses the Miller–Rabin test with the first twelve primes (2 to 37) as bases, which gives a certain answer for every number below 2⁶⁴, about 1.8 × 10¹⁹. Larger numbers show too large to check. Factorisation uses trial division by 2, 3, 4 and upward while the divisor squared is no larger than what remains, and is shown for numbers up to one trillion (10¹²).

Example

360 = 2 × 2 × 2 × 3 × 3 × 5, so it has 6 prime factors and is not prime. 97 is prime. 1001 = 7 × 11 × 13. 1,000,000,000,039 is prime too, but it is above 10¹², so no factorisation is listed.

Questions about Prime Checker

Is 1 a prime number?

No. A prime has exactly two distinct divisors, 1 and itself, and 1 has only one. Excluding it also keeps every number’s prime factorisation unique.

Why only check divisors up to the square root?

If a number has a factor larger than its square root, the matching factor must be smaller than it, so it would already have been found.

Use it from chat

You do not have to open Prime Checker to use it. Ask Xenition in plain language and it runs the right tool, then carries the answer into whatever you are working on — a document, a spreadsheet, a deck.

Related tools