Calculator
What the Prime Number Checker does
Prime Number Checker: checks Result and Number from Number. Example: number 97 gives result Prime.
The inputs are Number; the output is Result and Number. Change any input and the output follows immediately.
Seeing the intermediate steps is usually more useful than the final number alone. That is usually what brings anyone verifying a hand calculation here.
The work is done by JavaScript already loaded in your browser, so your input never crosses the network.
The field reference, the method and a worked example using the default inputs follow the tool itself.
What do the Prime Number Checker fields mean?
The Prime Number Checker uses 1 input. Because the form arrives filled, the first useful result costs you zero typing.
| Field | What to enter | Default |
|---|---|---|
| Number | accepts 1 or more | 97 |
How does the Prime Number Checker work?
Each output is derived from the inputs above in a single pass; there is no hidden state carried between runs, so the same inputs always give the same check.
Bad input produces an error, never a confident-looking wrong answer.
Worked example
These are the values the Prime Number Checker loads by default, and the result it produces from them. Open the tool above and you will find precisely these figures already in place.
| Number | 97 |
|---|
| Result | Prime |
|---|---|
| Number | 97 |
| What this means | 97 is prime |
Beyond the formula: checking whether a number is prime
A number only needs to be tested for divisibility up to its own square root to determine whether it is prime: if it had a factor larger than its square root, it would necessarily have a matching factor smaller than the square root too, which makes this shortcut mathematically guaranteed, not just a heuristic.
Common mistakes and sanity checks
- 1 is not considered prime by modern mathematical convention (it has exactly one divisor, itself, rather than exactly two): a definitional point that surprises people encountering it for the first time.
- 2 is the only even prime number; every other even number is divisible by 2 and therefore composite: a fast first check before testing anything else.
- This trial-division method is fine for numbers with several digits, but becomes impractically slow for the very large numbers (hundreds of digits) used in real cryptographic systems, which rely on entirely different primality tests.
How to use it
- Key in Number (1 or more).
- There is nothing to click. The answer keeps pace with your edits.
- Read Result, Number and What this means in the results panel.
- Use Copy Link if you want the same setup again later, or Print for a paper copy.
What this tool does not do
- Very large or very small values reach the limits of floating-point precision, about 15 significant digits.
- Displayed values are rounded; the underlying calculation keeps full precision.
- Where a standard has revisions, the version used is the one named in the method section.
Frequently asked questions
You need Number. Each field is pre-filled with a sensible default, so the quickest approach is to replace the one number you actually care about.
Number accepts 1 or more. The range is enforced before the calculation runs, so a bad entry never reaches the formula.
With the values loaded when the page opens, result comes out as Prime. Nudge one field at a time to see which one the answer is most sensitive to.
Nothing leaves your machine. The only network traffic is loading the page itself.
Free for any use, personal or commercial.
The computation is exact; how much you should trust the answer depends on how good your inputs are.