360 = 2³ · 3² · 5 Next prime: 367 Previous prime: 359
About Prime Number Checker & Factorization Calculator
A prime number is an integer greater than 1 whose only divisors are 1 and itself. This prime number checker tells you instantly whether a value is prime or composite, and when it isn't prime, it returns the full prime factorization — the unique set of primes (with exponents) that multiply back to your number.
Small numbers are tested by trial division; large ones use a deterministic Miller–Rabin primality test, so even values with dozens of digits are classified correctly and quickly. Every calculation uses JavaScript's BigInt, which means results stay exact — no floating-point rounding, no silently dropped precision.
It all runs locally in your browser. Whatever number you enter never leaves your device, so you can check primality and factor integers completely offline.
Features
- Prime / composite check with a clear badge
- Full prime factorization in p^e form (e.g. 360 = 2³ · 3² · 5)
- Handles very large integers exactly via BigInt and Miller–Rabin
- Shows the next and previous prime; works entirely offline
How to use
- Type or paste an integer into the input field.
- Read the badge — "Prime" or "Composite" — and the result below.
- If composite, copy the prime factorization; for any number, see the next and previous prime.
Frequently asked questions
How do you check if a large number is prime?
Small numbers are tested by trial division against the small primes. Larger numbers use the Miller–Rabin primality test with a fixed set of witnesses that is deterministic for all values up to about 3.3 × 10²⁴, and a strong probable-prime test beyond that. BigInt keeps every step exact.
Is 1 a prime number?
No. By definition a prime is greater than 1 and divisible only by 1 and itself. 1 has a single divisor, so it is neither prime nor composite — and 0 and negative numbers are not prime either.
What is prime factorization?
It is writing a number as a product of primes. By the fundamental theorem of arithmetic this representation is unique up to ordering, e.g. 360 = 2³ · 3² · 5. This tool returns those primes with their exponents in ascending order.
Why does factoring a huge number take a moment?
Primality testing is fast, but factoring large composites is genuinely hard. This tool strips small factors first, then uses Pollard’s rho, which is efficient for most numbers but can take longer on large products of two big primes.
Does my number get sent to a server?
No. All primality testing and factorization happen in your browser using BigInt. Your input never leaves your device, so the tool works offline.
Related tools
Everything runs locally in your browser — your input is never uploaded.