🔢 Prime Number Tester & Factorization Generator

Prime factors, divisor count and primality — plus the square root in simplest radical form, which no other calculator derives from the factorization.

Free No Signup Required Browser-Based
Prime Verification Result
✓ PRIME NUMBER
Prime Factorization: 97
Square root in simplest radical form
97 = √97
Each prime with an even exponent comes out of the radical; the odd remainder stays inside.

2 divisors of 97

1, 97

What Prime Number Tester & Factorization Generator Does

Every whole number above 1 is either prime or splits into primes in exactly one way. That uniqueness is the Fundamental Theorem of Arithmetic, and it is the reason prime factorization is worth computing at all — the factorization is a fingerprint, not one description among several.

Finding it is conceptually simple. Divide by 2 as often as it goes, then 3, then 5, and so on, keeping a tally. You only need to test up to the square root, because if a number had two factors both above its square root their product would exceed the number itself. Once the running quotient drops to 1, the tally is the answer.

A great deal falls out of that tally for free. Whether the number is prime — it is, exactly when the tally is a single prime to the first power. How many divisors it has — multiply each exponent plus one together, no enumeration needed. And the square root in simplest radical form, which is what half the people searching for a factorization calculator actually want.

The one thing worth being upfront about is scale. Trial division needs roughly the square root of n steps, so it is fast to about 10¹⁴ and hopeless well before the numbers used in cryptography. Every browser calculator also hits a harder wall at 2⁵³, past which the number you typed is not the number being factored.

How to Use Prime Number Tester & Factorization Generator

  1. Enter any positive integer into the input box
  2. Review whether the number is Prime or Composite
  3. Inspect the prime factorization formula and complete list of integer divisors

Formula Used by Prime Number Tester & Factorization Generator

Prime factorization by trial division

Divide by each prime in turn, up to √n, recording how many times each divides evenly

√n
The stopping point — a factor pair cannot have both members above the square root
Remaining quotient
If anything above 1 is left at the end, it is itself prime

Worked example

100

  1. 100 ÷ 2 = 50, record a 2
  2. 50 ÷ 2 = 25, record a 2
  3. 25 is not divisible by 2 or 3; try 5
  4. 25 ÷ 5 = 5, record a 5
  5. 5 ÷ 5 = 1, record a 5

Result: 2 × 2 × 5 × 5, written 2² × 5²

Counting divisors without listing them

number of divisors = (e₁ + 1) × (e₂ + 1) × … for each exponent in the factorization

eᵢ
The exponent of the i-th prime
+1
Each prime can appear 0, 1, 2 … up to eᵢ times in a divisor

Worked example

100 = 2² × 5²

  1. The 2 can appear 0, 1 or 2 times — three choices
  2. Same for the 5 — three choices
  3. 3 × 3

Result: 9 divisors: 1, 2, 4, 5, 10, 20, 25, 50, 100

Simplifying a square root from the factorization

√n: each prime contributes p^⌊e/2⌋ outside the radical and p^(e mod 2) inside

⌊e/2⌋
How many complete pairs of that prime exist — each pair escapes the radical
e mod 2
The leftover, 0 or 1, which stays under the radical

Worked example

√72

  1. 72 = 2³ × 3²
  2. The 3² is a complete pair, so 3 comes out
  3. The 2³ gives one pair (a 2 comes out) with one 2 left over
  4. Outside: 3 × 2 = 6. Inside: 2

Result: 6√2

Worked factorizations

Including the values people most often look up. Divisor counts come from the exponents, not from listing.

NumberPrime factorizationDivisors√ in simplest form
102 × 54√10
202² × 562√5
213 × 74√21
242³ × 382√6
362² × 3²96
482⁴ × 3104√3
502 × 5²65√2
722³ × 3²126√2
762² × 1962√19
9797 (prime)2√97
1002² × 5²910

What the exponents tell you at a glance

The factorization answers several questions at once, which is why it is worth computing even when you only wanted one of them.

QuestionRead from the factorization
Is it prime?Yes exactly when it is one prime to the first power
How many divisors?Multiply (each exponent + 1) together
Is it a perfect square?Yes exactly when every exponent is even
Is it a perfect cube?Yes exactly when every exponent is divisible by 3
Simplest radical formHalve each exponent; the remainders stay inside
Is it a power of two?Yes when 2 is the only prime present

Stated limits across the field

Unusually for this project, most competitors publish their ceilings. Ours had none until now.

ToolStated limitMethod
CalculatorSoupUnder 10 trillion (13 digits)Trial division
Math is Fun2 to 9,007,199,254,740,991Trial division, capped at 2⁵³−1
Number EmpireUp to 80 digitsAdvanced algorithms
AlpertronVery largeElliptic curve method plus SIQS
This tool10¹⁴, and refuses past 2⁵³−1Trial division, with both limits stated

How to Read Your Result

Why 1 is not prime

It looks like it should qualify — its only divisors are 1 and itself. It is excluded by definition to protect the uniqueness of factorization. If 1 were prime, then 12 could be written as 2² × 3, or 1 × 2² × 3, or 1² × 2² × 3, and so on without end. Every number would have infinitely many factorizations and the Fundamental Theorem would say nothing. Excluding 1 is a choice that makes the rest of number theory work.

Why testing stops at the square root

If n has a factor pair a × b, one of them must be at or below √n — if both exceeded it, their product would exceed n. So finding no factor at or below the square root proves there is none at all. This is what makes trial division practical for moderate numbers: checking whether 999,999,937 is prime needs about 31,600 tests rather than a billion.

The 2⁵³ wall, and why it matters here more than elsewhere

JavaScript numbers hold integers exactly only up to 9,007,199,254,740,991. Past that they round to the nearest representable value, which for factorization is uniquely damaging: 9007199254740993 becomes 9007199254740992, and those two numbers have completely different factorizations. A tool that keeps going here does not give an imprecise answer, it gives a confident answer about a different number. Refusing is the only honest option without arbitrary-precision arithmetic.

Where trial division runs out

The cost grows with the square root of n, so each two extra digits roughly multiplies the work by ten. That is fine to about 10¹⁴ and hopeless for the numbers used in RSA, which run to hundreds of digits. Serious factorization uses Pollard's rho for small factors, the elliptic curve method for medium ones, and the quadratic or number field sieve for hard cases. The difficulty of that problem is precisely what public-key cryptography is built on.

Perfect squares and radicals

A number is a perfect square exactly when every exponent in its factorization is even — 36 is 2² × 3², so its root is 2 × 3 = 6 with nothing left over. When some exponent is odd, that prime cannot be fully paired and stays under the radical. This is the whole method for simplifying surds by hand, and it generalizes: for a cube root, take out primes in groups of three instead of pairs.

Limitations & Accuracy Notes

  • Inputs above 9,007,199,254,740,991 are refused rather than approximated, because past that point the value being factored would differ from the value entered.
  • A practical ceiling of 10¹⁴ applies regardless, since trial division needs about √n steps and would otherwise freeze the page.
  • The full divisor list is shown only when it is short and the number is moderate. The divisor count is always exact, since it comes from the exponents rather than from enumeration.
  • Trial division is the wrong algorithm for large numbers. Anything with a large semiprime structure — two big prime factors — needs Pollard's rho, the elliptic curve method or a sieve.
  • Only positive integers are handled. Negative numbers, zero and non-integers have no prime factorization in the ordinary sense.

Frequently Asked Questions

What is a prime number?
A whole number above 1 whose only divisors are 1 and itself — 2, 3, 5, 7, 11, 13 and so on. Note that 1 is deliberately excluded: counting it as prime would break the uniqueness of prime factorization, since you could multiply by 1 any number of times and get a different-looking factorization of the same number.
What is the prime factorization of 24?
2³ × 3. Divide by 2 repeatedly — 24 → 12 → 6 → 3 — which uses three 2s and leaves 3, itself prime. For comparison, 21 is 3 × 7, 100 is 2² × 5², and 48 is 2⁴ × 3. Every whole number above 1 has exactly one such factorization, which is the Fundamental Theorem of Arithmetic.
How do I simplify a square root using prime factorization?
Factorize, then take out every prime that appears an even number of times. √72 factorizes as 2³ × 3², so one 3 and one 2 come outside while a single 2 stays under the radical — giving 6√2. A number is a perfect square exactly when every exponent is even: 100 is 2² × 5², so √100 is exactly 10 with nothing left inside.
How many divisors does a number have?
Add one to each exponent in the prime factorization and multiply. 100 is 2² × 5², so (2+1) × (2+1) = 9 divisors. You never need to list them to count them, and this is also why prime numbers have exactly two — a single prime to the first power gives (1+1) = 2.
Why is there a size limit?
Two reasons. Above 9,007,199,254,740,991 an ordinary JavaScript number cannot store every integer, so the value would change before being factored — 9007199254740993 silently becomes 9007199254740992, a different number with different factors. This tool refuses rather than factoring the wrong value. Separately, trial division needs roughly √n steps, which becomes too slow past about 10¹⁴. Tools like Alpertron and Number Empire use the elliptic curve method and arbitrary precision to go much further.
Is 1 a prime number?
No. A prime has exactly two distinct positive divisors, and 1 has only one. Excluding it is not arbitrary — if 1 were prime, every number would have infinitely many prime factorizations and the fundamental theorem of arithmetic would fail.
Is 2 really prime?
Yes, and it is the only even prime — every other even number is divisible by 2. It is often called the oddest prime for exactly that reason.
How do you test whether a number is prime?
Trial division only needs to go up to the square root, because any factor above it pairs with one below. That makes the check far faster than testing every number up to n, and it is why factorization of large numbers is hard rather than impossible.
Why does prime factorization matter outside maths class?
RSA encryption rests on it. Multiplying two large primes is easy and factoring the product back is computationally infeasible at sufficient size — that asymmetry is what secures a great deal of internet traffic.
How large a number can this handle?
It is bounded by JavaScript's exact integer range and by how long trial division takes. Very large numbers of the kind used in cryptography need specialized algorithms and are far beyond a browser tool.
Is my data stored?
No. The calculation runs in your browser.

References & Further Reading

By OnlineToolHubs Team • September 2026