ManyTools

Prime Number Calculator

Check whether a number is prime, factor it, and find the next and previous primes.

Last updated: August 7, 2026How this is calculated →

A prime number is a whole number greater than 1 whose only divisors are 1 and itself — 2, 3, 5, 7, 11, and so on. 97 is prime; 561 is not (it's 3 × 11 × 17). This calculator tells you whether a number is prime, breaks it into its prime factors, and finds the next and previous primes. Enter any whole number to check it.

Results are estimates provided for general information.

Any whole number up to 9,007,199,254,740,991 (2⁵³ − 1).

360Not prime

Prime factorization

360 = 23 × 32 × 5

Next prime367
Previous prime359

Embed this calculator on your site →

About the Prime Number Calculator

Prime numbers are the building blocks of arithmetic: every whole number greater than 1 is either prime itself or a unique product of primes. This calculator answers the three questions people usually have about a number. First, is it prime? A prime has exactly two divisors, 1 and itself, so 2, 3, 5, 7, and 11 are prime while 4, 6, 8, and 9 are not; 1 is not considered prime. The tool tests divisibility efficiently rather than by brute force, so the answer is instant. Second, what are its prime factors? Any non-prime (composite) number breaks down into a product of primes in exactly one way — this is the fundamental theorem of arithmetic — and the calculator lists that factorization, so 360 comes back as 2 × 2 × 2 × 3 × 3 × 5. Factorization is what makes primes useful well beyond the classroom, since it underlies the public-key cryptography that secures the internet. Third, what are the nearest primes? The calculator finds the next prime above your number and the previous prime below it, which is handy for exploring how primes thin out as numbers grow. Enter any whole number to see all three at once.

Frequently asked questions

What is a prime number?+

A prime number is a whole number greater than 1 that has exactly two divisors: 1 and itself. The first primes are 2, 3, 5, 7, 11, and 13. Numbers with more divisors, like 6 (1, 2, 3, 6), are called composite. By convention 1 is not prime.

Is 1 a prime number?+

No. A prime must have exactly two distinct divisors, and 1 has only one (itself). Excluding 1 also keeps prime factorization unique, which is why mathematicians define it this way. The smallest prime is 2 — the only even prime.

What is prime factorization?+

Prime factorization breaks a number into the primes that multiply to make it, and every number has exactly one such breakdown. For 360 it's 2 × 2 × 2 × 3 × 3 × 5. This calculator computes it for any whole number you enter.

How do you know if a large number is prime?+

You check whether it has any divisor other than 1 and itself. You only need to test divisors up to its square root, which makes the check fast. This calculator does exactly that and returns the answer immediately.

What are prime numbers used for?+

Beyond math class, primes are the foundation of modern cryptography. Public-key systems like RSA rely on the fact that multiplying two large primes is easy but factoring the result back apart is extremely hard, which is what keeps encrypted data secure.

Embed this calculator

Free to use on your own site. Paste this snippet where you want the prime number calculator to appear — it resizes itself automatically.

Embed code
<iframe
  src="https://manytools.co/embed/prime-number-calculator"
  title="Prime Number Calculator by ManyTools"
  data-manytools="prime-number-calculator"
  width="100%"
  height="640"
  loading="lazy"
  style="border:0;width:100%;max-width:720px"></iframe>
<script>
(function () {
  window.addEventListener("message", function (e) {
    if (e.origin !== "https://manytools.co") return;
    var d = e.data || {};
    if (d.type !== "manytools:embed:height" || d.slug !== "prime-number-calculator") return;
    var f = document.querySelector('iframe[data-manytools="prime-number-calculator"]');
    if (f && d.height) f.style.height = d.height + "px";
  });
})();
</script>
Plain link (fallback)
<a href="https://manytools.co/dev/prime-number-calculator">Prime Number Calculator by ManyTools</a>