P-value Calculator
Convert a test statistic into a p-value for z, t and chi-square tests.
About P-value Calculator
The p-value is the probability of observing a test statistic as extreme as the one computed — or more extreme — if the null hypothesis is true. A small p-value (typically < 0.05) is evidence against H₀, not proof that H₁ is true. For a z-test the p-value is derived from the standard normal CDF. For a t-test it uses the t-distribution with n−1 degrees of freedom. For a chi-square test (goodness of fit, independence) it uses the upper tail of the chi-square distribution.
Formulas
Two-tailed z p-value
p = 2 × (1 − Φ(|z|))
- Φ
- Standard normal CDF
One-tailed z (right)
p = 1 − Φ(z)
Chi-square p-value
p = upper-tail area of the chi-square distribution
Worked example
With the default values below, P-value Calculator returns P-value of 0.035729. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Test typeone of Z-test, T-test, Chi-square test
- Z-test
- Test statistic
- 2.1
- Degrees of freedomminimum 1
- 20
- Tailone of Two-tailed, Left tail (H₁: μ < μ₀), Right tail (H₁: μ > μ₀)
- Two-tailed
- Significance level αone of 0.10, 0.05, 0.01, 0.001
- 0.05
Results
- P-valueProbability of observing a result this extreme if H₀ is true.
- 0.035729
- Statistically significant?
- Yes
- Conclusion
- Reject H₀ at α = 0.05. The result is statistically significant.
Step by step
- 1Test statistic= 2.1000
- 2P-value computation= 0.035729
- 3Compare to α= Reject H₀ at α = 0.05. The result is statistically significant.
Assumptions and limits
- The result is derived only from the 5 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
What is the difference between a one-tailed and two-tailed test?
A two-tailed test asks 'is the parameter different from the null value in either direction?' and splits α equally between both tails. A one-tailed test asks 'is it specifically larger (or smaller)?' and puts all of α in one tail. One-tailed tests have more power for detecting an effect in the predicted direction but miss effects in the opposite direction.
A p-value of 0.04 means there is a 4 % chance H₀ is true — right?
No, this is a common misconception. The p-value is the probability of data this extreme given H₀ is true, not the probability that H₀ is true. It tells you about the data given the hypothesis, not about the hypothesis given the data.
What degrees of freedom should I use for a chi-square test?
For a goodness-of-fit test with k categories: df = k − 1. For a contingency table with r rows and c columns: df = (r−1)(c−1). For testing a single variance: df = n − 1.
Why is p < 0.05 the conventional threshold?
The 0.05 threshold was proposed by Ronald Fisher in the 1920s as a convenient cut-off, not a universal law. Modern practice increasingly reports exact p-values rather than simply 'significant/not significant'. The threshold should depend on the cost of false positives in your application — medical trials often require p < 0.001.
