P-Value Calculator
Compute a p-value from a test statistic in seconds — choose Z, t, χ², or F, then pick one-tailed or two-tailed. Includes optional step-by-step and a shaded-curve visualization.
Background
A p-value is the probability of seeing a test statistic at least as extreme as your observed value if the null hypothesis (H₀) is true. Smaller p-values mean stronger evidence against H₀.
How to use this calculator
- Choose the distribution (Z, t, χ², or F).
- Pick the tail based on your alternative hypothesis (H₁).
- Enter your test statistic (and degrees of freedom if needed).
- Click Calculate to get the p-value and shaded area.
How this calculator works
- Z / t: uses the CDF to compute tail area(s) under the curve.
- Two-tailed (Z/t): p = 2·min(P(X≤x), P(X≥x)).
- χ² / F: typically right-tailed, p = P(X≥x) = 1 − CDF(x).
- Functions are computed with stable approximations (error function, incomplete gamma/beta).
Formula & Equation Used
Right-tailed: p = P(X ≥ x) = 1 − F(x)
Left-tailed: p = P(X ≤ x) = F(x)
Two-tailed (Z/t): p = 2·min(F(x), 1 − F(x))
Example Problems & Step-by-Step Solutions
Example 1 — Z, two-tailed
z = −1.96
- Compute CDF: F(z) = P(Z ≤ −1.96) ≈ 0.025.
- Two-tailed p = 2·min(F, 1−F) = 2·0.025 = 0.05.
Example 2 — t, right-tailed
t = 2.13, df = 18
- Compute F(t) = P(T ≤ 2.13) from the t CDF.
- Right-tail p = 1 − F(t).
Example 3 — χ², right-tailed
χ² = 10.83, df = 4
- Compute F(χ²) = P(Χ² ≤ 10.83).
- Right-tail p = 1 − F(χ²).
Example 4 — F, right-tailed
F = 3.21, df₁ = 2, df₂ = 15
- Compute F(F) = P(F ≤ 3.21) using the F CDF.
- Right-tail p = 1 − F(F).
Frequently Asked Questions
Q: What does a p-value mean?
It’s the probability of getting results at least as extreme as yours if the null hypothesis is true.
Q: Which tail do I choose?
Choose based on H₁: ≠ (two-tailed), > (right-tailed), or < (left-tailed).
Q: Why are χ² and F usually right-tailed?
Those test statistics are typically nonnegative and “extreme” values are large values.
Q: If p = 0.03, is it “significant”?
At α = 0.05, yes (0.03 < 0.05). But significance depends on your chosen α and context.
Q: Can p-value be 0?
Not exactly — it can be extremely small. The calculator will show p < 0.0001 for tiny values.