Test Prime Number
Check if a given number is prime using deterministic Miller-Rabin primality testing.
About This Tool
Type a number, hit Test, and find out if it's prime in a flash. Miller-Rabin with BigInt does the heavy lifting, so numbers with hundreds of digits work fine — not just small ones. And everything runs in your browser. Nothing gets uploaded.
FAQ
Is 1 a prime number?
No. By convention, 1 is not considered prime. The smallest prime is 2.
Is 2 a prime number?
Yes. 2 is the only even prime number.
How accurate is this test?
For numbers under 3.3×10²⁴, the test is deterministic (100% accurate). For larger numbers, it uses multiple Miller-Rabin witnesses providing extremely high confidence.
How large can the number be?
The tool uses BigInt, so it can handle numbers with hundreds of digits. Very large numbers may take a moment to test.
What if my number is composite?
The tool will report it as composite and show its smallest prime factor.