BroHelp.me

Prime Number Checker

Enter a number and the Prime Number Checker (a.k.a prime Number Calculator) will check if it is a prime number or not.




0 - Not Prime Number
*Prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.

How This Converter Works

Checks whether an entered decimal integer of at most 20 digits is prime. Surrounding whitespace is trimmed, blank input clears the result, and non-decimal or overlong input displays Invalid input. Values below 2 are not prime.

Formula or rule

For n <= 2^53 - 1, test 2, 3, then divisors 6k - 1 and 6k + 1 through floor(sqrt(n)); for larger inputs, use BigInt divisibility checks and Miller-Rabin with the first 12 prime bases.

Example

Input
29
Calculation
29 is greater than 1; neither 2 nor 3 divides it, and no 6k +/- 1 divisor through floor(sqrt(29)) = 5 divides it.
Result
29 - Prime Number

Notes

The input field accepts up to 20 characters. BigInt avoids precision loss above JavaScript’s safe-integer limit, and the selected Miller-Rabin bases give exact results throughout this 20-digit input range.

© BroHelp.me 2026 - 2026 is provided without warranty of any kind.