logo

Apka Apna Career Saathi

Best Career for Me AI Powered

Math Prime Number Calculator

--

How this prime number calculator works

Enter a whole number. The calculator reports whether it is prime. A prime has exactly two distinct positive divisors: 1 and itself. 7 is prime. 4 is not, because 2 × 2 = 4. The result line shows “Prime Number” or “Not Prime Number.” Until you type a value, it stays as “--.”

The check follows the same rules as the code. Any value that is not an integer, or is less than 2, counts as not prime, so 1, 0, negatives, and decimals all fail. 2 is accepted immediately as the only even prime. Every other even number fails because it is divisible by 2.

Odd candidates are tested against odd divisors from 3 through the square root of the number. If any divisor divides evenly, the number is composite. If none do, it is prime. 9 fails because 3 divides it. 97 has no such divisor through about 9.8, so it is prime. 100 fails at once as an even number greater than 2.

This page only answers yes or no. It does not list factors. For a product of primes such as 12 = 2 × 2 × 3, use a prime factors tool. Here you only learn whether the number itself is prime.

Prime check examples

Each row matches the calculator result for that integer.

NumberResultWhat it marks
2Prime NumberSmallest and only even prime
3Prime NumberNext odd prime
4Not Prime Number2 × 2
7Prime NumberNo divisor through √7
9Not Prime Number3 × 3
1Not Prime NumberBelow 2
97Prime NumberLarger prime
100Not Prime NumberEven and composite

How to read the result

  • Prime Number

    Only 1 and the number itself divide it. 2, 3, 7, and 97 qualify.

  • Not Prime Number

    Below 2, even above 2, or divisible by an odd factor through its square root.

  • Empty field

    Shows “--” until you enter a value.

  • Decimals and negatives

    Never count as prime on this page.

Frequently asked questions

  • What does this prime number calculator check?

    Whether the integer you enter is prime. A prime has exactly two distinct positive divisors: 1 and itself. 7 is prime. 4 is not, because 2 × 2 = 4. The page shows “Prime Number” or “Not Prime Number.”

  • How does the check work?

    Numbers below 2 are rejected as not prime. 2 is accepted as the only even prime. Any other even number fails at once. Odd candidates are tested against odd divisors from 3 up through the square root of the number. If none divide evenly, the number is prime.

  • Is 1 a prime number?

    No. The calculator requires an integer of at least 2. 1 has only one positive divisor, so it is not prime and shows “Not Prime Number.”

  • Is 2 a prime number?

    Yes. 2 is the smallest prime and the only even prime. Entering 2 shows “Prime Number.” Every larger even number is divisible by 2 and is not prime.

  • What about 0 and negative numbers?

    They are not prime. The check needs a whole number greater than or equal to 2. 0, −1, and −17 all show “Not Prime Number.”

  • Can I enter a decimal?

    A non-integer is never treated as prime. 3.5 or 9.1 shows “Not Prime Number.” Use a whole number if you want a true prime check.

  • What does the empty result mean?

    Before you type anything, the result is “--.” After you enter a value, it switches to “Prime Number” or “Not Prime Number.”

  • Why is 9 not prime but 7 is?

    9 equals 3 × 3, so 3 divides it and the check fails. 7 has no divisor other than 1 and 7 between 2 and its square root, so it is prime.

  • Is this the same as listing prime factors?

    No. This page only answers yes or no. A separate prime factors calculator writes a number as a product of primes, such as 12 = 2 × 2 × 3. Here you only learn whether the number itself is prime.

  • How can I double-check a result?

    Try dividing by every whole number from 2 through the square root of your number. If any division is exact, it is not prime. For 97, the square root is about 9.8, so checking up through 9 is enough; none divide 97, so it is prime.