Gamma Distribution Calculator

Find gamma probabilities below, above or between values, or the x that matches a given probability. Enter the shape k and either the scale θ or the rate β; the mean, variance, median, mode and skewness come with a shaded density chart.

The one chosen above

What the gamma distribution describes

The gamma distribution is the standard model for a positive, right-skewed quantity: the waiting time until the k-th event in a Poisson process, the total rainfall in a season, the size of an insurance claim, or the time to finish k independent tasks. With shape k and scale θ the density is

f(x) = x^(k−1) · e^(−x/θ) / (Γ(k) · θ^k), for x > 0

Mean = kθ Variance = kθ² Skewness = 2/√k

Mode = (k − 1)θ for k ≥ 1; the density is unbounded at 0 for k < 1

Rate form: β = 1/θ, so the mean is k/β and the variance is k/β²

A larger shape makes the curve more symmetric and bell-like; with k = 1 it is the exponential distribution, and with scale 2 and shape ν/2 it is the chi-square distribution with ν degrees of freedom. When k is a whole number the distribution is also called Erlang: the sum of k independent exponential waiting times.

Scale or rate? Check your software

The same distribution is written with a scale θ in some places and with a rate β = 1/θ in others. Mixing them up is the most common gamma mistake, so match the convention before comparing numbers.

SoftwareCumulative probabilitySecond parameter
ExcelGAMMA.DIST(x, alpha, beta, TRUE)scale (beta = θ)
Google SheetsGAMMADIST(x, alpha, beta, TRUE)scale (beta = θ)
Rpgamma(x, shape = k, rate = β) or pgamma(x, k, scale = θ)rate by default
Python (SciPy)scipy.stats.gamma.cdf(x, a=k, scale=θ)scale
MATLABgamcdf(x, a, b)scale (b = θ)

Worked example

A service centre handles requests with an average of 2 minutes between arrivals, and you care about the time until the third request (k = 3, θ = 2 minutes; mean 6 minutes). What is the chance the third request arrives within 5 minutes? For a whole-number shape the cumulative probability has a closed form:

P(X ≤ 5) = 1 − e^(−2.5) · (1 + 2.5 + 2.5²/2!) = 1 − 0.082085 × 6.625 = 0.456187

Load example reproduces this: the probability is 0.456187, the median is 5.3481 minutes, and the mode is 4 minutes. The mean (6) is above the median because the distribution is skewed to the right.

Reading the results

Probability is the shaded area; the complementary probability is the area of the opposite event, taken from the other tail directly so that very small values keep their digits. To find a critical value or a percentile, choose one of the two "Find x" questions and enter the tail area. Parameters must be positive; the shape can be any positive real number, not only a whole number.

Related guides and calculators

With shape 1 the gamma distribution is the exponential distribution, and with shape k / 2 and scale 2 it is the chi-square distribution with k degrees of freedom. Related models are the Weibull and beta distributions and the Poisson distribution for counts. A Poisson count whose rate itself follows a gamma distribution has a negative binomial distribution. Read probability distributions for an overview.

Frequently Asked Questions

What is the difference between the scale and the rate of a gamma distribution?

The rate β is the reciprocal of the scale θ (β = 1/θ). A gamma with shape 3 and scale 2 is the same distribution as one with shape 3 and rate 0.5. Excel, SciPy and MATLAB take the scale; R takes the rate unless you name the scale argument.

How do I calculate the gamma CDF in Excel?

Use GAMMA.DIST(x, alpha, beta, TRUE) where alpha is the shape and beta is the scale. The inverse is GAMMA.INV(probability, alpha, beta). Enter the same shape and scale here to check the value.

Is the chi-square distribution a gamma distribution?

Yes. A chi-square distribution with ν degrees of freedom is a gamma distribution with shape ν/2 and scale 2. Use the chi-square distribution calculator if you want to enter degrees of freedom directly.

Can the shape parameter be less than 1?

Yes. For shape below 1 the density is unbounded at 0 and decreases from there, the mode is reported as 0, and the picture shows a very tall spike next to the y-axis.

What is the mean and variance of a gamma distribution?

With shape k and scale θ the mean is kθ and the variance is kθ². In terms of the rate β they are k/β and k/β². The standard deviation is the square root of the variance.

When is a gamma distribution a better model than a normal one?

When the quantity cannot be negative and is skewed to the right, such as waiting times, rainfall amounts and claim sizes. For large shapes the gamma approaches a normal curve, so the two agree when k is big.

How do I find the x for a given probability (inverse gamma CDF)?

Choose Find x from a lower-tail probability (area to the left) or from an upper-tail probability (area to the right), then enter the probability. The calculator inverts the cumulative distribution function and shades the region on the chart.

Embed This Calculator

Add this free calculator to your course page or LMS.

Adjust the height value to fit your page.