# Prime Number Checker

URL: https://hifreetools.com/calculators/prime-number-checker

> Check instantly whether any whole number from 2 upward is prime or composite, and see its full prime factorization with the smallest prime factor — all computed in your browser by trial division up to the square root.

## Quick answer

A number n ≥ 2 is prime if it has no divisor other than 1 and itself, which you confirm by testing every integer d from 2 up to √n: if none divides n evenly, n is prime. For example, 97 is prime because √97 ≈ 9.85 and none of 2, 3, 5, 7 divides it. A composite number breaks into prime factors, e.g. 84 = 2² × 3 × 7, whose smallest prime factor is 2.

## Formula

- Primality test (trial division): n is prime ⇔ no integer d with 2 ≤ d ≤ √n divides n
- Prime factorization: n = p₁^a₁ × p₂^a₂ × … × p_k^a_k

## Examples

- A prime number (the default): n = 97 → Prime
- A composite with repeated factors: n = 84 → Composite — 84 = 2² × 3 × 7, smallest factor 2
- A perfect square (10²) with two repeated primes: n = 100 → Composite — 100 = 2² × 5², smallest factor 2
- The smallest and only even prime: n = 2 → Prime

## FAQ

**Is 1 a prime number?**
No. A prime number has exactly two distinct positive divisors: 1 and itself. The number 1 has only one divisor, so it is classified as neither prime nor composite. That is why this tool requires the input to be 2 or greater.

**Why is it enough to check divisors only up to the square root?**
If n = a × b and both a and b were larger than √n, their product would exceed n, which is impossible. So at least one factor of any composite number must be ≤ √n. If no divisor up to √n is found, n cannot be composite and is therefore prime.

**What is the difference between a prime and a composite number?**
A prime number (≥ 2) has no positive divisors other than 1 and itself, such as 2, 3, 5, 7, 11. A composite number (≥ 4) has at least one extra divisor and can be written as a product of smaller primes, such as 84 = 2² × 3 × 7.

**What does prime factorization mean?**
Prime factorization expresses a number as a product of prime numbers, written with exponents for repeats — for example 100 = 2² × 5². By the Fundamental Theorem of Arithmetic this representation is unique (apart from ordering) for every integer ≥ 2.

**Is 2 really a prime number?**
Yes. 2 is divisible only by 1 and 2, so it satisfies the definition of a prime. It is special because it is the only even prime; every other even number has 2 as a divisor and is therefore composite.

**What is the smallest prime factor used for?**
The smallest prime factor is the first prime that divides a number. It is useful for breaking a number down step by step, for trial-division factoring algorithms, and for quickly detecting that an even number or a multiple of 3 or 5 (other than 2, 3 and 5 themselves) is composite without full factorization.


## Sources

- [Wikipedia — Prime number](https://en.wikipedia.org/wiki/Prime_number)
- [Wikipedia — Fundamental theorem of arithmetic](https://en.wikipedia.org/wiki/Fundamental_theorem_of_arithmetic)
- [Wolfram MathWorld — Prime Number](https://mathworld.wolfram.com/PrimeNumber.html)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Prime Number Checker", https://hifreetools.com/calculators/prime-number-checker
