Solved.tools: Free Online Calculators & Tools

We use cookies for analytics and advertising. Learn more about our cookie policy

P-Value Calculator

Last updated: 27 June 2026

Reviewed by Gavin Meiring, Lead research and primary author ยท Doctoral Candidate (Corporate Governance) ยท Research and drafting assisted by AI

Was this helpful?


P-Value Calculator

A p-value calculator computes the probability of observing a test statistic as extreme as the one calculated from your sample data, assuming the null hypothesis is true. It is an essential tool for researchers, students, and data analysts performing hypothesis tests in statistics, medicine, psychology, and social science.

How to Use the P-Value Calculator

  1. Select your test type: one-sample z-test, one-sample t-test, two-sample t-test, chi-squared test, or F-test.
  2. Enter your test statistic (z, t, chi-squared, or F value) and, for t-tests, the degrees of freedom.
  3. Select whether your test is one-tailed or two-tailed.
  4. Click Calculate to see the p-value and the corresponding area under the distribution curve.
  5. Compare the p-value to your chosen significance level (commonly 0.05) to make a decision about the null hypothesis.

The Formula

The p-value is the area in the tail (or tails) of the relevant probability distribution beyond your observed test statistic.

For a z-test: p = P(Z > |z|) for a one-tailed test, or 2 x P(Z > |z|) for a two-tailed test, where Z follows the standard normal distribution.

For a t-test: replace Z with T following the t-distribution with the appropriate degrees of freedom.

The significance level alpha (commonly 0.05) is the threshold below which you reject the null hypothesis.

Decision rule: if p < alpha, reject the null hypothesis. If p >= alpha, fail to reject the null hypothesis.

Real-World Example

A researcher claims a new training method improves test scores. A sample of 25 students using the new method has a mean score of 76 with a standard deviation of 10. The historical mean is 71.

t = (x_bar - mu) / (s / sqrt(n)) = (76 - 71) / (10 / sqrt(25)) = 5 / 2 = 2.5

Degrees of freedom = n - 1 = 24.

For a one-tailed t-test with t = 2.5 and df = 24, the p-value is approximately 0.0099.

Since 0.0099 < 0.05, we reject the null hypothesis. The result is statistically significant; the new method appears to improve scores.

Interpreting P-Values Correctly

The p-value is one of the most misunderstood statistics in research. It is not the probability that the null hypothesis is true, nor is it the probability that your result occurred by chance. It is specifically the probability of obtaining your result (or a more extreme one) if the null hypothesis were true. A small p-value (below alpha) means your data is unlikely under the null hypothesis, providing evidence against it. A large p-value does not prove the null hypothesis; it simply means there is insufficient evidence to reject it. P-values are sensitive to sample size: with very large samples, even trivially small differences become statistically significant. This is why researchers increasingly report effect sizes (such as Cohen's d) alongside p-values, to indicate whether a statistically significant result is also practically meaningful.

Frequently Asked Questions

What does a p-value of 0.05 actually mean? A p-value of 0.05 means that if the null hypothesis were true, you would expect to see a result as extreme as yours about 5% of the time purely by chance. By convention, this threshold (alpha = 0.05) was proposed by Ronald Fisher in the 1920s. It is widely used but not sacred: some fields use 0.01, and some exploratory research uses 0.10. The threshold should be chosen before the analysis, not after.

What is the difference between one-tailed and two-tailed tests? A one-tailed test examines the effect in one direction only (for example, does the new drug increase response time?). A two-tailed test examines both directions (does it change response time at all?). Two-tailed tests are more conservative and are the default in most research contexts. Use a one-tailed test only when you have a strong theoretical reason to predict the direction of the effect before collecting data.

What are degrees of freedom? Degrees of freedom (df) is the number of independent values that can vary in an analysis. For a one-sample t-test with n observations, df = n - 1. For a two-sample t-test, df is approximately n1 + n2 - 2. Degrees of freedom determine the exact shape of the t-distribution: with more df, the t-distribution approaches the normal distribution.

Can a p-value be exactly zero? In theory, no. A p-value of exactly zero would mean the observed data is impossible under the null hypothesis. In practice, computers report p < 0.0001 or similar when the value is extremely small but not literally zero. Very small p-values arise with large sample sizes or very large effect sizes, and they provide very strong evidence against the null hypothesis.

The page's own test, worked through both tails

The training example above uses a one-sample t-test with t = 2.5 and 24 degrees of freedom. Evaluating the t-distribution at that point gives a one-tailed p of 0.009827, which the page rounds to 0.0099. The same statistic in a two-tailed test doubles the tail area and gives 0.019654, still below the 0.05 threshold.

That step matters more than it looks. The sample of 25 students was tested for an improvement in one direction, so a one-tailed test is defensible. Had the researcher been open to the method making scores worse as well as better, the two-tailed figure of 0.0197 would be the one to report. The conclusion does not change here, but the margin does: 0.0099 sits far below the threshold while 0.0197 sits much closer to it, and a slightly weaker result would have crossed the line under the two-tailed test only.

TestTail areap-valueDecision at alpha 0.05
One-tailed, t = 2.5, df = 24single tail0.009827reject the null
Two-tailed, t = 2.5, df = 24both tails0.019654reject the null

Critical values to compare a result against

A p-value answers the question directly, but many published tables give critical values instead. These are the t values at 24 degrees of freedom that produce each common threshold. A result larger than the critical value falls below that alpha.

One-tailed alphaTwo-tailed alphaCritical t at df 24
0.100.201.3178
0.050.101.7109
0.0250.052.0639
0.010.022.4922
0.0050.012.7969
0.0010.0023.4668

Read the row that matters to your test. At df 24 a one-tailed test at alpha 0.05 needs t above 1.7109; the equivalent two-tailed test at alpha 0.05 needs t above 2.0639. The gap between those two numbers, 0.353, is the price of allowing for an effect in either direction.

The same values shift as the sample grows and the t-distribution narrows towards the normal.

Degrees of freedomCritical t, one-tailed 0.05Critical t, two-tailed 0.05
91.83312.2622
241.71092.0639
991.66041.9842
9991.64641.9623

For a z-test, where degrees of freedom do not enter, the critical values are 1.2816 for a one-tailed test at 0.10, 1.6449 at 0.05, 1.9600 at 0.025, 2.3263 at 0.01 and 3.0902 at 0.001. A two-tailed test at alpha 0.05 uses 1.9600. With large samples the t critical value converges on these numbers, which is why the two tables agree to within a few hundredths by the time df reaches 999.

How sample size moves the p-value at a fixed effect

This is the property that produces the most misreading of p-values. The table below holds the effect exactly as the page's example measures it, at a standardised size that gives t = 2.5 on 25 observations, and re-runs the test as the sample grows. The effect itself does not change.

Sample sizeDegrees of freedomtOne-tailed pTwo-tailed p
25242.50000.0098270.019654
50493.53550.0004500.000900
100995.00000.000001240.00000248
40039910.00001.854e-213.707e-21
1,6001,59920.00006.672e-801.334e-79

The t statistic scales with the square root of the sample size, so quadrupling the sample doubles it. The p-value falls far faster than the effect grows. An effect that only just clears the threshold on 25 observations is overwhelming on 1,600, and the same arithmetic runs in reverse: an effect that is real but small can stay hidden in a small sample. Reporting the effect size next to the p-value is what stops that from being misread, because the effect size does not move when the sample grows.

A second example, two independent samples

The one-sample test compares a sample mean against a known value. A two-sample test compares two groups. Take two classes of 30 students, the first taught by the new method with a mean of 68.4 and a standard deviation of 9.2, the second taught by the old method with a mean of 64.1 and a standard deviation of 10.6.

The pooled standard deviation is 9.9247, which combines the two spreads by their degrees of freedom. The standard error of the difference in means is 9.9247 times the square root of one thirtieth plus one thirtieth, giving 2.5626. The difference in means is 4.3, so t is 4.3 divided by 2.5626, which is 1.6780, on 58 degrees of freedom.

QuantityValue
Mean, new method68.4
Mean, old method64.1
Difference4.3
Pooled standard deviation9.9247
Standard error of the difference2.5626
t statistic1.6780
Degrees of freedom58
One-tailed p0.049363
Two-tailed p0.098725

The two-tailed p of 0.0987 fails the 0.05 threshold. The one-tailed p of 0.0494 passes it, barely. A researcher who chose the two-tailed test before collecting data has a null result on their hands and should report it as one, with the effect size and the confidence interval, rather than reaching for the one-tailed figure afterwards.

A chi-squared check on count data

The page's calculator covers count tests as well. For a chi-squared statistic on a single degree of freedom, the tail area is 0.050014 at 3.841, 0.025056 at 5.020, 0.009999 at 6.635 and 0.001000 at 10.828. The first three are the familiar 0.05, 0.025 and 0.01 thresholds to three decimal places, which is where the textbook table values come from. A 2x2 contingency table with a chi-squared of 5.02 therefore returns p = 0.0251 on one degree of freedom.

Chi-squaredDegrees of freedomp-value
3.84110.050014
5.02010.025056
6.63510.009999
10.82810.001000

What the p-value assumes

The test you pick carries its own assumptions, and the p-value is only as sound as they are.

  1. The observations within each group are independent of one another. Repeated measures on the same subject break this.
  2. The t-test assumes the data are roughly normally distributed, or that the sample is large enough for the central limit theorem to carry the mean.
  3. The two-sample t-test above uses the pooled variance form, which assumes both groups share a common variance. Where the spreads differ sharply, a Welch test with a corrected degrees of freedom is the safer choice.
  4. The chi-squared test on a single degree of freedom assumes the expected count in each cell is at least about five. Smaller expected counts need an exact test.
  5. The p-value assumes the test was specified before the data were seen. Trying several tests and reporting the smallest p is not a p-value at all.

The calculator does the arithmetic for the distribution you select. The assumptions are yours to check.


Also try these free tools: