Geometric Distribution Calculator

StatisticsLast updated: August 22, 2026

The geometric distribution models which trial produces the first success in a sequence of independent trials with success probability p. This calculator uses the common textbook definition: X is the TOTAL NUMBER OF TRIALS carried out until the first success, so the support is 1, 2, 3, … and the successful trial itself is counted. Which roll of a die shows the first six, on which call a sales representative closes a first deal, and on which cycle a machine fails for the first time are all questions of this kind.

The calculator returns the exact probability P(X = k), the cumulative probability P(X ≤ k), the upper tail P(X > k) = (1 − p)^k, the probability of the interval [a, b] you choose, and the mean (1/p), variance ((1 − p)/p²), standard deviation, mode, and median together. The most striking feature of the geometric distribution is memorylessness: how many times you have already failed does not change the probabilities of the trials still to come.

Enter a value between 0 and 1 (0.2 for twenty percent). A decimal comma is also accepted as the separator.
The trial number you want the first success to land on. The smallest value is 1.
Lower bound for P(a ≤ X ≤ b). Left blank, it is taken as 1.
Upper bound for P(a ≤ X ≤ b). Left blank, the upper bound is taken as infinite.

Geometric Distribution Formulas (number-of-trials definition)

Mass function:      P(X = k) = (1 − p)ᵏ⁻¹ · p,  k = 1, 2, 3, …
Cumulative:         P(X ≤ k) = 1 − (1 − p)ᵏ
Upper tail:         P(X > k) = (1 − p)ᵏ
At least k trials:  P(X ≥ k) = (1 − p)ᵏ⁻¹
Interval:           P(a ≤ X ≤ b) = (1 − p)ᵃ⁻¹ − (1 − p)ᵇ
Mean:               μ = 1 / p
Variance:           σ² = (1 − p) / p²
Standard deviation: σ = √(1 − p) / p
Mode:               1  (the highest probability is always on the first trial)
Median:             ⌈ln(0.5) / ln(1 − p)⌉
Memorylessness:     P(X > m + n | X > m) = P(X > n)

Under the alternative definition, X is the number of failures before the first success (support 0, 1, 2, …) and the mean becomes (1 − p)/p. This calculator uses the number-of-trials definition; you move between the two with Y = X − 1, and the variance is (1 − p)/p² under both.

How to Calculate

  1. Enter the success probability of a single trial (p) between 0 and 1; write 0.2 for twenty percent.
  2. Enter the trial number (k) you want the first success to land on; the smallest value is 1.
  3. Set the interval bounds (a and b) if you wish; leaving the upper bound blank computes P(X ≥ a).
  4. Read the exact, cumulative, and upper-tail probabilities: P(X > k) is directly the probability that all of the first k trials fail.
  5. Assess the mean (1/p), the median, and the standard deviation together; because the distribution is right-skewed, the mean alone is not enough.
  6. In the mass chart, see how the probability falls off geometrically as k grows and how the tallest bar is always at k = 1.

Worked Examples

Success probability of 20%: first success on trial 5

With p = 0.2, the probability that the first success arrives exactly on trial 5 is P(X = 5) = 0.0819. The probability of a success within at most 5 trials is 0.6723, and the probability that all of the first 5 trials fail is (0.8)⁵ = 0.3277. On average 5 trials are needed, the standard deviation is 4.4721, the median is 4 trials, and P(3 ≤ X ≤ 8) = 0.4722.

First success exactly on trial 5 — P(X = 5): 0.0819 · At most 5 trials — P(X ≤ 5): 0.6723 · Fewer than 5 trials — P(X < 5): 0.5904

First six on a die: which roll brings it?

On a fair die the probability of rolling a six is p ≈ 0.1667. The probability that the first six appears exactly on the third roll is P(X = 3) = 0.1157. Since the probability of seeing no six in the first six rolls is 0.3349, the probability of at least one six in six rolls is P(1 ≤ X ≤ 6) = 0.6651. The expected number of rolls is 6 and the median is 4 rolls.

First success exactly on trial 3 — P(X = 3): 0.1157 · At most 3 trials — P(X ≤ 3): 0.4213 · Fewer than 3 trials — P(X < 3): 0.3056

High success probability: p = 0.6

With p = 0.6, the probability of succeeding on the first trial is P(X = 1) = 0.6000, which is also the mode of the distribution. The probability of a success within the first three trials is P(1 ≤ X ≤ 3) = 0.9360. The mean is 1.6667 trials, the standard deviation is 1.0541, and the median is 1 trial.

First success exactly on trial 1 — P(X = 1): 0.6000 · At most 1 trials — P(X ≤ 1): 0.6000 · Fewer than 1 trials — P(X < 1): 0

Frequently Asked Questions

Does the support of the geometric distribution start at 0 or at 1?
Both definitions are in use and must not be confused. This calculator uses the 'total number of trials up to the first success' definition; the support is 1, 2, 3, … and the mean is 1/p. Under the other definition, X is the number of failures before the first success; the support starts at 0 and the mean becomes (1 − p)/p. Because R's dgeom function uses the second definition, comparing results requires a shift of one unit.
What does the memoryless property mean?
It is the identity P(X > m + n | X > m) = P(X > n): knowing that the first m trials failed does not change the probability structure of the remaining trials at all. Getting ten heads in a row does not raise the probability of tails on the next toss. The geometric distribution is the only discrete distribution with this property; its continuous counterpart is the exponential distribution.
How does this relate to the 'gambler's fallacy'?
The gambler's fallacy is the belief that an outcome which has not appeared for a long time is now 'due'. Memorylessness shows directly that this is false: in independent trials, past outcomes do not influence the future. The P(X > k) column in this calculator lets you see how the probability of failing for k trials decays geometrically while the conditional probability stays constant.
How is it computed in Excel, SPSS, and R?
Excel has no direct function; write =(1-p)^(k-1)*p for P(X = k) and =1-(1-p)^k for P(X ≤ k). In R, the number-of-trials definition needs dgeom(k-1, p) and pgeom(k-1, p) because R is built on the failure-count definition. In Python, scipy.stats.geom.pmf(k, p) uses the number-of-trials definition directly. SPSS provides the PDF.GEOM(k, p) function.
How does the geometric distribution relate to the negative binomial?
The geometric distribution is the special case of the negative binomial distribution with r = 1, that is, the first success. The negative binomial models the wait until the rth success; setting r = 1 gives exactly the geometric distribution. If you need to wait for more than one success, use the negative binomial calculator.
Why does the mean 1/p come out so large?
The expected number of trials is the reciprocal of the success probability: with p = 0.01 you need 100 trials on average. Because the distribution is extremely right-skewed, however, half of all sequences finish far earlier than the mean (the median is roughly 0.693/p). For that reason, never report the mean of a geometric distribution on its own; add the median and the tail probabilities.
What should I do if the trials are not independent?
The geometric model rests on independence and a constant p. If you are sampling without replacement from a finite population, the probability changes at every draw and the negative hypergeometric distribution is required; if there is a learning effect or a risk that varies over time, survival analysis (Kaplan-Meier, Cox regression) is more appropriate. When the population is large and the sample small (n/N ≤ 0.05), the geometric model is a good approximation.