Probability Distribution Calculator with p-Values & t-Tests

Visualize probability distributions interactively and run one- or two-sample hypothesis tests.

Five distributions — normal, Student's t, chi-square, Poisson, and binomial — share one numeric engine underneath this visualizer, built from hand-implemented special functions rather than a statistics library: an Abramowitz-and-Stegun approximation for the error function, a Lanczos approximation for the log-gamma function, and continued-fraction evaluations of the incomplete gamma and incomplete beta functions that the t, chi-square and binomial curves are built on.

How to use the probability distribution calculator

  1. Pick normal, Student's t, chi-square, Poisson or binomial, and set its parameters with the sliders — for the normal, a mean from −20 to 20 and a standard deviation from 0.1 to 10.
  2. In the region panel choose Left tail, Right tail, Two-tailed or Between two boundaries, then type the boundary value, or drag across the chart to shade a range directly.
  3. Read the shaded probability, which is the p-value when the boundary is a test statistic.
  4. To work backwards, enter a target probability and read the matching critical value, or the lower and upper pair for a two-tailed region.
  5. For problems that start from sample summaries, scroll to the z-score, confidence interval and t-test panels.

The math the curves are built from

The normal distribution's CDF comes directly from the error function, computed with the Abramowitz & Stegun 7.1.26 rational approximation — accurate to roughly 1.5 parts in ten million, more than enough precision for a visual tool. The chi-square and gamma-family calculations lean on the regularized lower incomplete gamma function, evaluated with a power series when its argument is small and a continued fraction when it's large, since each converges quickly only in its own regime. Student's t and the binomial distribution's cumulative probabilities are built on the regularized incomplete beta function the same way, via its own continued-fraction expansion.

Quantiles — the inverse direction, going from a probability back to a value — don't get their own formula per distribution. Instead, one generic bisection routine expands outward from a starting guess until it brackets the target probability using nothing but the distribution's own CDF, then bisects down to a precise answer. The discrete distributions (Poisson, binomial) use the analogous smallest-integer search: the smallest k where the CDF first reaches the target probability.

What the distribution calculator computes

Region probability, p-values and critical values in one panel

Because every distribution exposes the same cdf() and quantile() interface, one panel handles all five: pick a tail mode — left, right, two-tailed, or a custom 'between' region — set a boundary value, and the region's probability (a p-value, in hypothesis-testing terms) comes straight from the CDF at that boundary. Run the same idea backward by entering a target probability instead, and the corresponding critical value (or pair of values, for a two-tailed region) comes from the quantile function.

You can also drag directly across the plotted curve to shade an arbitrary region rather than typing a boundary value, or click once to set it — the PDF line for a continuous distribution and the PMF bars for a discrete one both respond to the same drag gesture.

Hypothesis testing built on the same engine

The z-score/p-value panel standardizes a sample value against a known population mean and standard deviation and reads the p-value off the standard normal CDF. The confidence-interval panel builds an interval around a sample mean using the t-distribution rather than the normal — the correct choice whenever the population standard deviation is estimated from the sample itself rather than known in advance, which describes every input this panel actually asks for.

Two t-tests round out the panel: a one-sample test checking whether a sample mean differs from a hypothesized population mean, and a two-sample test comparing two sample means against each other. The two-sample test defaults to Welch's formulation, which assumes the two samples' variances may differ and computes degrees of freedom with the Welch-Satterthwaite equation — the safer default absent good evidence the variances actually match — with the classic pooled-variance Student's t-test available as an explicit alternative.

PDF vs PMF on the distribution chart

For the continuous distributions — normal, t and chi-square — the chart draws a probability density function (PDF). The height of that curve is a density, not a probability, and probability only comes from area: the chance of landing between two values is the area under the curve between them. That is also why the probability of hitting one exact value is zero for a continuous variable.

Poisson and binomial counts are discrete, so the chart switches to probability mass function (PMF) bars. Each bar's height is the actual probability of that whole number, and a region's probability is the sum of the bars inside it, with both endpoints included when you use the between mode.

Reading a p-value from the shaded tail

Decide the significance level α, commonly 0.05, before looking at any data. Then compute the test statistic, shade the tail that matches your alternative hypothesis, and compare the shaded area with α: a p-value below α means a result this extreme would be rare if the null hypothesis were true.

A p-value above α does not show the null hypothesis is true; it only means the sample could not rule it out, often because it was too small. The p-value also says nothing about how large or important an effect is, which is why reporting a confidence interval alongside it is good practice.

What a visualizer like this can't tell you

Questions people ask about Probability Distributions & Hypothesis Testing Visualizer

What's the difference between the region-probability panel and the hypothesis-test panels?
The region-probability panel works directly off a single distribution's shape — you pick a boundary and it reads the area under the curve. The hypothesis-test panels (z-score, confidence interval, t-tests) start from sample statistics like a mean and standard deviation, compute a test statistic from them, and then look up that statistic's probability on the appropriate distribution automatically.
Why does the confidence interval use the t-distribution instead of the normal distribution?
The t-distribution is the correct choice whenever the population standard deviation isn't actually known and has to be estimated from the sample — which is the only kind of input this tool's confidence-interval panel accepts. The t-distribution has heavier tails than the normal to account for that extra uncertainty, and it converges toward the normal distribution as sample size grows.
Should I use the pooled or Welch two-sample t-test?
Welch's test, the default here, assumes the two samples may have different population variances and is the safer general-purpose choice. The classic pooled-variance test assumes equal variances and is available as an explicit option, but it should only be used when you have real evidence — a prior variance test, or domain knowledge — that the two populations' spread is genuinely comparable.
How accurate are the probabilities this tool reports?
The underlying error-function and incomplete-gamma/beta approximations are accurate to roughly six or seven significant figures, which is well beyond what's visible on the plotted curve and plenty for coursework, sanity-checking a textbook problem, or exploring how a distribution's shape changes with its parameters.
What is the difference between a one-tailed and two-tailed p-value?
A one-tailed p-value counts only the extreme results in the direction your alternative hypothesis predicts, such as a mean being larger. A two-tailed p-value counts both directions, so for a symmetric distribution like the normal or t it is double the one-tailed value.
Can I run a paired t-test?
There is no paired option, but you can get the identical result. Subtract each before value from its after value, compute the mean and standard deviation of those differences, and enter them in the one-sample t-test with a hypothesized mean of 0 and n equal to the number of pairs.
What is the difference between a PDF and a PMF?
A PDF describes a continuous variable and gives probabilities only as areas under its curve, while a PMF describes a count and assigns a direct probability to each whole number. This tool draws a smooth curve for the first kind and bars for the second.

Related tools on BrakeTools

Content reviewed 2026-09-27.