Prime Number Checker

Share:
Mathematics

Prime Number Checker

Is it prime? Plus full factorisation

By Checked against sources by Last reviewed FACTORIZATION MATHEMATICS NUMBER THEORY PRIME NUMBERS
Your browser is too old for this tool’s interactive features. Please update to Safari 13.1, Chrome or Edge 80, Firefox 74 or newer.

Prime Number Checker and Factoriser

📅 Research current as of 27 Sep 2026 · Sources: Euclid, Elements IX.20 (ed. D. E. Joyce); trial division by 2, 3 and 6k ± 1
Standards, published formulas, and reference data are revised over time — check against a current authoritative source before relying on these figures.
Advertisement
After tool · AD-W1Responsive · Post-tool

How to Use the Prime Checker

Enter a number

Type any whole number up to 10¹⁵ (1,000,000,000,000,000). Commas or spaces between groups of three digits are fine.

See if it is prime

The checker tells you as you type whether the number is prime (divisible only by 1 and itself) or composite.

Get the factorisation

If the number is composite, you get its full prime factorisation — the unique set of primes that multiply to make it, with exponents.

Understand the result

A short note explains the verdict — how many divisors the number has, or how far the primality check looked. Need the GCD or LCM next? That tool is one click away.

Advertisement
After how-to · AD-W2Responsive

Primes and Factorisation

The Atoms of Arithmetic

A prime number is a whole number greater than 1 whose only divisors are 1 and itself — 2, 3, 5, 7, 11, 13, and so on. Every other whole number bigger than 1 is "composite", meaning it can be broken down into a product of primes. This is not just a definition; it is one of the deepest facts in mathematics, the Fundamental Theorem of Arithmetic: every whole number has exactly one prime factorisation, up to the order of the factors. Primes are, in that sense, the atoms of arithmetic — the indivisible building blocks from which every other number is assembled. 1001, for instance, looks unremarkable but factors cleanly into 7 × 11 × 13, three consecutive primes. This tool answers the two questions people actually ask: is my number prime, and if not, what are its prime factors? It checks primality by trial division: it tries 2, 3 and then every number of the form 6k ± 1 (5, 7, 11, 13, …), and only up to the square root of the number — because if a number has a factor larger than its square root, it must also have one smaller, so there is no need to look further. For a fifteen-digit number that is about ten million divisions rather than a quadrillion.

Prime factorisation is the engine behind a surprising amount of everyday maths. It is how fractions are simplified (you cancel the common prime factors), how the GCD and LCM are computed, and how you reason about divisibility. It is also the foundation of modern cryptography: the security of RSA encryption rests on the fact that multiplying two large primes is easy, but factoring their product back into those primes is, for big enough numbers, practically impossible with ordinary computers — a beautiful asymmetry that protects much of the internet. The numbers this tool factors are far smaller than cryptographic primes, but the same idea is at work, and seeing a number resolve into its prime parts builds the intuition that makes the cryptographic version make sense.

"Primes are the atoms of number. Every whole number is built from them in exactly one way — and that uniqueness is what makes factorisation so powerful."

From Curiosity to Cryptography

People reach for a prime checker for all sorts of reasons. Students meet primes and factorisation early and search constantly to check homework or settle "is 1,001 prime?" arguments. Programmers and number-theory hobbyists use it while exploring problems — hashing, modular arithmetic, project-Euler-style puzzles. And the simply curious like to test birthdays, years, and oddly satisfying numbers. Whatever the reason, the value is the same: a correct answer, plus the factorisation that explains it, with no fuss and no sign-up. Because the check runs in your browser, numbers up to a trillion come back as you type. It is a small window onto one of the richest and most consequential ideas in all of mathematics.

1,001 is 7 × 11 × 13, and you only test up to the square root

01

A prime is a whole number above 1 divisible only by 1 and itself.

02

2 is the only even prime — every other even number is divisible by 2.

03

Every whole number above 1 has exactly one prime factorisation.

04

To test primality you only need to check divisors up to the square root.

05

1,001 = 7 × 11 × 13 — three consecutive primes.

06

There are infinitely many primes — proved by Euclid around 300 BC.

07

The number 1 is neither prime nor composite — it is a "unit".

08

The security of RSA encryption rests on how hard factoring large numbers is.

09

The largest known prime has over 41 million digits (a Mersenne prime).

10

Primes are the building blocks behind GCD, LCM, and fraction simplification.

Frequently Asked Questions

  • A number is prime if its only divisors are 1 and itself. This tool checks that for you by trying 2, 3 and then every number of the form 6k ± 1 (5, 7, 11, 13, 17, 19, …) up to the number's square root. That list holds every prime in the range, plus a few composites such as 25 and 35, which cost a little time but cannot change the answer. If none divides the number, it is prime. If one does, the number is composite and you get its full factorisation.
  • No. By definition a prime is a whole number greater than 1, so 1 is neither prime nor composite — it is called a "unit". The tool flags this explicitly if you enter 1 (or 0), rather than giving a misleading yes/no.
  • It is breaking a composite number into the unique product of primes that makes it — for example 360 = 2³ × 3² × 5. Every whole number above 1 has exactly one such factorisation. The tool shows it in exponent form and, where useful, fully expanded.
  • Because divisors come in pairs that multiply to the number: if a number has a factor larger than its square root, the matching factor must be smaller than the square root. So if nothing up to the square root divides it, nothing above will either. For a fifteen-digit number that cuts the work from up to a quadrillion divisions to about ten million.
  • Whole numbers up to 10¹⁵ (1,000,000,000,000,000), which covers everything from classroom numbers to large curiosities. Up to about a trillion the answer comes back in a few hundredths of a second. Near the top of the range the hardest inputs, a prime or a product of two primes of similar size, took up to about half a second on the desktop computer we measured (a Mac mini with an Apple M4 chip), and can take longer on a slower phone.
  • Yes. Every even number is divisible by 2, so any even number bigger than 2 has 2 as a factor and cannot be prime. That makes 2 the unique even prime — every other prime is odd.
  • Primes underpin simplifying fractions, computing GCD and LCM, and reasoning about divisibility. On a larger scale, the difficulty of factoring the product of two big primes is the basis of RSA encryption, which secures much of the internet. The same idea, scaled down, is what you see here.
  • Primality is defined for positive integers, so the tool considers the absolute value when factorising. Conventionally, primes are positive; negatives are handled by factoring their magnitude.
  • The check runs in your browser. What you enter is processed in your browser and is not sent to our servers, unless you share or open a link that carries it.
  • Completely free, with no account, sign-up, or limit. Use it as often as you like.

Method & sources

How it computes

Trial division by 2 and 3, then by 6k ± 1 up to √n, reporting the full prime factorisation in exponent form. Inputs are whole numbers up to about fifteen digits; 0 and 1 are reported as neither prime nor composite.

What this tool implements

  • Euclid, Elements IX.20: prime numbers are more than any assigned multitude — the infinitude of primes.
  • A divisor above √n pairs with one below it, so testing to √n is sufficient. Worked: 1,001 = 7 × 11 × 13 and 360 = 2³ × 3² × 5.
  • The largest known prime is 2^136,279,841 − 1, with 41,024,320 digits (GIMPS, 12 October 2024).

Sources

Advertisement
Pre-footer · AD-W3 728 × 90