What this calculator does
Turn your test result into a p-value, and see whether it counts as significant. A statistical test boils your data down to one number, called the test statistic. The p-value tells you how surprising that number would be if nothing real were going on. That "nothing is going on" idea is called the null hypothesis. A small p-value means your data would be unusual if the null hypothesis were true. A large one means your data fit it comfortably.
This calculator works with the three most common distributions, the curves a test statistic is measured against. They are the standard normal (z), Student's t and chi-square. For t and chi-square, any degrees of freedom work (a count tied to your sample size). It handles two-tailed and one-tailed tests. It also compares your p-value with the significance level you choose.
Where it's used
Why this math matters outside the classroom:
- Website tests. A website team testing two button colors calls the difference significant when the p-value falls below a preset 0.05.
- Fair coins. A z statistic of 2.5 from a coin-flip test gives a two-tailed p-value of about 0.012.
- Genetics labs. Biology students use a chi-square p-value to check whether pea plant counts fit the 3:1 ratio Mendel predicted.
- Fill weights. A factory testing whether mean fill weight differs from 500 g gets t = 2.1 with 24 degrees of freedom, a two-tailed p of about 0.046.
- Chi-square cutoffs. A chi-square statistic of 3.84 on 1 degree of freedom gives p ≈ 0.05, right at the usual cutoff.
How to use it
- Choose the distribution your test statistic follows. Use z for large-sample tests or when the standard deviation (the typical spread) is known. Use t when the standard deviation is estimated from your data. Use chi-square for goodness-of-fit and contingency-table (two-way table) tests.
- Enter the test statistic. For t and chi-square, also enter the degrees of freedom.
- For z and t, pick the alternative hypothesis, the effect you're looking for: two-tailed (different from), left-tailed (less than) or right-tailed (greater than).
- Set the significance level α (alpha), then read the p-value and the decision.
What the inputs mean
- Alternative hypothesis
- Choose the direction before you look at the data. A one-tailed test halves the p-value when the result goes the way you predicted. So picking it after seeing the data makes the evidence look stronger than it is.
- Degrees of freedom
- Degrees of freedom depend on your sample size and the test. For a one-sample t test, it's n − 1, where n is the number of data points. For a chi-square test of independence, it's (rows − 1) × (columns − 1). Welch's t test gives fractional degrees of freedom, and those are accepted.
- Significance level (α)
- The cutoff you set ahead of time for calling a result significant. It doesn't change the p-value, only the decision.
Formula and method
Two-tailed: p = 2 × P(Z > |z|) or 2 × P(T > |t|) Right-tailed: p = P(Z > z) or P(T > t) Left-tailed: p = P(Z < z) or P(T < t) Chi-square (right tail): p = P(χ² > x) = 1 − P(χ² ≤ x) Decision: reject H₀ if p ≤ α
In the formulas, z, t and x are your test statistic, and Z, T and χ² (chi-square) stand for the matching distribution. P( ) means "the probability that", and |z| means z without its minus sign. H₀ is the null hypothesis, and α is your significance level.
Each p-value is a tail area: the area under the distribution's curve beyond your statistic. In a two-tailed test, a result just as extreme in either direction counts. So the area in one tail is doubled.
A chi-square statistic adds up squared differences, so it can't be negative. Only large values count as evidence against the null hypothesis, which is why the test uses the right tail.
Areas under the normal curve use a very precise approximation formula. Areas for t and chi-square use standard math functions built for this (the regularized incomplete beta and gamma functions).
Worked example
A z test gives z = 1.96 with a two-sided alternative. Is the result significant at α = 0.05?
- One tail: P(Z > 1.96) ≈ 0.0249979.
- Two tails: 2 × 0.0249979 ≈ 0.0499958.
- Compare: 0.0499958 ≤ 0.05, so the result is just significant.
- For comparison, a t statistic of 2.228 with 10 degrees of freedom gives a two-tailed p of about 0.05. A chi-square of 3.841 with 1 degree of freedom also gives about 0.05.
Result: p ≈ 0.0499958, just below 0.05, so H₀ is rejected at the 5% level.
Understanding the result
The p-value is the chance of getting a test statistic at least as extreme as yours, if the null hypothesis were true. It is not the chance that the null hypothesis is true. And 1 − p is not the chance that your alternative is true.
A small p-value says your data are hard to explain by chance alone, if the null hypothesis holds. It says nothing about how large or important the effect is. For that, look at the effect size and a confidence interval.
A large p-value doesn't prove the null hypothesis is true. It may just mean the sample was too small to spot a real effect.
Assumptions and limitations
- Your test statistic really follows the chosen distribution when the null hypothesis is true. That depends on the test's own assumptions. Usually the observations must be independent. For t tests, the data should be roughly normal or the sample reasonably large.
- z-based p-values for proportions and other large-sample tests rely on the normal curve as an approximation. That can be poor for small samples.
- Chi-square tests usually need expected counts of about 5 or more in each cell for the chi-square approximation to hold.
- You chose the tail direction and α before looking at the data.
- The calculator turns a statistic you already have into a p-value. It doesn't work out the statistic from raw data.
- F and other distributions are not included, and chi-square is right-tailed only.
- Extremely small p-values (below about 1e-15 for chi-square) are shown as 0. They're smaller than a computer's standard (double-precision) numbers can hold.
- Running many tests and reporting only the significant ones produces more false positives. No multiple-comparison correction is applied.
Frequently asked questions
Is p = 0.05 a magic cutoff?
No. It's just a convention. A p of 0.049 and one of 0.051 carry almost the same evidence. Report the exact p-value, along with an effect size and confidence interval, rather than just "significant" or "not significant".
Should I use a one-tailed or two-tailed test?
Use two-tailed, unless you had a firm reason before collecting data to care about only one direction. That means you'd treat a result in the other direction as no effect. Two-tailed tests are the safer default, and most reports expect them.
When should I use t instead of z?
Use t when the standard deviation was estimated from your sample, as in most tests of means (averages). Use z when the standard deviation is known, or for large-sample tests of proportions. With many degrees of freedom, the two give almost the same p-value.
Does a p-value of 0.03 mean there is a 3% chance the null hypothesis is true?
No. It means that if the null hypothesis were true, a result at least this extreme would happen about 3% of the time. The chance that the hypothesis itself is true depends on other information, such as how believable it was to begin with.
How this calculator is checked
Method: Tail areas of the standard normal, Student t and chi-square distributions from the shared distributions module (normal CDF approximation; regularized incomplete beta for t; regularized incomplete gamma for chi-square). The calculation is covered by automated tests with known reference values and edge cases. Last updated 2026-10-18. Found a problem? Tell us.
Embed this calculator
Put this P-Value Calculator on your own website or blog for free. Paste this code where you want it to appear: