Number Classifier

Enter an integer and the number classifier reports five properties at once, each with a one-line reason: parity, sign, prime or composite, perfect square and perfect cube.

Classify a number

Any whole number. Primality is proven for values below 3.3 × 10²⁴.

Try an example:

The properties explained

Even or odd

Whether the number leaves remainder 0 or 1 when divided by 2. Every integer is exactly one of the two. For the full explanation see the Even and Odd Test.

Positive, negative or zero

Positive numbers are greater than zero and negative numbers are less than zero. Zero is neither positive nor negative, but it is even.

Prime, composite or neither

A prime is an integer greater than 1 whose only positive divisors are 1 and itself (2, 3, 5, 7, 11, …). A composite number is an integer greater than 1 that is not prime, so it has another divisor; the classifier shows one factorisation such as 91 = 7 × 13. The numbers 0 and 1, and all negative integers, are neither prime nor composite by the standard definition.

Primality is decided with a deterministic Miller–Rabin test, which is proven correct for every integer below 3.3 × 1024. For larger inputs the classifier says so rather than guessing.

Perfect square

A perfect square is the square of an integer: 0, 1, 4, 9, 16, 25, …. Negative numbers are never perfect squares, because any integer multiplied by itself is zero or positive. When a number is not a square, the classifier shows the two squares it lies between.

Perfect cube

A perfect cube is an integer multiplied by itself three times: 0, 1, 8, 27, 64, …. Unlike squares, cubes can be negative: (−3)³ = −27. Roots are computed with exact integer arithmetic, so very large cubes are recognised correctly.

Examples

NumberParitySignPrime?Square?Cube?
36EvenPositiveComposite (2 × 18)Yes, 6²No
17OddPositivePrimeNoNo
64EvenPositiveCompositeYes, 8²Yes, 4³
−27OddNegativeNeitherNoYes, (−3)³
0EvenNeitherNeitherYes, 0²Yes, 0³
1OddPositiveNeitherYes, 1²Yes, 1³

How to use the classifier

  1. Type any integer, or pick one of the examples.
  2. Select Classify Number.
  3. Read the property table; each row includes the reason behind the answer.

Frequently asked questions

Why is 1 not a prime number?

A prime must have exactly two distinct positive divisors. 1 has only one. Excluding 1 also keeps prime factorisations unique.

Can a number be both a perfect square and a perfect cube?

Yes. These are the sixth powers: 0, 1, 64 (8² and 4³), 729 (27² and 9³) and so on.

Why does the classifier call −7 neither prime nor composite?

Primes and composites are defined for integers greater than 1. Some algebra texts extend the idea to negatives, but the standard school definition does not.

How big a number can I classify?

Up to 1,000 digits for parity, sign, squares and cubes. Primality is proven for values below 3.3 × 10²⁴.