p-value Calculator

Calculate p-values from z, t, chi-square, or F test statistics. One-tail and two-tail options with significance interpretation at common alpha levels.

A p-value is the probability, assuming the null hypothesis is true, of obtaining a test statistic at least as extreme as the one observed. This calculator converts z, t, chi-square, and F statistics into exact p-values for one-tailed or two-tailed alternatives, then compares the result to standard alpha cut-offs (0.10, 0.05, 0.01, 0.001) used across the sciences.

Ad
Ad

About p-value Calculator

How the p-value Is Calculated

The p-value is the tail-area of the reference sampling distribution beyond the observed statistic. For a two-tailed test it is 2 × min(left-tail, right-tail); for a one-tailed test it is whichever single tail the alternative hypothesis specifies. The formulas used here follow the definitions in the NIST/SEMATECH Engineering Statistics Handbook.

Worked example (two-tailed z-test). A coin is flipped 100 times and lands heads 62 times. Under the null hypothesis p = 0.5, the expected count is 50 with standard deviation √(100 × 0.5 × 0.5) = 5. The test statistic is z = (62 - 50) / 5 = 2.40. The right-tail area for z = 2.40 under the standard normal is 0.00820; doubling gives a two-tailed p-value of 0.01640. Because 0.0164 < 0.05, the null hypothesis is rejected at the 5% level but not at the 1% level (since 0.0164 > 0.01).

Under the hood the calculator uses the Abramowitz-Stegun 5-term approximation for the normal CDF (accurate to about 7 decimal places) and the regularised incomplete beta and gamma functions via continued fractions for the t, chi-square, and F distributions. These are the same numerical recipes used by R's pt(), pchisq(), and pf() internals.

Interpreting p-values at Different Alpha Levels

Smaller p-values indicate data that would be more surprising under the null hypothesis. The five-band convention below originated with Fisher (1925) and is the labelling used in most scientific journals today.

p-value RangeStrength of EvidenceCommon Notation
p > 0.10No evidence against null hypothesisns (not significant)
0.05 < p ≤ 0.10Weak evidence. (marginal)
0.01 < p ≤ 0.05Moderate evidence* (significant)
0.001 < p ≤ 0.01Strong evidence** (very significant)
p ≤ 0.001Very strong evidence*** (highly significant)

Different fields adopt stricter or looser thresholds. Particle physics requires 5σ (p ≈ 2.87 × 10-7) to claim discovery - the standard used for the 2012 Higgs boson announcement at CERN. Genome-wide association studies typically use 5 × 10-8 to control for multiple testing across ~1 million independent loci. Clinical trials often pre-register at 0.025 (one-sided) per FDA statistical guidance. A high-profile 2018 proposal by Benjamin and 71 co-authors in Nature Human Behaviour argued that new discoveries in social and biomedical sciences should be held to 0.005 rather than 0.05.

Which Test Statistic Should I Use?

The test statistic is chosen by what is known about the population and what kind of data is being analysed. The four distributions covered here account for the overwhelming majority of classical frequentist tests in introductory and applied statistics.

TestStatisticWhen to UseParameters Needed
Z-testzLarge sample (n > 30), known population σ, or proportion testsNone (standard normal)
T-testtSmall sample, unknown population σ (one-sample, two-sample, paired)Degrees of freedom (usually n - 1 or n₁ + n₂ - 2)
Chi-squareχ²Categorical data: goodness of fit, independence in contingency tables, variance testsDegrees of freedom
F-testFComparing two variances, one-way and multi-way ANOVA, regression overall Fdf₁ (numerator), df₂ (denominator)

As the t-distribution's degrees of freedom grow it converges to the standard normal - the two agree to three decimal places once df exceeds about 30, which is where the heuristic "n > 30 => use z" comes from. A common beginner mistake is using z with a small sample because the population standard deviation feels "known"; when σ is actually the sample SD, the sampling distribution has heavier tails and the t-distribution gives the correct p-value. For proportions, continuity correction (Yates) is usually not needed for n > 30 per cell but matters in small 2x2 tables.

One-Tailed vs Two-Tailed Tests

Choose one-tailed only when the scientific question is genuinely directional and an effect in the opposite direction would be treated the same as no effect. Most published research uses two-tailed tests because the cost of missing an unexpected reversal is usually higher than the gain in power.

One-TailedTwo-Tailed
HypothesisDirectional (greater than OR less than)Non-directional (different from)
p-valueArea in one tailArea in both tails (2 × one-tail)
PowerMore powerful for the predicted directionLess powerful but catches effects in either direction
Critical z at α = 0.051.645±1.960
When to usePre-registered directional predictionAny difference from the null is scientifically relevant
Example"Drug A lowers blood pressure""Drug A changes blood pressure"

Important. The direction must be declared before seeing the data. Switching from two-tailed to one-tailed after looking at the results is a form of p-hacking and doubles the real Type I error rate. FDA guidance for confirmatory clinical trials specifies that one-sided testing at 0.025 is equivalent in false-positive terms to two-sided at 0.05.

Common p-value Misconceptions

The American Statistical Association's 2016 statement on p-values (Wasserstein & Lazar, The American Statistician) listed six principles after polling dozens of statisticians. Three of the most persistent errors it called out are summarised below alongside the correct interpretation.

Wrong interpretationCorrect interpretation
"p = 0.03 means there's a 3% chance the null is true"p is the probability of the data (or more extreme) given the null - not the probability of the null given the data. Computing the latter requires Bayes' theorem and a prior.
"p = 0.04 is more significant than p = 0.03"Both are significant at α = 0.05. The exact p-value is not a measure of effect size - report effect size and a confidence interval alongside p.
"p > 0.05 means there is no effect"It means the study failed to detect an effect at the chosen alpha. A high p-value can reflect low power, small sample size, or a true null.
"Statistical significance = practical importance"With samples in the tens of thousands, trivially small effects become statistically significant. Always check whether the effect size is clinically or economically meaningful.
"Non-significant results should not be published"Publication bias in favour of p < 0.05 distorts meta-analyses. Registered reports and the Open Science Framework encourage publishing regardless of outcome.

Type I and Type II Errors

Every hypothesis test has four possible outcomes depending on the truth of the null hypothesis and the decision made. The significance level α controls Type I errors; the probability of a Type II error is denoted β, and statistical power is 1 - β.

Null is actually trueNull is actually false
Reject nullType I error (false positive) - probability = αCorrect decision (power = 1 - β)
Fail to reject nullCorrect decision (probability 1 - α)Type II error (false negative) - probability = β

Cohen (1988) proposed 0.80 as a reasonable minimum for power in social science research, meaning researchers accept a 20% chance of missing a real effect of the size they care about. Medical trials increasingly target 0.90 power. The sample size calculator inverts the relationship to compute how many observations are needed for a target power given the effect size and alpha.

Example p-values for Common Test Statistics

These reference values can be used to sanity-check calculator output and to memorise the critical statistics that cross the 0.05 and 0.01 boundaries.

TestStatisticdfTwo-tailed pSignificant at 0.05?
z-testz = 1.96-0.0500Borderline
z-testz = 2.58-0.0099Yes (also at 0.01)
t-testt = 2.10200.0486Yes
t-testt = 3.50100.0057Yes (also at 0.01)
Chi-squareχ² = 7.8130.0495 (upper tail)Borderline
F-testF = 4.262, 270.0245 (upper tail)Yes

Reporting p-values in Practice

The APA Publication Manual (7th edition) recommends reporting exact p-values to two or three decimal places (e.g. p = 0.023) rather than just p < 0.05, except when the p-value is extremely small, in which case p < 0.001 is preferred. Never report p = 0.000 - that is a rounding artefact, not a true zero probability. For test statistics, include the degrees of freedom: t(24) = 2.31, p = 0.030 or F(2, 47) = 5.12, p = 0.010. Report effect size (Cohen's d, η², r) alongside every p-value so readers can assess practical significance.

For computing a z-score from a raw observation before feeding it into this tool, the z-score calculator handles standardisation. To turn a p-value into a confidence interval around the estimate, see the confidence interval calculator; the two are duality of the same Neyman-Pearson framework.

Limitations of Null Hypothesis Significance Testing

The p-value depends on the sample size as well as the effect. A correlation of r = 0.05 is practically meaningless but becomes significant at p < 0.05 once n exceeds about 1,550 - and at p < 0.001 past n ≈ 4,500. This is why modern best practice (ASA 2016, Nature 2019 manifesto signed by over 800 scientists) is to report p-values alongside confidence intervals and pre-specified effect-size thresholds rather than using p < 0.05 as a binary gatekeeper. Bayesian alternatives (Bayes factors, posterior probabilities) are gaining ground in fields like cognitive science and ecology but require prior specification that classical frequentist testing deliberately avoids.

All calculations run in your browser. No data is sent to any server.

Sources

Frequently Asked Questions

What is a p-value?

A p-value is the probability of getting a test statistic as extreme as (or more extreme than) the one you observed, assuming the null hypothesis is true. A small p-value suggests the observed data is unlikely under the null hypothesis.

What does it mean to reject the null hypothesis?

When the p-value is less than your chosen significance level (alpha), you reject the null hypothesis. This means the evidence is strong enough to conclude that the effect or difference you observed is statistically significant.

What is the difference between one-tailed and two-tailed tests?

A one-tailed test checks for an effect in a specific direction (greater than or less than). A two-tailed test checks for any difference, regardless of direction. Two-tailed tests are more conservative and more commonly used.

Why is 0.05 used as the significance level?

The 0.05 level is a convention, meaning a 5% chance of rejecting a true null hypothesis (Type I error). It is widely used but not universal. Medical studies often use 0.01, while exploratory research may use 0.10.

Which test statistic should I use?

Use z for large samples with known population standard deviation or proportions. Use t for small samples or unknown population standard deviation. Chi-square is for categorical data and goodness of fit. F is for comparing variances or ANOVA.

Link to this tool

Copy this HTML to link to this tool from your website or blog.

<a href="https://toolboxkit.io/tools/p-value-calculator/" title="p-value Calculator - Free Online Tool">Try p-value Calculator on ToolboxKit.io</a>