Prime Number Calculator

Check whether a number is prime or composite, its smallest factor, and the primes just before and after it.

Your details

Your data stays in your browser

Result

Enter the number, then press “Check”.

Analysis and suggestions

Once calculated, this shows what your result means and suggestions based on your numbers.

Behind the result

Check whether a number is prime or composite, its smallest factor, and the primes just before and after it.

Example · العدد الأولي عدد أكبر من 1 لا يقسمه إلا 1 ونفسه؛ ويكفي تجربة القسمة على الأعداد الأولية حتى √العدد

√97 ≈ 9

How it is calculated

Comprehensive Calculator Guide

This calculator tells you whether a number is prime or composite, gives its smallest factor if composite, and the previous and next primes. 97 is prime; 91 looks prime but is 7 × 13. It works up to a trillion.

Testing for primes

A prime has exactly two divisors, 1 and itself; 1 is neither prime nor composite. Testing primes up to the square root is enough. Euclid proved the primes never end, and modern encryption relies on them.

How to Use

  1. Enter a whole number.
  2. Nothing else is needed.
  3. Press “Check” to see its type, smallest factor and nearest primes.

Formula Used

Prime if no prime up to √n divides it

Practical Examples

Example 1: 97
Prime; 89 before, 101 after.
Example 2: 91
7 × 13, composite.
Example 3: 1
Neither; the next prime is 2.

Important Tips

  • Rule out even numbers and multiples of 5.
  • Use the digit sum for 3.
  • Test up to the square root.

Common Mistakes to Avoid

  • Calling 1 prime.
  • Assuming odd means prime.
  • Forgetting 2 is prime.

Frequently Asked Questions

Is 1 prime?
No.
Is 91 prime?
No, 7 × 13.
How many primes are below 100?
25.

Read Also

Results are estimates for educational purposes and may vary depending on your situation and data sources.