Pro Calculators and Guides

How to Check If a Number Is Prime and Find Its Prime Factors

Test any whole number up to one trillion, see its prime factorisation and the nearest primes before and after.

Saizul Amin
Saizul Amin15 Oct 2026 · Updated 17 Oct 2026 · 1 min read
How to Check If a Number Is Prime and Find Its Prime Factors

A prime number has exactly two divisors: 1 and itself. Primes are the building blocks of all whole numbers and keep our online payments secure.

Quick answer

Enter a whole number up to one trillion. The tool says whether it is prime, shows its prime factorisation if it is not, and gives the nearest primes before and after.

Examples

  • 29 is prime.
  • 91 is not prime: 7 × 13.
  • 360 = 2³ × 3² × 5.
  • The primes either side of 100 are 97 and 101.

How to test by hand

To check whether n is prime, try dividing by primes up to √n. If none divide evenly, n is prime. For 97, √97 ≈ 9.8, so test 2, 3, 5 and 7; none divide, so 97 is prime.

Shortcuts

  • Even numbers (except 2) are not prime.
  • A number whose digit sum is divisible by 3 is divisible by 3.
  • Numbers ending in 0 or 5 are divisible by 5.

Steps

  1. Enter the number.
  2. Read the result and factors.
  3. Use the neighbouring primes for puzzles or code exercises.

Why primes matter

  • Cryptography (RSA) relies on the difficulty of factoring a product of two large primes.
  • Hash tables and random generators use primes.
  • Maths puzzles and contests love them.

Note that 1 is not a prime number.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages