Prime Number Calculator

QuickCalculators checks whether a whole number is prime, reports composite status when factors exist, and can list primes inside a chosen range. Enter a single integer to test, or set bounds to see every prime between them, with trial-division steps shown for the single-number path.

01 calculator

Result

    Worked solution

    QuickCalculators checks whether a whole number is prime, reports composite status when factors exist, and can list primes inside a chosen range. Enter a single integer to test, or set bounds to see every prime between them, with trial-division steps shown for the single-number path.

    Check whether a number is prime

    Concept diagram: Inputs leads to whether a number is prime leads to ResultInputswhether a number isprimeResult
    Check whether a number is prime.

    A prime check asks whether a whole number greater than 1 has any positive divisors other than 1 and itself. If no such divisor exists, the number is prime; if a proper factor appears, the number is composite. QuickCalculators returns that classification for integers in the supported range and explains the first factor found when the number fails the test.

    The integers 0 and 1 are neither prime nor composite under the standard definition used here. Negative inputs are rejected for primality labeling because prime status is defined for positive integers greater than 1. The tool states those edge cases plainly instead of forcing a true or false label.

    Understand what makes a number prime

    Concept diagram: Inputs leads to what makes a number prime leads to ResultInputswhat makes a numberprimeResult
    Understand what makes a number prime.

    A prime number has exactly two distinct positive divisors: 1 and the number itself. That definition excludes 1, which has only one positive divisor, and excludes every composite with a factor pair other than 1 and n. QuickCalculators leans on that two-divisor rule when it labels a result prime.

    Small primes include 2, 3, 5, 7, 11, 13, 17, and 19. The even prime 2 is the only even prime because every larger even integer is divisible by 2. Knowing that fact speeds mental checks before the full trial-division routine runs.

    Test primality by trial division

    Concept diagram: Inputs leads to Test primality by trial division leads to ResultInputsTest primality by trialdivisionResult
    Test primality by trial division.

    Trial division tests candidate divisors from 2 up through the square root of n. If no divisor appears in that range, n is prime, because any factor larger than the square root would pair with a factor smaller than the square root. QuickCalculators uses that bound so the search stops early instead of checking every integer up to n itself.

    For n equal to 17, the square root is a little more than 4, so checking 2, 3, and 4 is enough. None divides 17, so 17 is prime. For a composite such as 51, finding 3 as a divisor ends the test immediately and reports 51 as composite with factor 3.

    List the prime numbers in a range

    Concept diagram: Inputs leads to List prime numbers in a range leads to ResultInputsList prime numbers in arangeResult
    List the prime numbers in a range.

    Listing primes in a range returns every prime between inclusive or exclusive bounds according to the mode selected. Small ranges can use repeated trial division; wider ranges may use a sieve pattern that marks composites in bulk. QuickCalculators presents the list in ascending order so sequence and count are easy to verify.

    The primes from 1 through 20 are 2, 3, 5, 7, 11, 13, 17, and 19. That eight-number list is a common homework check and matches the engine fixture for the interval. Numbers such as 1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, and 20 are excluded as non-prime.

    Check whether 17 is prime

    Concept diagram: Inputs leads to whether 17 is prime leads to ResultInputswhether 17 is primeResult
    Check whether 17 is prime.

    The worked primality case tests 17 on QuickCalculators with a short trial-division pass. Divisors to consider run through the floor of the square root of 17, which is 4. Checking 2, 3, and 4 shows no exact division, so 17 is prime and joins the early prime list.

    1. Note that 17 is greater than 1, so a prime label is possible.
    2. Trial-divide by 2, 3, and 4; none divides 17 evenly.
    3. Conclude that 17 is prime.

    That prime result for 17 is the reference single-number fixture for this page.

    Avoid this common mistake

    Concept diagram: Inputs leads to Avoid this common mistake leads to ResultInputsAvoid this commonmistakeResult
    Avoid this common mistake.

    The misconception named "1 is the first prime number" conflicts with the two-divisor definition. The integer 1 has only one positive divisor, so it is not prime. Starting prime lists at 2 keeps factorizations, sieves, and homework keys aligned. Treat 1 as a special unit, not as a prime.

    Frequently asked questions

    What is a prime number?

    A prime number is a whole number greater than 1 whose only positive divisors are 1 and itself. Examples include 2, 3, 5, 7, and 17. QuickCalculators applies that definition when classifying an entered integer.

    How do you check whether a number is prime?

    Checking whether a number is prime means testing for a divisor from 2 through the square root of the number. If none appears, the number is prime; if one appears, it is composite. The work panel lists the trial steps for the single-number mode.

    Is 17 a prime number?

    Seventeen is a prime number because it has no positive divisors other than 1 and 17. Trial division through 4 finds no factor. Entering 17 on this page returns the same prime classification.

    What are the prime numbers from 1 to 20?

    The prime numbers from 1 to 20 are 2, 3, 5, 7, 11, 13, 17, and 19. Every other integer in that span is composite or, for 1, neither prime nor composite. Range mode lists those eight values in order.

    Is 1 a prime number?

    One is not a prime number under the standard definition that requires exactly two distinct positive divisors. Lists and factorization theorems start primes at 2. The calculator labels 1 as neither prime nor composite.

    What is a composite number?

    A composite number is a whole number greater than 1 that has a positive divisor other than 1 and itself. Examples include 4, 9, 15, and 51. Composite results on this page name at least one proper factor when found.

    Why stop trial division at the square root?

    Trial division stops at the square root because any factor larger than that root would pair with a smaller factor already checked. Searching past the root repeats work without finding new factor pairs. The calculator uses that bound for efficiency and for matching textbook method.

    Summary

    QuickCalculators classifies integers as prime or composite and can list primes inside a range. Primality uses trial division through the square root, so 17 is prime and numbers such as 51 show a factor early. The primes from 1 to 20 are 2, 3, 5, 7, 11, 13, 17, and 19.

    Remember that 1 is not prime, and that 2 is the only even prime.