Is It A Prime Number
Check whether a number is prime: enter any integer and see the result right away, with extra details when it is composite.
Enter the Details
Result will appear here...
What this calculator does
So, you have a single number and you want to know one thing: is it prime? This tool answers exactly that. Enter a number and it tells you yes or no.
It is the focused version of a prime tool: not a list, not a factorization, just a straight verdict on whether the one number you entered is prime.
How to use it
- Enter a positive whole number.
- Press Calculate to see whether it is prime.
What makes a number prime
A prime number is a whole number greater than 1 that has exactly two divisors: 1 and itself. Nothing else divides it evenly. So 7 is prime, because only 1 and 7 divide it, while 12 is not, because 2, 3, 4, and 6 all divide it as well. Numbers greater than 1 that are not prime are called composite, meaning they can be composed by multiplying smaller numbers. The whole question of primality comes down to this: does anything divide the number besides 1 and itself?
Why 1 is not prime
The number 1 is a special case, and the tool treats it correctly by answering no. Although 1 has no divisors other than itself, it fails the definition of a prime, which requires exactly two different divisors. The number 1 has only one divisor, itself, so it falls short. There is a deeper reason too: if 1 were counted as prime, then prime factorizations would no longer be unique, since you could throw in any number of 1s. Leaving 1 out keeps the building blocks of arithmetic tidy.
How the tool checks
The tool uses a classic method called trial division, with a clever shortcut. To see if a number is prime, it tries dividing it by the whole numbers starting from 2. If any of them divides evenly, the number is composite and the answer is no. If none do, it is prime. The shortcut is that it only needs to test divisors up to the square root of the number, not all the way up to the number itself. That is because if a number had a factor larger than its square root, it would have to have a matching one smaller than the square root, which the test would already have caught. This keeps the check quick.
A worked example
Enter 7. The tool tries dividing by 2, which leaves a remainder, and that is as far as it needs to go, since testing up to the square root of 7 is enough. Nothing divides it, so the answer is yes, 7 is prime. Enter 12 and it finds that 2 divides it evenly straight away, so the answer is no. Enter 1 and it answers no, by definition.
There is no last prime
However large a number you test, there are always more primes beyond it. This was proved by Euclid over two thousand years ago: the primes never run out, no matter how far you go. They do become sparser among large numbers, appearing less often, but they never stop appearing. So this tool will happily judge primality for numbers of any size you care to enter, and there will always be more primes waiting further along the number line. To see the primes up to a chosen limit all at once, the list of prime numbers calculator does that.
Questions people ask
What makes a number prime?
Having exactly two divisors, 1 and itself. So 7 is prime; 12, divisible by 2, 3, 4, and 6, is not.
Is 1 a prime number?
No. A prime needs exactly two different divisors, and 1 has only one. The tool answers no for 1.
How does the tool decide?
By trial division: it tries dividing by whole numbers up to the square root of your number. If none divide evenly, it is prime.
Why only up to the square root?
Because any factor above the square root pairs with one below it, which the test would already have found. So checking that far is enough.
How do I see many primes at once?
The list of prime numbers calculator lists all the primes up to a limit you choose.
References
On testing primality. A primality test decides whether a number is prime, and Euclid proved there are infinitely many primes.
- Eric W. Weisstein, "Primality Test," from MathWorld, a Wolfram resource, on tests to determine whether a number is prime.
- Eric W. Weisstein, "Euclid's Theorems," from MathWorld, a Wolfram resource, on Euclid's proof that the primes are infinite, Proposition IX.20.
Okan Atalay is a results driven senior operations manager and a graduate of Industrial Engineering from Bilkent University. With over 22 years of experience in textile manufacturing and integrated operations, he has led large scale business process improvements and strategic planning initiatives. Currently, he serves as a top mathematics expert for a global ed tech platform, where he applies his analytical expertise to solve complex mathematical problems. At Eon Tools, he reviews converter and maths tools.
Other Tools
- Absolute Value Calculator
- Average Calculator
- Cube And Cube Root Calculator
- Cube Root Calculator
- Distributive Property Calculator
- Divide Into Two Parts
- Divisibility Test Calculator
- Factor Calculator
- Factorial Calculator
- Find Minimum And Maximum
- First N Digits Of E
- Full Screen Calculator
- Greatest Common Factor Calculator
- Integer Calculator
- Least Common Multiple Calculator
- List Of Prime Numbers
- Long Division Calculator
- Long Multiplication Calculator
- Maths Calculator
- Modulo Calculator
- Multiplication Calculator
- Number Of Digits
- Prime Factor Calculator
- Prime Factorization Calculator
- Prime Number Generator
- Quotient And Remainder Calculator
- Radical Calculator
- Root Calculator
- Root Mean Square Calculator
- Rounding Numbers Calculator
- Scientific Notation Calculator
- Significant Figures Calculator
- Simplifying Radicals Calculator
- Sort Numbers
- Square Root Calculator
- Standard Form Calculator
- Summation (Sum) Calculator
- Weighted Average Calculator