How to use the p-value calculator
- Choose the kind of test statistic you have: a z-score, a t-score, or a chi-square statistic.
- Enter the statistic. For t and chi-square, also enter the degrees of freedom.
- For z and t, choose the alternative hypothesis: two-tailed if you are testing for any difference, left- or right-tailed if you predicted a direction before collecting the data. Chi-square tests always use the right tail.
- Read the p-value, whether it is significant at α = 0.05 and α = 0.01, and the critical values for those levels.
How the p-value is calculated
The p-value is the area in the tail (or tails) of the test's distribution beyond your statistic. The calculator computes these areas directly rather than reading them from a table: the normal tail from the complementary error function, the t tail from the regularized incomplete beta function, and the chi-square tail from the regularized incomplete gamma function. Results agree with statistical software to at least 10 significant digits, and very small p-values are shown in scientific notation instead of being rounded to 0. Non-whole degrees of freedom, such as those from Welch's t-test, are accepted.
Worked example
The calculator starts with z = 2.5, two-tailed:
- Area to the right of 2.5 under the normal curve: 0.0062097
- Two-tailed, so double it: p = 2 × 0.0062097 = 0.012419
- 0.012419 is below 0.05, so the result is significant at the 5% level, but it is above 0.01, so it isn't significant at the 1% level
For a t-score of 2.1 with 15 degrees of freedom, two-tailed, p = 0.053055. That is just above 0.05: the critical value for 15 degrees of freedom is ±2.1314, and 2.1 falls short of it. The same 2.1 as a z-score would give p = 0.0357, because the t-distribution's heavier tails need a larger statistic for the same evidence.
For a chi-square of 7.815 with 3 degrees of freedom, p = 0.049994, right on the 5% boundary.
Critical values
| Test | α = 0.05 | α = 0.01 |
|---|---|---|
| z, two-tailed | ±1.960 | ±2.576 |
| z, one-tailed | 1.645 | 2.326 |
| t, df = 10, two-tailed | ±2.228 | ±3.169 |
| t, df = 30, two-tailed | ±2.042 | ±2.750 |
| χ², df = 1 | 3.841 | 6.635 |
| χ², df = 3 | 7.815 | 11.345 |
If your statistic is further from zero than the critical value, the p-value is smaller than α.
Reading a p-value correctly
A p-value answers one question: if there were really no effect, how often would you see data at least this extreme? A p-value of 0.012 means about 1.2% of the time. It is not the chance that the null hypothesis is true, and it doesn't measure how big or important an effect is. A tiny difference can have a very small p-value in a huge sample, and a large, important difference can miss significance in a small one. Report the effect size and a confidence interval alongside the p-value.
Choose one-tailed or two-tailed before you look at the data. Switching to one-tailed after seeing which way the result went halves the p-value without adding any evidence.
Frequently asked questions
What is a good p-value?
There is no universally good value; it is compared with a significance level chosen in advance, usually 0.05. A p-value at or below 0.05 is called statistically significant. Some fields use stricter levels, such as 0.01, or 0.005 for new discoveries.
How do I find the degrees of freedom?
For a one-sample t-test, it is the sample size minus 1. For a two-sample t-test with equal variances, it is n₁ + n₂ − 2. For a chi-square test of independence, multiply (rows − 1) by (columns − 1); for a goodness-of-fit test, it is the number of categories minus 1.
Why is my two-tailed p-value twice the one-tailed value?
A two-tailed test counts extreme results in both directions, so it adds the matching area in the opposite tail. For symmetric distributions like z and t, that area is the same size, so the p-value doubles.
Can a p-value be exactly 0?
No. Any result is possible in theory, so the p-value is always above 0, though it can be extremely small. Software that shows "0.000" has only rounded it. This calculator shows small values in scientific notation, such as 5.733e-7 for a two-tailed z = 5.
Related calculators
- Z-Score Calculator — The z-score and percentile of a value, the probability between two values, and the value at any percentile.
- Confidence Interval Calculator — Confidence interval and margin of error for a mean (t or z) or a proportion, at any confidence level.
- Statistics Calculator — Descriptive statistics for a list: mean, median, mode, quartiles, IQR, outliers, variance, SD and skewness.
- Sample Size Calculator — How many survey responses you need for a given confidence level and margin of error, or the margin for your sample.
Results are calculated in your browser. Double-check anything important before you rely on it. See our disclaimer.