Primorial Calculator

Multiply the first n prime numbers to get the primorial, with the largest prime and factor count shown.

Math and PercentUpdated 2026-11-182 min read
Primorial Calculator
A whole number from 0 to 200 primes.
Primorial p(n)#
...
Largest prime used...
Number of prime factors...

What it does

The primorial is the prime counterpart of the factorial. Instead of multiplying every integer up to n, it multiplies the first n prime numbers. The notation uses the prime count followed by a hash sign, as in p of n with a hash mark. The first few values are 1, 2, 6, 30, 210 and 2310.

Primorials appear in the study of prime gaps, in constructions of highly composite numbers, and in the search for long runs of consecutive composite integers. They are also useful when building numbers with many small prime factors.

Because primes thin out slowly, the nth primorial is much larger than n factorial for the same count. At n = 200 the result has several hundred digits, which is why the tool uses exact integer arithmetic throughout.

This page generates the first n primes, multiplies them and reports the product together with the largest prime used and the count of factors. The search for primes is bounded, so the page cannot loop without end.

The input limit is 200 primes. That keeps the printed value long but still readable, and the computation returns immediately in a browser.

How to use

  1. Enter the number of primes n from 0 to 200.
  2. Read the primorial value in the main result box.
  3. Check the largest prime that was multiplied in.
  4. Use the factor count to confirm how many primes were used.
  5. The default n = 5 reproduces the worked example.
  6. Try n = 10 to confirm the value 6,469,693,230.

Formula

p(n)# = product of the first n prime numbers, with p(0)# = 1
n
How many initial primes to multiply.
p_i
The ith prime number.
p(n)#
The primorial, or product of those primes.

The empty product for n = 0 is defined as 1. Each prime appears once, so a primorial is always squarefree. The asymptotic size grows like e raised to roughly n times the natural log of n, which outpaces the factorial function.

Worked example

Example: first five primes

The page opens with n = 5.

  1. List the first five primes: 2, 3, 5, 7 and 11.
  2. Multiply the first two: 2 x 3 = 6.
  3. Multiply by 5 to get 30.
  4. Multiply by 7 to get 210.
  5. Multiply by 11 to get 2,310.
  6. The tool reports 2310, largest prime 11 and factor count 5.
  7. For n = 10 the product reaches 6,469,693,230.

Reference table

Primorial values for small counts
np(n)#Largest prime
01n/a
122
263
3305
5231011
10646969323029

Limits

  • The input counts primes, not integers.
  • Counts above 200 are rejected to keep the printed value short.
  • The tool does not test the primorial for primality; it is always composite for n at least 2.
  • The prime search has a guard so it cannot run indefinitely.

Common mistakes

  • Multiplying every integer up to n instead of the first n primes.
  • Taking p(0)# to be zero rather than one.
  • Repeating a prime when a prime power was intended.
  • Confusing the count n with the largest prime used.
  • Using a floating point product and losing digits.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is the product of the first five primes?

2 x 3 x 5 x 7 x 11 = 2310.

What is p(0)#?

It is 1, the empty product.

What is p(10)#?

It is 6,469,693,230, with largest factor 29.

Questions

How does a primorial differ from a factorial?

A factorial multiplies every integer up to n, while a primorial multiplies the first n primes.

Is a primorial ever prime?

Only p(1)# = 2. For larger counts the result has several prime factors.

Why is p(0)# equal to 1?

By the standard convention for an empty product.

Where are primorials useful?

In prime gap constructions, highly composite numbers and covering systems.

Are the values exact?

Yes. The multiplication uses arbitrary precision integers.

What is the largest count accepted?

Two hundred primes.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.