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 = 2³ × 3² × 5
| Prime | Exponent |
|---|---|
| 2 | 3 |
| 3 | 2 |
| 5 | 1 |
Total number of divisors
24
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
- Type or paste a positive whole number into the input field. Commas in the input are ignored.
- Read the verdict card: it states plainly whether the number is prime, composite, or — for 1 — neither.
- If the number is composite, study the prime factorisation and the accompanying table of primes and exponents.
- 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?
Is 1 a prime number?
How does the prime factorisation work?
Why is there an upper limit on the input?
Does my input get uploaded anywhere?
Related tools
Prime Number Generator
Generate primes with the Sieve of Eratosthenes.
Factorial Calculator
Calculate factorials, even for very large numbers.
GCD & LCM Calculator
Find the GCD and LCM of multiple numbers.
Fibonacci Generator
Generate the Fibonacci sequence up to any term.
Roman Numeral Converter
Convert between numbers and Roman numerals.
Permutation & Combination Calculator
Calculate permutations (nPr) and combinations (nCr).