The prime number calculator can do the following tasks for you.

- Check whether a number is prime. If you provide a list of numbers, it will tell you which (if any) of those numbers are prime.
- Find the $\hspace{0.2em} n^\text{th} \hspace{0.2em}$prime number.
- Get the list of first $\hspace{0.2em} n \hspace{0.2em}$prime numbers or prime numbers in a certain range.
- Find the prime numbers closest to a number.

It's a great tool if you are interested in or need to work with prime numbers.

## Usage Guide

Show
Hide
#### i. Valid Inputs

When providing input to the first calculator (checking primes), enter a list of upto five positive integers separated by commas.

For the remaining four calculators, each input needs to be a positive integer.

#### ii. Example

If you would like to see an example of the calculator's working, just click the "example" button.

#### iii. Share

We would love to see you share our calculators with your family, friends, or anyone else who might find it useful.

By checking the "include calculation" checkbox, you can share your calculation as well.

Here's a quick overview of what prime numbers are and how to check if a number is prime.

For those interested, we have a more comprehensive tutorial on prime numbers.

## Prime Numbers

A prime number is a natural numbers greater than $\hspace{0.2em} 1 \hspace{0.2em}$ that has only two factors — $\hspace{0.2em} 1 \hspace{0.2em}$ and itself.

Natural numbers that are not prime are known as composite numbers.

$1 \hspace{0.2em}$ is neither prime nor composite.

### Checking Whether a Number Is Prime

Let me explain an efficient way to check whethr a number is prime using the following example.

Example

Check whether $\hspace{0.2em} 85 \hspace{0.2em}$ is a prime number.

Solution

Step 1. Create a list of prime numbers up to the square root of the number you want to test.

Here, our number is $\hspace{0.2em} 85 \hspace{0.2em}$. It's square root would be something between $\hspace{0.2em} 9 \hspace{0.2em}$ and $\hspace{0.2em} 10 \hspace{0.2em}$ ($\hspace{0.2em} 9 \hspace{0.2em}$ point something). We don't need the exact square root, just the whole number part. So $\hspace{0.2em} 9 \hspace{0.2em}$

Now, the prime numbers up to $\hspace{0.2em} 9 \hspace{0.2em}$ are $\hspace{0.2em} 2 \hspace{0.2em}$, $\hspace{0.2em} 3 \hspace{0.2em}$, $\hspace{0.2em} 5 \hspace{0.2em}$, and $\hspace{0.2em} 7 \hspace{0.2em}$.

Step 2. Check if the given number is divisible by any of the prime numbers obtained in step 1. If the number isn't divisible, then it is prime. Otherwise, not.

$\hspace{0.2em} 85 \hspace{0.2em}$ is not divisible by $\hspace{0.2em} 2 \hspace{0.2em}$, $\hspace{0.2em} 3 \hspace{0.2em}$, $\hspace{0.2em} 5 \hspace{0.2em}$, or $\hspace{0.2em} 7 \hspace{0.2em}$. So, $\hspace{0.2em} 85 \hspace{0.2em}$ is a prime number.