P-Value Calculator

Instantly compute exact one-tailed or two-tailed p-values for Z, Student’s t, Chi-square, F, and Binomial tests. Designed for students, researchers, and analysts, this professional-grade tool emphasizes accuracy, accessibility (WCAG 2.1 AA), and fast mobile performance.

Authoritative Methods and Learning Resources

Data Source and Methodology

  • NIST Digital Library of Mathematical Functions (DLMF), Chapters on the Gamma and Beta functions and the Error Function, Release 1.2.2 (2024). https://dlmf.nist.gov/
  • NIST/SEMATECH e-Handbook of Statistical Methods (2023). https://www.itl.nist.gov/div898/handbook/

All calculations are strictly based on the formulas and data provided by this source.

Implementation details: p-values are computed via cumulative distribution functions (CDFs) using numerically stable forms of the regularized incomplete beta I_x(a, b), the regularized incomplete gamma P(s, x), and the error function erf(x). Tail probabilities are assembled according to the selected alternative hypothesis.

The Formula Explained

Z (Standard Normal): Two–tailed p-value

$$p = 2\bigl(1 - \Phi(|z|)\bigr), \quad \Phi(z) = \frac{1}{2}\bigl[1 + \operatorname{erf}\!\left(\frac{z}{\sqrt{2}}\right)\bigr]$$

Student’s t with ν degrees of freedom:

$$F_t(t;\,\nu) = \tfrac{1}{2} + \operatorname{sgn}(t)\,\tfrac{1}{2}\, I_{\nu/(\nu+t^2)}\!\left(\tfrac{\nu}{2}, \tfrac{1}{2}\right)$$

Chi-square with k degrees of freedom:

$$F_{\chi^2}(x;\,k) = P\!\left(\tfrac{k}{2}, \tfrac{x}{2}\right)$$

F distribution with (d1, d2) degrees of freedom:

$$F_F(x;\,d_1,d_2) = I_{\frac{d_1 x}{d_1 x + d_2}}\!\left(\tfrac{d_1}{2}, \tfrac{d_2}{2}\right)$$

Binomial X ~ Bin(n, p):

$$\Pr(X \le k) = I_{1-p}(n-k,\,k+1), \quad \Pr(X \ge k) = I_{p}(k,\,n-k+1)$$

Two-tailed (conservative): $$p = 2 \min\{\Pr(X \le k), \Pr(X \ge k)\}$$

Glossary of Variables

  • Tail Type: alternative hypothesis (two-tailed, right-tailed, left-tailed).
  • z: observed Z statistic.
  • t, ν: observed Student’s t statistic and degrees of freedom ν > 0.
  • X², k: observed chi-square statistic (X² ≥ 0) and degrees of freedom k ≥ 1.
  • F, d1, d2: observed F statistic (F ≥ 0) and numerator/denominator degrees of freedom d1,d2 ≥ 1.
  • n, k, p: binomial trials (n ≥ 1), successes (0 ≤ k ≤ n), success probability 0 ≤ p ≤ 1.
  • α: significance level for decision support (default 0.05).
  • P-value: probability, under H0, of an outcome at least as extreme as observed.

How It Works: A Step-by-Step Example

Goal: Two-tailed p-value for a Z-test with z = 2.10.

  1. Select Distribution = Z (Standard Normal), Tail = Two-tailed.
  2. Enter z = 2.10, keep α = 0.05.
  3. Compute p: Φ(2.10) ≈ 0.98214 ⇒ p = 2 × (1 − 0.98214) ≈ 0.0357.
  4. Decision: p ≈ 0.0357 ≤ 0.05 ⇒ statistically significant at α = 0.05.

Frequently Asked Questions (FAQ)

Which distributions are supported?

Z, Student’s t, Chi-square, F, and Binomial. Each uses exact CDFs based on special functions.

How is the two-tailed p-value computed?

For symmetric distributions (Z, t), p = 2 × one-sided tail using |statistic|. For Chi-square and F, two-tailed is uncommon; if chosen here, it is defined as 2 × min{left, right} and capped at 1. For Binomial, we use the conservative two-tailed p = 2 × min{P(X ≤ k), P(X ≥ k)}.

Do I need to supply sample sizes?

Only indirectly via degrees of freedom for t, chi-square, and F. The calculator expects the test statistic already computed.

What numeric methods are used?

Lanczos approximation for log Γ, Lentz-type continued fractions for incomplete beta, and series/continued-fraction methods for the incomplete gamma—standard techniques used in scientific computing.

Are extreme inputs safe?

Yes within floating-point limitations. The tool guards against invalid domains (e.g., negative df, p outside [0,1]) and returns stable probabilities close to 0 or 1 where appropriate.

What about continuity corrections?

Continuity corrections are not applied automatically; results are exact for the specified distributions.

Can I use this for power analysis?

No. This calculator focuses on p-values. Use a dedicated power calculator for sample size and power computations.

Tool developed by Ugo Candido. Content verified by CalcDomain Editorial Team.
Last reviewed for accuracy on: .