ToolJutsu
All tools
Calculator Tools

Prime Number Checker

Check whether a number is prime.

A prime number has exactly two divisors: 1 and itself. The check uses trial division up to the square root of the number.

Verdict

360 is a composite number

Prime factorisation

360 = × × 5

PrimeExponent
23
32
51

Total number of divisors

24

Processed on your device. We never see your files.

How to use Prime Number Checker

What this calculator does

This tool tells you whether a positive whole number is prime. Type a number and it instantly reports the verdict. If the number is prime, it says so. If the number is composite, it shows the prime factorisation — the unique set of prime building blocks, written with exponents, such as 360 = 2³ × 3² × 5 — together with the total count of divisors. The number 1 is reported as the special case that is neither prime nor composite. Every result can be copied with one click, and the answer updates live as you type.

Why you might need it

Primality and factorisation sit at the heart of number theory and a great deal of practical computing. Students checking homework need a quick, reliable verdict. Programmers writing or testing algorithms — from hash table sizing to cryptographic key generation — frequently need to confirm whether a candidate is prime. Teachers use factorisation to explain the fundamental theorem of arithmetic. Anyone simplifying fractions or finding a lowest common denominator benefits from seeing a number’s prime parts laid out. Doing trial division by hand is slow and error-prone for anything beyond small numbers, so an instant checker removes the drudgery.

How to use it

  1. Type or paste a positive whole number into the input field. Commas in the input are ignored.
  2. Read the verdict card: it states plainly whether the number is prime, composite, or — for 1 — neither.
  3. If the number is composite, study the prime factorisation and the accompanying table of primes and exponents.
  4. Check the divisor count to see how many positive whole numbers divide it evenly, and use the copy button to save the result.

How it’s calculated

The checker uses trial division, the most direct primality test. To decide whether a number n is prime, it tries to divide n by successive candidates. The key efficiency trick is that it only needs to test divisors up to the square root of n: if n had a factor larger than √n, the matching co-factor would be smaller than √n and would already have been found. After 2, only odd divisors are tested, which halves the work. If no divisor is found, n is prime. If a divisor is found, the tool extracts it fully, recording how many times it divides in as the exponent, then continues with what remains — this produces the complete prime factorisation. The total number of divisors follows a neat rule: if n = p₁^a × p₂^b × …, the divisor count is (a + 1) × (b + 1) × …, because each prime can appear from zero up to its full exponent in any divisor.

Common pitfalls

A frequent mistake is assuming 1 is prime — it is not, because it has only one divisor. Another is confusing the divisor count with the number of prime factors: 360 has just three distinct primes but 24 divisors in total. Remember also that 2 is the only even prime; every other even number is divisible by 2 and therefore composite. Finally, the input is capped at the largest safe integer, so extremely large numbers should be checked with specialised arbitrary-precision software instead.

Tips

The factorisation is the fast route to a greatest common divisor or lowest common multiple — line up the prime powers of two numbers and compare exponents. When simplifying a fraction, factorise the numerator and denominator and cancel the shared primes. Because the whole computation runs locally and quickly, you can test many candidates in a row, and nothing you enter ever leaves your browser.

Frequently asked questions

What exactly makes a number prime?
A prime number is a whole number greater than 1 that has exactly two distinct divisors: 1 and itself. 7 is prime because nothing between 2 and 6 divides it evenly. 12 is not prime because 2, 3, 4 and 6 all divide it. A number greater than 1 that is not prime is called composite.
Is 1 a prime number?
No. By the modern definition a prime must have exactly two distinct divisors, and 1 has only one divisor — itself. 1 is therefore classed as neither prime nor composite. This convention keeps the fundamental theorem of arithmetic, that every integer has a unique prime factorisation, clean and unambiguous.
How does the prime factorisation work?
When a number is composite the tool breaks it down into prime building blocks, written with exponents — for example 360 = 2³ × 3² × 5. Every whole number above 1 has exactly one such factorisation, and from it the tool also derives the total count of divisors.
Why is there an upper limit on the input?
The checker accepts numbers up to 9,007,199,254,740,991, JavaScript's largest safely representable integer. Above that, ordinary numbers lose precision and a factorisation could be wrong, so the tool shows a message instead of risking an inaccurate answer.
Does my input get uploaded anywhere?
No. The primality test and factorisation run entirely in your browser using JavaScript. Nothing you enter is sent to a server, logged, or stored — the tool even works offline once loaded.

Related tools