Geometric Distribution Calculator
Enter the chance of success on one try and get the probability that the first success lands on trial k, within k tries, or later. Find how many tries you need for a target chance, with the working and a chart.
Last updated October 20, 2026 • Written by Mark, StatsSolve • Free, no sign-up
Geometric Probability Calculator
Enter p and your question. Results update as you type.
Working appears here.Syntax appears here.Summary appears here.Six kinds of question answered from one p, from the first-success probability to a range of trials.
Switch the counting convention and every formula, label and table follows, so an off-by-one stops being a surprise.
Enter a target chance such as 95% and get the number of trials, with the working shown.
What Does a Geometric Distribution Calculator Do?
A geometric distribution calculator tells you how likely it is that your first success arrives on a particular attempt. Give it the chance of success on a single try, say 1 in 6 for rolling a six, and a trial number, and it returns the probability. It also works out the chance of succeeding within a certain number of tries, the chance of needing more than that, the mean number of attempts, the variance, the standard deviation and the median.
This one covers the questions people actually ask. How likely is the first six on exactly the fourth roll? What is the probability of at least one success in 10 tries? How many attempts do I need before I have a 95% chance of at least one success? You can switch between the two common conventions (counting the trials up to and including the first success, or counting only the failures before it), and the working is shown on screen so you can check a homework answer.
A bar chart marks the probability of each trial number and shades the ones your question covers, which makes the long right tail of the distribution easy to see. For a different counting problem, such as the number of successes in a fixed number of trials, use the binomial distribution calculator instead.
What Is the Geometric Distribution?
The geometric distribution models the number of independent trials needed to get the first success, when every trial has the same probability of success p. Each trial has only two outcomes, success or failure, and one trial does not affect the next. Flipping a coin until the first head, rolling a die until the first six and testing items on a line until the first defect all fit.
Three conditions must hold:
- Two outcomes per trial. Success or failure, nothing in between.
- Independent trials. Earlier results do not change the later chances.
- A constant p. The probability of success stays the same from trial to trial.
If the probability changes (drawing cards without replacement, for example), the geometric model is the wrong tool. The probability of a first success then depends on what has already happened, and the hypergeometric distribution calculator is closer to what you need.
The distribution is discrete, and it has no upper limit: the first success could in principle take 5 trials or 500. The probabilities fall steadily as the trial number rises, so the most likely single outcome is always the very first trial, whatever p is.
What Are the Geometric Distribution Formulas?
Let X be the trial on which the first success occurs, so X = 1, 2, 3, and so on. Write q = 1 − p for the chance of a failure.
The first formula says that you fail k − 1 times in a row and then succeed once. The cumulative formula comes from the complement: the only way to have no success in k trials is k failures, which has probability (1 − p)^k, so the chance of at least one success is one minus that.
The summary measures are short:
The mean of 1 / p matches intuition: if one try in six succeeds, you expect to wait six tries on average. The variance grows quickly as p shrinks, which is why waiting times for rare events are so unpredictable. To go the other way and find the trial number for a target probability, solve the cumulative formula for k: k = ⌈ ln(1 − target) / ln(1 − p) ⌉.
How Do You Use This Geometric Distribution Calculator?
- Enter the probability of success, p. Type a decimal such as 0.05, a percentage such as 5%, or a fraction such as 1/6. It must be above 0 and at most 1.
- Pick what X counts. “Trials up to and including the first success” starts at 1 and is the usual textbook version. “Failures before the first success” starts at 0. The section on conventions below explains which one your course uses.
- Choose the question. Exactly k, at most k, fewer than k, at least k, more than k, or between two values. A separate option finds how many trials you need for a target chance of success.
- Enter k (or both limits, or the target probability) and read the answer. The result updates as you type.
The result cards show the probability you asked for next to the mean, variance, standard deviation and median. The table lists the probability and the running total for each trial number, and the chart highlights the ones included in your answer. Choose how many decimal places to display; the calculation always runs at full precision. Values of k up to 1,000,000 are accepted.
Example 1: What Is the Chance of the First Six on the Fourth Roll?
A fair die has p = 1/6 of showing a six. What is the probability that the first six comes on exactly the fourth roll?
That is about 9.65%. You need three non-sixes in a row, each with probability 5/6, and then a six. The same distribution answers related questions:
| Question | Formula | Answer |
|---|---|---|
| First six on roll 4 exactly | (5/6)^3 × 1/6 | 0.0965 |
| First six within 4 rolls, P(X ≤ 4) | 1 − (5/6)^4 | 0.5177 |
| No six in 4 rolls, P(X > 4) | (5/6)^4 | 0.4823 |
| First six on roll 4 or later, P(X ≥ 4) | (5/6)^3 | 0.5787 |
| First six between rolls 2 and 5 | (5/6)^1 − (5/6)^5 | 0.4315 |
The mean is 6 rolls, the variance is 30 and the standard deviation is 5.4772. Notice that the median is only 4: half of all players see their first six by the fourth roll, even though the average is 6. A few very long waits pull the mean up. The average calculators on this site, such as the mean, median and mode calculator, show the same pull on any skewed list of numbers.
Example 2: How Many Free Throws Until the First Make?
A player makes 70% of free throws, so p = 0.7. Count the throws up to and including the first make.
| First make on throw k | P(X = k) | P(X ≤ k) |
|---|---|---|
| 1 | 0.7 | 0.7 |
| 2 | 0.21 | 0.91 |
| 3 | 0.063 | 0.973 |
There is a 91% chance of making a shot within two throws and a 97.3% chance within three. The expected number of throws is 1 / 0.7 = 1.4286, the variance is 0.3 / 0.49 = 0.6122 and the standard deviation is 0.7825. When p is high the distribution is squeezed against k = 1 and the tail is short. Each extra throw needed is less likely than the last by a factor of 0.3, the miss probability.
If you wanted the number of makes in a fixed set of 10 throws instead, that is a count of successes in a fixed number of trials, and the binomial probability calculator handles it.
Example 3: How Many Trials Do You Need for a 95% Chance of a Success?
This is the question behind sample sizes, retries and lottery-style odds. A process succeeds with p = 0.05 on each try. How many tries give you a given chance of at least one success?
Solve 1 − (1 − p)^k ≥ target for k and round up:
| Target chance of at least one success | Trials needed (p = 0.05) |
|---|---|
| 50% | 14 |
| 90% | 45 |
| 95% | 59 |
| 99% | 90 |
A 5% chance per try does not mean 20 tries guarantee a success. After 20 tries the probability of still having none is 0.95^20 = 0.3585, or about 36%. The mean of 20 is an average over many runs, not a promise. Use the “trials needed” option in the calculator to get these numbers for any p and any target.
Example 4: Why Is the Median Smaller Than the Mean?
A factory finds that 2% of items are defective, so p = 0.02, and inspectors check items one at a time until they find a defect. The mean wait is 1 / 0.02 = 50 items.
| Measure | Value |
|---|---|
| Mean number inspected | 50 |
| Median | 35 |
| Chance the first defect is within 50 items | 0.6358 |
| Number inspected for a 95% chance of finding one | 149 |
Half of all inspection runs find a defect by item 35, yet the average is 50. The distribution is strongly right-skewed (skewness (2 − 0.02) / √0.98 = 2.0), with a thin tail of long runs that raise the mean. The chance of finding a defect within the first 50 items is only 63.6%, so reaching the “average” does not mean you will usually have found one. For a skewed waiting time the median and the percentiles are often more useful than the mean.
The standard deviation here is 49.5, almost as large as the mean. That near-equality is a signature of the geometric distribution when p is small. The standard deviation calculator and the variance calculator let you compare these results with a data set you have collected.
Trials or Failures: Which Geometric Convention Does Your Course Use?
There are two versions of the geometric distribution, and mixing them is the most common reason an answer is off by one.
| X = trials up to the first success | Y = failures before the first success | |
|---|---|---|
| Possible values | 1, 2, 3, … | 0, 1, 2, … |
| P(exactly k) | (1 − p)^(k−1) × p | (1 − p)^k × p |
| P(at most k) | 1 − (1 − p)^k | 1 − (1 − p)^(k+1) |
| Mean | 1 / p | (1 − p) / p |
| Variance | (1 − p) / p² | (1 − p) / p² |
| Used by | Most statistics textbooks, TI-84 geometpdf, SciPy geom | R dgeom, some probability texts, Excel via NEGBINOM.DIST |
The two are the same random experiment counted differently, so Y = X − 1. With p = 0.25, the mean number of trials is 4 and the mean number of failures is 3, but the variance and standard deviation (3.4641) are identical. The probability of exactly 3 failures before the first success equals the probability of the first success on trial 4, which is 0.75^3 × 0.25 = 0.1055.
If your problem says “on the kth trial” or “how many trials,” use the trials convention. If it says “how many failures” or “how many times before,” use failures. The calculator lets you choose, and every label on the page changes with your choice.
What Is the Memoryless Property of the Geometric Distribution?
The geometric distribution is memoryless: having already failed several times does not change the chances for what comes next. Formally, P(X > m + n | X > m) = P(X > n).
A quick check with p = 0.2. The chance of no success in the next 5 trials is 0.8^5 = 0.32768. Now suppose you have already failed 3 times. The chance of getting through 5 more failures, 8 in total, given the first 3, is 0.8^8 / 0.8^3 = 0.32768. It is the same number, because the three earlier failures leave nothing behind.
This is the point behind the gambler’s fallacy. After ten tails in a row a coin is not “due” for a head. The next flip is still 50/50, and the expected remaining wait is still 2 flips. The geometric distribution is the only discrete distribution with this property; its continuous counterpart is the exponential distribution.
How Does the Geometric Distribution Compare With Related Distributions?
Several distributions count successes and failures, and picking the right one comes down to what is fixed and what is random.
| Distribution | What is random | What is fixed |
|---|---|---|
| Geometric | Number of trials until the first success | p, stop at first success |
| Negative binomial | Number of trials until the r-th success | p and r |
| Binomial | Number of successes | p and number of trials n |
| Poisson | Number of events in an interval | Average rate |
| Hypergeometric | Number of successes when sampling without replacement | Population and sample size |
The geometric distribution is the special case of the negative binomial with r = 1. It is also the waiting-time partner of the binomial: a binomial counts successes in a set number of trials, while a geometric counts trials until one success. Use the binomial distribution calculator when the number of trials is fixed, the Poisson distribution calculator when events arrive at an average rate, and the hypergeometric distribution calculator when you draw without replacement.
For large waiting times with a small p, the shape of the geometric distribution is closely matched by a smooth exponential curve with mean 1 / p. You do not need the normal curve for this one: the distribution is far too skewed. If you need areas under a bell curve for a different problem, the normal CDF calculator is the place for that.
How Do the Mean, Variance and Shape Change With p?
A larger p means fewer expected attempts and a tighter distribution. A smaller p means a longer, more spread-out wait.
| p | Mean (1 / p) | Std dev | Median |
|---|---|---|---|
| 0.5 | 2 | 1.4142 | 1 |
| 0.2 | 5 | 4.4721 | 4 |
| 0.1 | 10 | 9.4868 | 7 |
| 0.01 | 100 | 99.4987 | 69 |
Two patterns stand out. The standard deviation is always slightly smaller than the mean, and the two get closer as p falls. And the median is roughly 0.69 of the mean for small p (ln 2 = 0.693), which is why the median sits at 69 when the mean is 100.
For p = 0.4 the first eight probabilities are 0.4, 0.24, 0.144, 0.0864, 0.0518, 0.0311, 0.0187 and 0.0112. Each is 0.6 times the one before it. That constant ratio is what the word “geometric” refers to: the probabilities form a geometric sequence with first term p and common ratio 1 − p. They sum to exactly 1.
How Do You Calculate Geometric Probabilities in Excel, R, Python and a TI-84?
Software packages disagree on the convention, so check the first argument. The examples below use p = 0.05 and k = 10 on the trials scale.
Formula (any spreadsheet) =(1-p)^(k-1)*p P(X = k)
=1-(1-p)^k P(X <= k)
Excel / Sheets =NEGBINOM.DIST(k-1, 1, p, FALSE) P(X = k) (counts failures, so use k-1)
=NEGBINOM.DIST(k-1, 1, p, TRUE) P(X <= k)
R dgeom(k-1, p) pgeom(k-1, p) failures convention, so use k-1
qgeom(0.95, p) + 1 trials needed for a 95% chance
Python (SciPy) from scipy.stats import geom
geom.pmf(10, 0.05) # 0.0315
geom.cdf(10, 0.05) # 0.4013
geom.ppf(0.95, 0.05) # 59.0
TI-84 Plus geometpdf(p, k) geometcdf(p, k) trials convention
For p = 0.05 and k = 10, the probability of the first success on exactly the 10th trial is 0.0315 and the probability of a success within 10 trials is 0.4013. The “Same calculation in other tools” box in the calculator prints these lines with your own p and k filled in. In R, forgetting the −1 is the classic mistake: dgeom(10, 0.05) answers a different question, the probability of exactly 10 failures first.
What Mistakes Do People Make With Geometric Probabilities?
- Using the wrong convention. Counting failures when the question counts trials, or the reverse, shifts every answer by one.
- Using k instead of k − 1 as the exponent. For the first success on trial k there are k − 1 failures, not k.
- Treating P(X ≤ k) as P(X = k). “Within 4 trials” is cumulative; “on the 4th trial” is exact.
- Confusing “more than k” with “at least k”. P(X > k) is (1 − p)^k, while P(X ≥ k) is (1 − p)^(k−1).
- Assuming the mean is a guarantee. With p = 0.05 the mean wait is 20, but about 36% of runs take longer than 20 trials.
- Believing a streak of failures makes success “due”. The memoryless property says it does not.
- Ignoring dependence. If trials are not independent or p drifts, the geometric model gives wrong answers.
- Entering a percentage as a decimal. A 5% chance is p = 0.05, not 5.
Key Points to Remember
- The geometric distribution gives the probability that the first success arrives on trial k: P(X = k) = (1 − p)^(k−1) p.
- The chance of at least one success in k trials is 1 − (1 − p)^k.
- Mean = 1 / p, variance = (1 − p) / p², and the most likely value is always 1.
- The trials convention starts at 1; the failures convention starts at 0. Check which one your source uses.
- The distribution is memoryless: past failures do not change what comes next.
- To reach a target chance q of at least one success, you need k = ⌈ ln(1 − q) / ln(1 − p) ⌉ trials.
- The mean is pulled up by long waits, so the median is often a better “typical” value.
Frequently Asked Questions
What is the formula for the geometric distribution?
P(X = k) = (1 − p)^(k−1) × p, where p is the probability of success on each trial and k is the trial of the first success. The cumulative version is P(X ≤ k) = 1 − (1 − p)^k.
What is the mean of a geometric distribution?
The mean is 1 / p when X counts trials up to the first success, and (1 − p) / p when X counts failures before it. With p = 1/6, you expect 6 rolls to get the first six.
How do you find the probability that the first success is on the 4th trial?
Multiply the probability of three failures in a row by the probability of a success: (1 − p)^3 × p. For p = 1/6 that is (5/6)^3 × 1/6 = 0.0965.
What does the memoryless property mean?
It means past failures do not affect the future. The probability of needing more than n further trials is the same whether or not you have already failed m times: P(X > m + n | X > m) = P(X > n).
What is the difference between the geometric and binomial distributions?
A binomial counts successes in a fixed number of trials. A geometric counts the trials needed to get the first success. In the binomial the number of trials is fixed; in the geometric it is random. If you are unsure which one your problem needs, the binomial conditions checker tests that requirement and the other three.
How many trials do I need for a 95% chance of at least one success?
Use k = ⌈ ln(0.05) / ln(1 − p) ⌉. With p = 0.05 that is 59 trials. With p = 1/6 it is 17 trials.
What is the variance of the geometric distribution?
The variance is (1 − p) / p², for both conventions. With p = 0.25 the variance is 12 and the standard deviation is 3.4641.
Is this geometric distribution calculator accurate and free?
Yes. It runs in your browser at full double precision and matched SciPy’s geom functions on every test StatsSolve tried, to the digits shown. Like every StatsSolve calculator it is free and needs no sign-up.
Sources: NIST/SEMATECH e-Handbook of Statistical Methods; SciPy documentation for scipy.stats.geom; R documentation for dgeom, pgeom and qgeom; Microsoft documentation for NEGBINOM.DIST; Texas Instruments documentation for geometpdf and geometcdf.
Related Calculators
Counting something different? These cover the neighbouring distributions, or browse the full list of free statistics calculators:
Binomial Distribution CalculatorExact, cumulative, and interval binomial probabilities with full statistics.
Hypergeometric Distribution CalculatorProbabilities when you sample without replacement.
Normal CDF CalculatorArea under the normal curve between any two bounds.
All StatsSolve CalculatorsBrowse the full directory of free statistics tools.

