About this tool
Check whether a number is prime and see its factors if it isn't.
The Prime Number Checker tests whether a whole number is prime by trial division against every integer from 2 up to the square root of the number, and when it is not prime it returns the smallest divisor together with its pair — for example 91 = 7 × 13. It is for students checking homework, anyone verifying a number before using it in a puzzle or exercise, and developers sanity-checking a value by hand. Testing only up to the square root is what keeps it fast: any composite number must have a factor at or below that point.
Open Prime Number Checker on AltFTool — it loads instantly in your browser.
Type the whole number into the Number field of the Inputs card, which opens on 97.
The verdict recomputes as you type: trial division runs from 2 while i × i ≤ n, and anything under 2 comes back as Enter a whole number ≥ 2.
Result reads Prime ✓, or Not prime with the factor pair beneath it such as 91 = 7 × 13; Copy places the inputs and verdict on the clipboard and Reset returns the field to 97.
A composite result comes with the actual factor pair it found, so you can see why it failed instead of being told only that it did.
Trial division runs while i × i ≤ n, which is the smallest range that can still prove primality — checking 9,973 needs fewer than 100 divisions rather than nearly 10,000.
Anything below 2 is rejected outright rather than being labelled prime or composite, since 1 and 0 are neither and negative numbers fall outside the definition.
A whole number greater than 1 whose only positive divisors are 1 and itself. 2 is the smallest prime and the only even one; 1 is not prime, which is why this tool requires an input of at least 2.
It divides the number by every integer from 2 upward and stops as soon as i × i exceeds the number. If nothing divides evenly in that range, the number is prime — a composite n always has a factor no larger than the square root of n, so there is no need to test any further.
No — it reports the first factor pair it finds, which is the smallest divisor and its cofactor. For 60 that is 2 × 30, not 2² × 3 × 5; feed the cofactor back in if you want to keep breaking it down.
Two practical ones. Values are handled as standard JavaScript numbers, so integers above 2^53 − 1 (about 9.007 quadrillion) can lose exactness, and trial division slows down as the square root grows — a 16-digit prime needs on the order of 100 million divisions. For cryptographic-scale numbers you need a probabilistic test such as Miller-Rabin instead.
Add the Prime Number Checker widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/prime-number-checker"
title="Prime Number Checker — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/prime-number-checker?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>