Gamma Distribution Calculator
What this calculator does
The gamma distribution is one of the most useful continuous probability models for nonnegative data. It appears whenever you are studying waiting times, accumulated durations, rainfall totals, insurance claim amounts, or any measurement that cannot go below zero and often has a long right tail. This calculator lets you turn that theory into concrete numbers. Enter a shape parameter k, a scale parameter θ, and a value x, and the tool returns the probability density at that point, the cumulative probability up to that point, the survival probability beyond that point, and the distribution’s mean and variance. If you also supply a probability p, it finds the corresponding quantile numerically.
That combination is practical because the gamma distribution answers several different questions at once. Sometimes you want to know how plausible a specific value is relative to the curve itself, which is what the PDF helps describe. Sometimes you want the share of all outcomes that fall at or below a threshold, which is the CDF. In reliability or queueing work, you may care more about what remains above a threshold, which is the survival probability. In planning, you often want the reverse direction: given a target probability, what cutoff value do I need? The optional quantile output is built for that.
What the gamma distribution models in plain language
A useful mental model is to think of the gamma distribution as the distribution of total waiting time for several stages to finish. If one event occurs at a steady average rate, the waiting time until the first event is exponential. If you wait for the second, third, or fourth stage as well, the total waiting time becomes gamma-shaped. That is why the gamma family is common in queueing theory, renewal processes, reliability engineering, hydrology, and operations analysis. It captures a flexible range of shapes without allowing impossible negative values.
The shape parameter k controls the overall form of the curve. When k = 1, the gamma distribution becomes the exponential distribution, with a steep decline from the origin. When k is larger than 1, the density rises from zero, reaches a peak, and then falls, producing a hump-shaped curve. As k increases further, the curve usually becomes less skewed and more concentrated around its center. The scale parameter θ stretches or compresses the horizontal axis. Larger values of θ push the distribution outward, increasing both the mean and the spread.
Because gamma data live on the nonnegative axis, units matter in a simple way. The shape parameter k is dimensionless. The scale parameter θ has the same units as x. If x is measured in hours, then θ is also in hours. If x is rainfall in millimeters, then θ is in millimeters. This is one of the easiest places to make an input mistake. If you mix hours and minutes or liters and milliliters, the math will still run, but the result will describe the wrong scenario.
How to choose the inputs
Shape k. Enter a positive number. Larger shape values usually mean the process has more stages, more structure, or less extreme right-skew. Smaller positive values, especially below 1, can create a density that is sharply concentrated near zero with a long tail. In applied work, k is often estimated from data or inherited from a model fit.
Scale θ. Enter a positive number in the same units as x. Increasing θ spreads the distribution out horizontally. Since the mean is kθ, doubling θ doubles the mean when k is held constant. Many textbooks use a rate parameter β instead of scale, where β = 1/θ. If your source gives a rate, convert it before using this page.
Value x. Enter a nonnegative number. This is the specific point at which you want the PDF and CDF evaluated. In a waiting-time example, x might be 3 hours. In a rainfall example, it might be 18 millimeters. In a reliability example, it might be 500 operating cycles. The calculator does not assume the meaning of the unit; it only assumes that x and θ are on the same scale.
Probability p. This field is optional. If you leave it blank, the calculator simply reports the density, cumulative probability, survival probability, mean, and variance for your chosen x. If you enter a number between 0 and 1, the calculator also solves the inverse problem and returns the quantile x such that F(x) = p. That is useful for deadlines, service-level targets, and percentile thresholds.
When you are unsure about an input, try scenario testing instead of forcing a single best guess. Run a conservative set of parameters, then a more aggressive set, and compare how much the outputs move. Gamma models can be sensitive to scale changes, especially in tail probabilities, so seeing a range is often more informative than trusting one exact-looking number.
How the formulas work
The gamma probability density function for shape k and scale θ is:
The PDF is not itself a probability for landing on exactly one real-valued point. Instead, it is a density: it tells you how much probability mass is concentrated near x. A high PDF means the curve is tall there, but the actual probability of a narrow interval depends on both the height and the interval width.
The cumulative distribution function adds up the density from zero to x. In gamma notation, it can be written using the lower incomplete gamma function:
The CDF is often the easiest output to interpret. If the calculator shows CDF = 0.78, that means about 78% of outcomes are expected to be at or below your chosen x. The survival probability is simply 1 - CDF, which is the share still above x. In service and reliability language, survival answers questions such as, “What fraction of cases take longer than this?”
The mean and variance are:
Those two summary values give you a quick scale check. If your mean or variance looks wildly inconsistent with the process you are modeling, stop there and recheck the inputs before interpreting the tail probabilities. The optional quantile output works in the other direction: rather than plugging in x and reading a probability, it searches for the x that achieves your target p. The page computes that inverse numerically with a stable binary-search routine wrapped around the gamma CDF.
At a broader level, every calculator is still just a function of the numbers you supply. If you like a general mathematical picture, that idea can be written as:
And when a result is assembled from weighted pieces, the same general logic can look like:
Those two formulas are more general than the gamma distribution itself, but they are a useful reminder that every output depends on clearly defined inputs and assumptions. With probability models, most mistakes come from feeding the right formula the wrong interpretation of the data.
Worked example
Suppose you enter k = 1, θ = 2, and x = 3. Because k = 1, this special case behaves like an exponential distribution with scale 2. The calculator will report a PDF of about 0.111565, a CDF of about 0.776870, a survival probability of about 0.223130, a mean of 2, and a variance of 4. In plain language, roughly 77.7% of outcomes are expected to fall at or below 3 units, and about 22.3% are still above 3 units.
Now add an optional probability such as p = 0.9. The quantile output tells you the cutoff value below which 90% of outcomes fall. For this example, the 90th percentile is approximately 4.605170. That is a useful planning threshold: if this distribution represented waiting time, setting a deadline at about 4.61 units would cover about 90% of cases under the model.
A quick reasonableness check helps. Since the mean here is only 2, a value of 3 should already be above average, so it makes sense that the CDF is greater than 0.5. Likewise, the 90th percentile should lie farther to the right than the mean, so a value around 4.6 is plausible. That kind of sanity check is worth doing every time, even when the calculator provides the arithmetic instantly.
How changing shape affects the result
One good way to build intuition is to hold θ and x fixed while changing k. The table below uses θ = 2 and x = 6. Notice how the mean rises as shape increases, and how the cumulative probability at the same cutoff can fall because the distribution shifts rightward.
| Scenario | Shape k | Scale θ | Value x | Mean kθ | Approx. CDF at x | Interpretation |
|---|---|---|---|---|---|---|
| Single-stage wait | 1 | 2 | 6 | 2 | 0.950 | With a small shape, 6 is far into the right tail, so most outcomes are already below it. |
| Two-stage process | 2 | 2 | 6 | 4 | 0.801 | The same cutoff still covers most cases, but less dramatically because the center of the distribution moved right. |
| Three-stage process | 3 | 2 | 6 | 6 | 0.577 | Now the cutoff sits close to the mean, so the cumulative probability is only a bit above one half. |
This is why a gamma model can feel intuitive once you practice with it. Changing shape does not merely make the curve taller or shorter; it changes where mass accumulates along the axis. The optional mini-game below is built around that exact idea, so you can train your eye to match a target CDF with the correct horizontal cutoff.
How to interpret the outputs on this page
PDF tells you the height of the density curve at x. It is best for comparing relative plausibility near neighboring values, not for saying that one exact value has that much probability by itself. CDF tells you the fraction at or below x. Survival tells you the fraction above x. Mean and variance summarize center and spread. Quantile, when requested, tells you which value of x reaches the cumulative target p.
When the result appears, ask three questions. First, are the units consistent between x and θ? Second, is the scale sensible relative to the mean kθ? Third, does the CDF move in the direction you would expect when you change one parameter at a time? If any answer feels wrong, the issue is usually not the gamma formula itself. It is more often a mismatch between data meaning and model meaning.
Assumptions, edge cases, and numerical notes
This calculator assumes k > 0, θ > 0, and x ≥ 0. The optional probability must lie from 0 to 1 inclusive. At p = 0, the quantile is 0. At p = 1, the theoretical quantile extends to infinity, so the page reports that as infinity rather than pretending there is a finite cutoff. For most realistic intermediate probabilities, the inverse search is fast and stable.
Behind the scenes, the page evaluates the gamma function with a standard approximation and computes the regularized lower incomplete gamma function for the CDF. That matters because the gamma distribution does not have a simple elementary antiderivative in general. You do not need to know the implementation details to use the tool well, but it helps explain why the quantile is found numerically instead of by a simple closed-form expression.
One subtle point is that densities can be very large near zero when 0 < k < 1. That is not automatically an error. It reflects a curve that is sharply concentrated near the origin while still integrating to a total probability of 1. In that regime, the CDF can rise quickly for small values of x, so small changes in x may create noticeable changes in cumulative probability.
The gamma distribution is powerful, but it is still a model. It does not prove that your data-generating process truly has gamma behavior. Use it when the shape, support, and interpretation fit the problem, and compare it with empirical data or domain knowledge when the stakes are high. For engineering, finance, medicine, compliance, or safety work, treat calculator outputs as decision support rather than a substitute for professional validation.
Calculate gamma PDF, CDF, survival, mean, variance, and quantile
Mini-game: Gamma Quantile Sprint
Want intuition you can feel? This optional mini-game turns the gamma CDF into a fast arcade challenge. Each round shows a live gamma curve with a target cumulative probability. Drag or move the cutoff line until the shaded area under the curve matches the target, then lock your guess. Quick accurate hits build streaks, later phases tighten the tolerance, and the final Tail Rush pushes you toward harder probabilities near the extremes.
Tip: if your calculator inputs are valid, the game uses them as the opening distribution before remixing new rounds.
