Current for 2026As of: July 2026

Prime Number Calculator check prime numbers.

Is the number prime? Find the next prime number and calculate the prime factorization

FreeNo sign-upGDPR-compliant

Prime Number Calculator

Check whether a number is prime, calculate its prime factorization and find the next prime number

Prime number

17

Next prime number19
Prime factors17

Prime numbers – basics and significance

The atoms of the natural numbers and their applications

Prime numbers are natural numbers greater than 1 that are only divisible by 1 and themselves. They are considered the "atoms" of arithmetic: the fundamental theorem of arithmetic states that every natural number greater than 1 can be represented uniquely as a product of prime numbers. This property makes prime numbers the foundation of modern number theory and cryptography.

The most efficient primality test for medium-sized numbers is trial division: you check all divisors from 2 up to the square root of the number being tested. If none of them is a divisor, the number is prime. For n = 17: √17 ≈ 4.1, so test 2, 3, 4 – none divides 17 → 17 is prime. For large numbers (above 10⁷), probabilistic tests such as Miller-Rabin are used, which are considerably faster.

The prime factorization writes every composite number as a product of its prime factors. For 12: 12 = 2 × 2 × 3. This decomposition is the basis for calculating the GCD and LCM. The RSA encryption algorithm, which secures the internet, relies on the fact that factoring large numbers (hundreds of digits) into their prime factors is practically impossible – even for modern supercomputers.

Well-known sequences of prime numbers: the set of prime numbers below 100 comprises 25 numbers: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97. The Mersenne primes(numbers of the form 2ⁿ − 1, e.g. 31 = 2⁵ − 1) are relevant to the search for especially large prime numbers. The largest currently known prime number has over 40 million decimal digits and is a Mersenne prime.

Calculation examples

Is 17 a prime number?

Is 17 a prime number?
ItemAmount
To check17
√17 ≈ 4.1 → test 2, 3, 4no divisor
Result17 is prime

Prime factorization of 18

Prime factorization of 18
ItemAmount
18 ÷ 2 = 9Factor: 2
9 ÷ 3 = 3Factor: 3
3 ÷ 3 = 1Factor: 3
18 = 2 × 3 × 32 × 3²

Frequently asked questions about the prime number calculator

Prime numbers, prime factorization and mathematical background

A prime number is a natural number greater than 1 that is only divisible by 1 and itself. The smallest prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, … The number 2 is the only even prime number. All even numbers from 4 upward are not prime, since they are divisible by 2. Prime numbers are the "atoms" of the natural numbers: every number can be represented as a product of prime numbers.

To check whether n is a prime number, you test all divisors from 2 up to √n. If none of these divisors divides n without a remainder, n is a prime number. The limit √n is sufficient because a divisor larger than √n would always have a corresponding divisor smaller than √n. For n=17: √17 ≈ 4.1. Test 2, 3, 4: none divides 17 without a remainder → 17 is prime.

The prime factorization (or prime decomposition) of a number n writes n as a product of prime numbers. By the fundamental theorem of arithmetic, there is exactly one such decomposition (up to order) for every natural number > 1. Example: 12 = 2 × 2 × 3 = 2² × 3. Prime factorization is the basis of the GCD and LCM as well as of modern encryption methods such as RSA.

Yes! Euclid already proved around 300 BC that there are infinitely many prime numbers: suppose there were only finitely many p₁, p₂, …, pₙ. Then N = p₁ × p₂ × … × pₙ + 1 would not be divisible by any of the known prime numbers. N itself would therefore have to either be prime or have a new prime factor – a contradiction. So there are always further, still unknown prime numbers.

The Goldbach conjecture (1742) states that every even number > 2 can be represented as the sum of two prime numbers. For example: 4 = 2+2, 6 = 3+3, 8 = 3+5, 100 = 3+97. It holds for every number checked so far, into the trillions, but to this day it has not been proven and remains one of the most famous unsolved problems in mathematics. Prime numbers still hold many secrets.

For business

Calculators for your website or app

Integrate our GDPR-compliant calculators as a widget or use our API. Perfect for HR portals, career pages and financial applications.

  • 100% GDPR-compliant - no cookies, no data storage
  • White-label - your branding, your colors
  • REST API for your own applications
  • Built by HEADON.pro - your digital agency
Learn more about HEADON.pro →

Request without obligation

Receive an individual quote from HEADON.pro

Your data will only be used to get in touch with you.
Privacy