Prime Number Calculator
A prime number has exactly two divisors: 1 and itself. Enter any whole number up to 100,000,000,000 and this calculator tests it by trial division, then shows its prime factorisation both in exponent form (360 = 2³ × 3² × 5) and written out in full, every divisor it has, and the nearest prime on either side.
- Accurate
- Real-time
- Easy to use
- 100% free
Is it prime?
No — 360 is composite
Written out in full
2 × 2 × 2 × 3 × 3 × 5
Details
Updates as you typeAny whole number from 0 up to 100,000,000,000. The slider covers the small end — type directly for anything larger.
Summary
Is it prime?
No — 360 is composite
- Prime factorisation
- 2³ × 3² × 5
- Written out in full
- 2 × 2 × 2 × 3 × 3 × 5
- Distinct prime factors
- 3 (6 counting repeats)
- Number of divisors
- 24
- Divisors
- 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360
- Previous prime
- 359
- Next prime
- 367
- 360 is divisible by 2, which is enough to rule it out — a prime has no divisor strictly between 1 and itself.
How this is calculated
- Number tested
- 360
- Divisors only need testing up to √n
- √360 ≈ 18.97
- Step 1
- 360 ÷ 2 = 180
- Step 2
- 180 ÷ 2 = 90
- Step 3
- 90 ÷ 2 = 45
- Step 4
- 45 ÷ 3 = 15
- Step 5
- 15 ÷ 3 = 5
- Step 6
- 5 ÷ 5 = 1
- Nothing left to divide
- The quotient reaches 1, so the factorisation is complete.
- Multiply the factors back
- 2 × 2 × 2 × 3 × 3 × 5 = 360
Compare scenarios
See how one change moves the result
- CurrentYour inputs as they standNo — 360 is compositeCurrent
- Number to test450No — 450 is composite
Frequently asked questions
How does this calculator test whether a number is prime?
By trial division. It divides the number by 2, 3, 5 and then by every candidate on a 2·3·5 wheel up to the square root of the number. Testing beyond the square root is pointless: if n = a × b and both a and b were larger than √n, their product would exceed n. This is an exact test with no probabilistic shortcuts, so numbers that fool quick pseudoprimality checks — Carmichael numbers such as 561 = 3 × 11 × 17 — are correctly reported as composite.
Is 1 a prime number?
No. A prime has exactly two distinct divisors, and 1 has only one, so it is neither prime nor composite. It also has no prime factorisation at all, which is why this calculator says so in words rather than showing a blank result. The exclusion is not an accident of definition: if 1 were prime, 12 could be written as 2 × 2 × 3, or 1 × 2 × 2 × 3, or 1 × 1 × 2 × 2 × 3, and the fundamental theorem of arithmetic would lose its uniqueness.
Is 2 a prime number, and are there any other even primes?
2 is prime, and it is the only even prime. Any other even number has 2 as a divisor in addition to 1 and itself, giving it at least three divisors, so it is composite by definition. That makes 2 and 3 the only pair of consecutive primes.
Are 0 and negative numbers prime?
Neither. 0 is divisible by every whole number, so it has no finite divisor list and no prime factorisation — it is neither prime nor composite. Primality is conventionally defined only for integers of 2 and above, so a negative input is rejected here rather than answered, with a message explaining why.
Why does the input stop at 100,000,000,000?
Because the calculator runs in your browser on every keystroke and the answer has to arrive before the next one. Trial division costs roughly √n divisions, and the slowest case is a large prime, where the loop cannot exit early and the nearest-prime search on either side repeats the same full-length work. At 100 billion that whole workload was measured at about 13 ms on average and 19 ms at worst; at a trillion it rose to 40–70 ms, which is visible lag. The cap is where the measurement put it, not a round number.
What is the difference between the exponent form and the expanded form?
They say the same thing at different lengths. The exponent form gathers repeated factors together — 360 = 2³ × 3² × 5 — which is the compact notation used in textbooks and the one you want when reducing fractions or finding a lowest common multiple. The expanded form lists every factor separately, 360 = 2 × 2 × 2 × 3 × 3 × 5, which is easier to check by multiplying straight through.