# P-value Calculator

URL: https://hifreetools.com/calculators/p-value-calculator

> Convert a test statistic into a p-value for the z, t, chi-square, or F distribution, with one- and two-tailed options and an automatic significance check at α = 0.05.

## Quick answer

A p-value is the probability of obtaining a test statistic at least as extreme as the one observed, assuming the null hypothesis is true. Enter your statistic, pick the distribution (normal z, Student's t, chi-square, or F) and the tail, and this calculator returns the p-value using the regularized incomplete gamma and beta functions — accurate to about six significant figures. A p-value below your significance level (commonly 0.05) means the result is statistically significant.

## Formula

- z: p (two-tailed) = 2 · (1 − Φ(|z|))
- t: p (two-tailed) = I_{df/(df+t²)}(df/2, ½)
- χ²: p (right tail) = Q(df/2, χ²/2)
- F: p (right tail) = I_{df₂/(df₂+df₁F)}(df₂/2, df₁/2)
- χ² and F two-tailed = 2 · min(left, right); significant when p < 0.05

The normal (z) p-value uses the error function: the two-tailed value is 2·(1 − Φ(|z|)). The t and F p-values use the regularized incomplete beta function, and the chi-square p-value uses the regularized incomplete gamma function. These special functions are evaluated with the standard series and continued-fraction expansions (Numerical Recipes), giving ~6 significant figures of accuracy.

## Inputs

- z statistic (-1000 to 1000); default 1.96
- t statistic (-1000000 to 1000000); default 1.96
- χ² statistic (0 to 10000000); default 1.96
- F statistic (0 to 10000000); default 1.96
- Degrees of freedom (df) (0 to 1000000); default 10
- df₁ (numerator) (0 to 1000000); default 3
- df₂ (denominator) (0 to 1000000); default 12

## Worked examples (computed by the page's own function)

- z statistic = 1.96 → p-value (two-tailed) = 0.049996, p-value (right tail, upper) = 0.024998, p-value (left tail, lower) = 0.975002  (z = 1.96: p two-tailed = 0.0499958, right = 0.0249979, left = 0.975002)
- t statistic = 2.131, Degrees of freedom (df) = 15 → p-value (two-tailed) = 0.050043, p-value (right tail, upper) = 0.025021, p-value (left tail, lower) = 0.974979  (t = 2.131: p two-tailed = 0.0500425, right = 0.0250213, left = 0.974979)
- χ² statistic = 3.841, Degrees of freedom (df) = 1 → p-value (two-tailed) = 0.100027, p-value (right tail, upper) = 0.050014, p-value (left tail, lower) = 0.949986  (χ² = 3.841, df = 1: p two-tailed = 0.100027, right = 0.0500137, left = 0.949986)
- F statistic = 3.49, df₁ (numerator) = 3, df₂ (denominator) = 12 → p-value (two-tailed) = 0.100022, p-value (right tail, upper) = 0.050011, p-value (left tail, lower) = 0.949989  (F = 3.49, df = 3, 12: p two-tailed = 0.100022, right = 0.050011, left = 0.949989)

## Verification

Checked against 25 reference cases (expected values computed independently). Reviewed 2026-10-27. Latest change 2026-10-28: Moved to the schema renderer with a scipy-checked ledger; the tail picker is replaced by showing two-tailed, right and left p-values together (χ² and F lead with the right tail), and special functions now hold ~12 significant figures.

## FAQ

**What counts as statistically significant?**
By convention, a p-value below the significance level α (often 0.05) is called statistically significant, meaning you reject the null hypothesis. The tool flags this automatically at α = 0.05.

**One-tailed or two-tailed — which should I use?**
Use a two-tailed test when you care about a difference in either direction, and a one-tailed test only when your hypothesis is directional. Choose the matching option before reading the p-value.

**How accurate is the result?**
About six significant figures. It uses the regularized incomplete gamma and beta functions rather than a lookup table, so values between table rows are exact.

**What degrees of freedom do I enter?**
For a t or chi-square test, enter its df. For an F test, enter the numerator df₁ and denominator df₂ separately, in that order.

**Does a small p-value prove my hypothesis?**
No. A small p-value is evidence against the null hypothesis, but it does not measure effect size or prove the alternative. Always report it alongside the effect and context.

**Is my data uploaded?**
No — only the single statistic you type is used, and all computation happens in your browser.


## Sources

- [Wikipedia — p-value](https://en.wikipedia.org/wiki/P-value)
- [NIST/SEMATECH e-Handbook of Statistical Methods](https://www.itl.nist.gov/div898/handbook/)
- [NIST/SEMATECH e-Handbook — Critical values of the Student's t distribution](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3672.htm)
- [NIST/SEMATECH e-Handbook — Critical values of the chi-square distribution](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3674.htm)
- [NIST/SEMATECH e-Handbook — Upper critical values of the F distribution](https://www.itl.nist.gov/div898/handbook/eda/section3/eda3673.htm)
- [NIST DLMF §8.17 — Incomplete beta functions](https://dlmf.nist.gov/8.17)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "P-value Calculator", https://hifreetools.com/calculators/p-value-calculator
