Check whether any whole number is prime, and see its prime factors, divisors, nearby primes and Goldbach pairs, or list every prime in a range.
Initializing in your browser…
Find the GCD and LCM of two or more whole numbers of any size, with the Euclidean algorithm, prime factorisations, Bezout coefficients and common divisors shown.
A scientific calculator with exact fractions and decimals, degrees or radians, 34 functions and a desk-calculator mode. Rounded answers are labelled as rounded.
Plot up to eight functions of x, find their roots, turning points and intersections, shade integrals and draw derivatives. Pan, zoom and share any graph.
A programming puzzle asks for the largest prime factor of 600851475143, and you want to check your answer.
Number
600851475143
Result
NOT PRIME 600,851,475,143 = 71 × 839 × 1471 × 6857 Divisors: 16 Nearby primes: 600,851,475,067 below, 600,851,475,149 above
The number is composite and splits into four different primes, so the largest prime factor is 6857. Because each prime appears once, the number has 2 × 2 × 2 × 2 = 16 divisors. Multiplying the factors back together gives 600851475143 again, which is a quick way to check any factorisation.
Type any whole number to find out at once whether it is prime, then see its prime factorisation, its divisors, the nearest primes on either side and, for even numbers, ways to write it as a sum of two primes. A second panel lists every prime in a range.
A fast, reliable verdict. The tool uses the Miller-Rabin test with the first twelve primes as witnesses. For every number below 3,317,044,064,679,887,385,961,981, which covers all numbers of up to 24 digits, that combination is a proven test, so the answer is certain. Numbers are handled at any length, so 2^127 - 1, a 39-digit prime, is confirmed instantly; above the proven range the page notes that the verdict is a very strong probability rather than a proof. Zero and one are explained rather than forced into a category: neither is prime, and one is excluded so that every number has exactly one factorisation into primes. Decimals such as 17.9 are refused, since only whole numbers can be prime.
Factorisation and divisors. Every composite number is broken into its prime factors, written with powers, so 360 is 2^3 × 3^2 × 5. Small factors are found by trial division and large ones by Pollard's rho method, which works in the background so the page never freezes; a number with no small factors and dozens of digits can take a while, and a Stop button ends the search. From the factorisation come the number of divisors, their sum, the sum of the proper divisors (which tells you whether a number is perfect, abundant or deficient) and Euler's totient. For numbers up to a quadrillion the divisors themselves are listed too, as long as there are no more than 4,000 of them.
The primes around it. The panel beside the factorisation shows the previous and next prime and the gaps to them, and flags twin primes (two apart, like 17 and 19), Sophie Germain primes (where 2n + 1 is also prime), safe primes and Mersenne primes, which are one less than a power of two. For an even number above 2, the tool lists the first few ways to write it as a sum of two primes, the pairs that Goldbach's conjecture says always exist.
Primes in a range. Enter a start and an end up to 200,000 numbers apart and the tool counts the primes in between with a sieve and lists up to 2,000 of them. The range can start anywhere, so the primes between 1,000,000,000 and 1,000,000,100 come back as quickly as those below 100. Thousands separators, written with commas or spaces, are accepted in every box. Everything is computed in your browser.
2147483647 is prime: it is the Mersenne prime 2^31 - 1. The primes either side are 2147483629 and 2147483659.
561 = 3 × 11 × 17 passes the simple Fermat test for every base that shares no factor with it, but it is composite and is correctly reported as not prime.
600851475143 = 71 × 839 × 1471 × 6857, so its largest prime factor is 6857. It has 16 divisors.
Check whether a number is prime, find its factors and divisors, and see how many divisors it has.
Verify answers to factorisation puzzles such as the largest prime factor of 600851475143.
Explore safe primes, Mersenne primes and why large primes are easy to test but large composites are hard to factor.
Show why 561 fools simple tests, why 1 is not prime, and how primes thin out as numbers grow.
With the Miller-Rabin test, using the first twelve primes as witnesses. Below 3,317,044,064,679,887,385,961,981 this combination has been proven never to make a mistake, so the answer is certain. Above that the answer is a very strong probability, and the page says so.
A prime has exactly two divisors, 1 and itself. One has only one divisor, and zero is divisible by every number. Leaving 1 out also keeps the rule that every whole number above 1 has exactly one factorisation into primes.
Testing whether a number is prime is fast, but finding the factors of a large number made of two big primes is hard; that difficulty is what RSA encryption relies on. The search runs in the background and you can stop it at any point.
A composite number, such as 561, 1105 or 1729, that passes the Fermat primality test for every base sharing no factor with it. The Miller-Rabin test used here is not fooled by them.
It counts the numbers from 1 to n that share no factor with n. For a prime p it is p - 1. It is worked out from the prime factorisation and is central to how RSA keys are made.
Up to 200,000 consecutive numbers, anywhere on the number line. The count covers the whole range and the first 2,000 primes are listed.
No. All of the testing and factorising runs in your browser.
Every calculation runs locally in your browser. Your numbers and expressions are not transmitted or stored.