BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)
Calculator algorithm last reviewed and verified: September 2026

P-Value Calculator: Compute Significance for Z, T & Chi-Square Tests

This p-value calculator converts a Z-score, t-score, or chi-square statistic into an exact probability value. Enter your test type, test statistic, tail direction, and significance level (alpha) to see the p-value, a significance decision, and an interactive distribution curve showing the tail area. All calculations run locally in your browser with no data sent to any server.

P-Value Calculator

Distribution Standard Normal N(0,1) Use when n ≥ 30 or σ known
Negative values allowed for left-tailed tests
Distribution Student's t(df) Use when σ unknown, any n
One-sample: df = n - 1. Two-sample: df = n1 + n2 - 2
Distribution Chi-Square χ²(df) Always Right-tailed (χ² ≥ 0)
Must be ≥ 0
Goodness-of-fit: df = k - 1. Independence: df = (r-1)(c-1)

Editorial Note: This calculator uses standard statistical distribution functions (Normal, Student's t, and Chi-Square) to compute exact p-values for educational, research, and analytical purposes. All computation runs locally in your browser. For critical clinical or financial research, verify findings using certified software such as R or Python SciPy.

What Is a P-Value?

A p-value (probability value) is the probability of observing a test statistic at least as extreme as the one calculated from your sample data, given that the null hypothesis is true. It does not tell you the probability that your hypothesis is correct. What it measures is how surprising your data would be if nothing were actually happening in the population.

When you run a hypothesis test, you compute a test statistic from your data and then ask: "If the null hypothesis were true, how often would random chance produce a result this extreme or more?" That frequency is the p-value. A small p-value means your result would be rare under the null hypothesis, which is taken as evidence against it.

The standard decision rule: if p < α (your chosen significance level), reject the null hypothesis. If p ≥ α, you fail to reject it. Failing to reject is not the same as accepting it; it simply means the data do not provide enough evidence to rule it out.

Direct answer: A p-value calculator takes a test statistic (Z, t, or χ²) and returns the probability of obtaining that result by chance under the null hypothesis. Enter your statistic, tail direction, and alpha level. If the resulting p-value falls below alpha, the result is statistically significant and the null hypothesis is rejected.

How to Use This P-Value Calculator

1
Select your test type

Choose Z-test for large samples or known population variance, T-test for small samples with unknown variance, or Chi-Square for categorical data analysis.

2
Enter the test statistic

Type your calculated Z-score, t-score, or chi-square value. For t-tests and chi-square tests, also enter the degrees of freedom.

3
Set the tail direction

Choose two-tailed for non-directional hypotheses (is there any difference?) or one-tailed when testing a specific direction (is treatment A better than B?). Chi-square tests are always right-tailed.

4
Choose your significance level (α)

The default is 0.05. Adjust to 0.01 for stricter standards (medical research) or 0.10 for exploratory analysis. The calculator compares your p-value to this threshold.

5
Read the results

The calculator returns the exact p-value, a significance badge, the critical value for your chosen alpha, and an interactive distribution curve with the tail area shaded.

How to Calculate a P-Value from a Z-Score

Z-tests apply when the population standard deviation (σ) is known or when the sample size is large enough (generally n ≥ 30) that the sample standard deviation is a reliable estimate. The test statistic follows a standard normal distribution with mean 0 and standard deviation 1.

The Three Tail Options

Right-tailed

p = 1 - Φ(z)

Tests whether the mean is greater than a reference value.

Left-tailed

p = Φ(z)

Tests whether the mean is less than a reference value.

Two-tailed

p = 2 × (1 - Φ(|z|))

Tests for any difference in either direction.

CDF approximation

Φ(z) = (1 + erf(z/√2)) / 2

Where erf is the error function (computed via Abramowitz & Stegun series).

Converting a raw measurement to a Z-score first requires knowing the population mean (μ) and standard deviation (σ): Z = (x - μ) / (σ / √n). The resulting Z-score is dimensionless and can be fed directly into the standard normal CDF. Learn more about Z-scores.

How to Calculate a P-Value from a T-Score

Student's t-test is the right tool when the population standard deviation is unknown, which describes most real-world experiments. The t-distribution is similar to the normal distribution but has heavier tails, reflecting additional uncertainty from estimating σ from sample data. As degrees of freedom increase, the t-distribution converges to the standard normal.

Degrees of Freedom by Test Type

Test TypeFormulaNotes
One-sample t-testdf = n - 1Comparing sample mean to a known value
Independent two-sample t-testdf = n1 + n2 - 2Equal variances assumed (pooled)
Welch's t-testSatterthwaite dfUnequal variances; more conservative
Paired samples t-testdf = n - 1n = number of pairs

The p-value from a t-score uses the incomplete beta function for exact computation. This calculator implements a continued-fraction approximation that is accurate to machine precision for all realistic df values. For extremely large df (above 10,000), the t-distribution is practically identical to the standard normal.

How to Calculate a P-Value for Chi-Square Tests

The chi-square (χ²) test measures whether observed categorical frequencies differ from expected ones. Unlike Z and t statistics, a chi-square statistic is always non-negative, so the test is inherently right-tailed: a large χ² value means observed and expected frequencies diverge substantially.

Two Main Applications

Goodness-of-fit test: Tests whether a single categorical variable follows a specified distribution. Degrees of freedom = k - 1, where k is the number of categories. Full chi-square guide.

Test of independence: Tests whether two categorical variables in a contingency table are independent. Degrees of freedom = (rows - 1) × (columns - 1).

Chi-Square Statistic χ² = ∑ (O - E)² / E

where O is the observed frequency and E is the expected frequency for each cell. The p-value is then P(χ²(df) ≥ observed χ²), computed using the regularized incomplete gamma function.

How to Interpret P-Values and Significance Levels (Alpha)

The significance level α is the maximum false-positive rate you are willing to accept before running the test. It is set in advance, not chosen after seeing the data. The decision rule is simple: if p < α, reject the null hypothesis; if p ≥ α, fail to reject it.

p < 0.001
Highly significant
Extremely strong evidence against H0
p < 0.01
Very significant
Strong evidence; standard in many clinical trials
p < 0.05
Significant
Conventional threshold across most sciences
p ≥ 0.05
Not significant
Insufficient evidence to reject H0
Critical reminder: A p-value below 0.05 does not prove your hypothesis is true. It means the observed data would be unlikely under the null. Statistical significance is not the same as practical or economic significance. Always pair p-values with effect size estimates and confidence intervals.

One-Tailed vs. Two-Tailed Hypothesis Tests

The choice between a one-tailed and two-tailed test should be made before collecting data, based on the research question. Switching to one-tailed after seeing results that are "almost significant" two-tailed is a form of p-hacking.

FeatureTwo-TailedOne-Tailed
HypothesisH1: μ ≠ μ0 (any difference)H1: μ > μ0 or H1: μ < μ0
P-value relationshipp = 2 × one-tailed pp = one-tailed p
Statistical power (same n)Lower (split α across two tails)Higher (all α in one tail)
Risk of incorrect directionNone (detects either direction)Miss effects going the wrong way
Typical useMost hypothesis testing; default choicePre-specified directional predictions
Z = 1.96, α = 0.05p = 0.0500 (border of significance)p = 0.0250 (significant right-tail)

Type I and Type II Errors Explained

Every hypothesis test carries two kinds of risk. The significance level (α) directly controls one; the other depends on sample size and effect size.

H0 is Actually TrueH0 is Actually False
Fail to Reject H0Correct decision (1 - α)Type II Error (β)
Reject H0Type I Error (α)Correct decision (Power = 1 - β)

Type I Error (False Positive): Rejecting a true null hypothesis. Its rate equals α. If you set α = 0.05, you accept a 5% chance of a false positive on any single test.

Type II Error (False Negative): Failing to reject a false null hypothesis. Its rate β depends on the true effect size, sample size, and α. Statistical power (1 - β) quantifies the probability of correctly detecting a real effect.

Running many tests without correction raises the family-wise error rate above α. See the Bonferroni correction for multiple comparison adjustments.

Worked Examples: Manual Calculation vs. Calculator

Example 1: Right-Tailed Z-Test (Z = 1.96)

Scenario: A nutritionist claims a new diet program raises average daily protein intake above 120 g. A sample of 49 participants shows a mean of 125 g. Population SD is known as 20 g. Test at α = 0.05.
Step 1 — Calculate the test statistic:
Z = (x̄ - μ0) / (σ / √n) = (125 - 120) / (20 / √49) = 5 / 2.857 = 1.75
Step 2 — Identify the test type:
Right-tailed (testing whether mean is greater than 120).
Step 3 — Compute the p-value:
p = 1 - Φ(1.75) = 1 - 0.9599 = 0.0401
Decision: p = 0.0401 < α = 0.05 → Reject H0. The data support the claim that protein intake increased above 120 g (Z = 1.75, p = 0.040).

Example 2: Two-Tailed T-Test (t = 2.45, df = 24)

Scenario: A researcher tests whether a new drug changes blood pressure. 25 patients are measured before and after treatment. The paired differences yield t = 2.45 with df = 24. Test at α = 0.05.
Step 1 — Identify the distribution:
Student's t-distribution with df = 24 (paired t-test: df = n - 1 = 25 - 1).
Step 2 — Compute the two-tailed p-value:
p = 2 × P(t(24) ≥ 2.45) = 2 × 0.0109 = 0.0218
Step 3 — Compare to critical value:
t*(24, 0.05 two-tailed) = 2.064. Since |2.45| > 2.064, reject H0.
Decision: p = 0.022 < α = 0.05 → Reject H0. The drug produces a statistically significant change in blood pressure, t(24) = 2.45, p = 0.022.

Common Misinterpretations of P-Values

Misreading p-values is one of the most documented problems in applied statistics. These errors appear in peer-reviewed journals and introductory textbooks alike.

Mistaken BeliefWhat It Actually Means
"p = 0.03 means there is a 3% probability the null hypothesis is true." The p-value assumes the null is true. It cannot tell you the probability that any hypothesis is true. That requires a Bayesian framework.
"p > 0.05 proves the null hypothesis." Failing to reject is not the same as accepting. Absence of evidence is not evidence of absence; the test may simply be underpowered.
"A smaller p-value means a larger effect." P-values depend on sample size too. A tiny effect in a large sample can produce p < 0.001. Always report effect sizes.
"p = 0.049 is meaningful; p = 0.051 is not." The 0.05 threshold is a convention, not a law of nature. Results near the boundary should be interpreted cautiously and replicated.
"Statistical significance means practical importance." A drug may lower blood pressure by 1 mmHg with p < 0.001 in a large trial. That is statistically significant but clinically meaningless.

P-Hacking and Data Dredging

P-hacking occurs when researchers run multiple tests and only report the one that achieved p < 0.05. Running 20 independent tests at α = 0.05 gives roughly a 64% chance of getting at least one false positive by chance. Pre-register your hypotheses, set your alpha before seeing data, and apply corrections such as the Bonferroni correction or Benjamini-Hochberg false discovery rate when conducting multiple comparisons simultaneously.

P-Values vs. Confidence Intervals

A 95% confidence interval and a two-tailed test at α = 0.05 give exactly consistent conclusions: if the 95% CI excludes the null hypothesis value, then p < 0.05. But confidence intervals carry more information. They tell you not just whether an effect exists but where the true effect plausibly lies, which is essential for judging practical significance.

A confidence interval showing a blood pressure reduction of (0.2 mmHg, 1.8 mmHg) tells you far more than "p = 0.03" alone. The APA (American Psychological Association) and most major journals now recommend reporting effect sizes and confidence intervals alongside p-values.

Calculating P-Values in Excel, Python, and R

Excel and Google Sheets

=NORM.S.DIST(z, TRUE) ' Left-tail CDF for Z-score =1 - NORM.S.DIST(z, TRUE) ' Right-tail p-value (Z) =2*(1 - NORM.S.DIST(ABS(z), TRUE)) ' Two-tailed p-value (Z) =T.DIST.2T(ABS(t), df) ' Two-tailed p-value (t-test) =T.DIST.RT(t, df) ' Right-tailed p-value (t-test) =T.DIST(t, df, TRUE) ' Left-tail CDF (t-test) =CHISQ.DIST.RT(chi2, df) ' Right-tailed p-value (chi-square)

Python (SciPy)

from scipy import stats # Z-test p-values z = 1.96 p_two = 2 * stats.norm.sf(abs(z)) # two-tailed: 0.04999 p_right = stats.norm.sf(z) # right-tailed: 0.02500 p_left = stats.norm.cdf(z) # left-tailed: 0.97500 # t-test p-values t, df = 2.45, 24 p_two_t = 2 * stats.t.sf(abs(t), df) # two-tailed: 0.02181 # Chi-square p-value chi2, df_chi = 7.815, 3 p_chi = stats.chi2.sf(chi2, df_chi) # right-tailed: 0.04999

R

# Z-test p-values z <- 1.96 p_two <- 2 * pnorm(-abs(z)) # two-tailed: 0.04999 p_right <- pnorm(z, lower.tail = FALSE) # 0.02500 # t-test p-values t <- 2.45; df <- 24 p_two_t <- 2 * pt(-abs(t), df) # two-tailed: 0.02181 # Chi-square p-value chi2 <- 7.815; df_chi <- 3 p_chi <- pchisq(chi2, df_chi, lower.tail = FALSE) # 0.04999

P-Value Thresholds Across Scientific Disciplines

The 0.05 threshold is a convention, not a universal law. Different fields apply different standards reflecting the costs of false positives in that domain.

DisciplineThresholdRationale
Social sciences (general)p < 0.05Conventional standard for most published research
Medical / clinical researchp < 0.05, often p < 0.01Multiple comparison corrections common; patient safety considerations
Genome-wide association studiesp < 5 × 10−8Thousands of simultaneous tests require Bonferroni-like correction
Particle physics (Higgs boson)p < 2.87 × 10−7 (5-sigma)Extraordinary claims require extraordinary evidence
Exploratory / pilot studiesp < 0.10Hypothesis generation rather than confirmation

Evolution of Statistical Hypothesis Testing

EraContributorCore InnovationPractical Impact
1700sBayes, LaplaceBayesian probability and inverse probabilityFoundations for updating beliefs with data
1900Karl PearsonChi-square test and p-value conceptFirst formal significance test for categorical data
1908W.S. Gosset (Student)t-distribution for small samplesMade significance testing practical for limited data
1925Ronald Fisherp = 0.05 threshold; null hypothesis frameworkStandardized significance testing across sciences
1933Neyman and PearsonType I/II errors; power; decision theoryGrounded testing in explicit error rate control
1960s+VariousComputer-based statistical packages (SPSS, SAS)Made complex tests accessible to non-mathematicians
2000s+Open-source communityPython SciPy, R, web calculatorsInstant p-values without lookup tables

Frequently Asked Questions

A p-value calculator converts a test statistic (Z, t, or chi-square) into an exact probability value representing how likely it is to observe results that extreme by chance under the null hypothesis. You supply the test type, statistic value, tail direction, and significance level, and the calculator returns the p-value, a significance decision, and a distribution curve showing the tail area. All computation happens in your browser with no data transmitted externally.

For a right-tailed Z-test, the p-value is 1 - Φ(z), where Φ is the standard normal CDF. For a left-tailed test, p = Φ(z). For a two-tailed test, p = 2 × (1 - Φ(|z|)). For example, Z = 1.96 two-tailed gives p = 2 × (1 - 0.9750) = 0.0500. In Excel, use =2*(1-NORM.S.DIST(ABS(z),TRUE)) for the two-tailed value.

A p-value of exactly 0.05 means that, if the null hypothesis were true, you would observe results as extreme as those in your sample 5% of the time by chance. At a significance level of α = 0.05, p = 0.05 is not strictly less than alpha, so the null hypothesis is not rejected (though results are on the boundary). Conventionally, p < 0.05 (not p ≤ 0.05) is required for statistical significance.

A one-tailed p-value tests whether an effect exists in one specific direction (greater than or less than). A two-tailed p-value tests for any difference in either direction. For the same test statistic, the two-tailed p-value is exactly twice the one-tailed p-value. Two-tailed tests are the standard conservative approach and should be used unless you have a strong prior directional hypothesis registered before data collection.

No. A p-value is a probability and must fall between 0 and 1 inclusive. A value above 1 indicates a calculation error, typically from an incorrect formula or a chi-square statistic below the mean of its distribution. P-values very close to 0 indicate strong evidence against the null hypothesis, while values near 1 mean the observed data are highly consistent with the null.

Degrees of freedom (df) determine the shape of the t-distribution. For a one-sample t-test, df = n - 1. For an independent two-sample t-test with equal variances, df = n1 + n2 - 2. For a paired t-test, df = n - 1 where n is the number of pairs. As df increases, the t-distribution becomes closer to the standard normal. With df above ~30, the difference is minimal for most practical purposes. See the degrees of freedom guide for details.

Statistical Methodology and Formulas

This calculator uses the following numerical methods, validated against standard statistical tables and SciPy reference outputs.

TestCDF MethodReference
Z-test Error function approximation: Φ(z) = (1 + erf(z / √2)) / 2; erf computed via Horner's method (Abramowitz & Stegun 7.1.26) NIST/SEMATECH e-Handbook
T-test Regularized incomplete beta function via continued-fraction expansion; handles df from 1 to 10,000+ Numerical Recipes, 3rd ed., Ch. 6.4
Chi-Square Regularized incomplete gamma function P(a, x) where a = df/2 and x = χ²/2; right-tail = 1 - P(a, x) NIST/SEMATECH e-Handbook
Authoritative references:
NIST/SEMATECH e-Handbook of Statistical Methods: itl.nist.gov/div898/handbook/
Fisher, R.A. (1925). Statistical Methods for Research Workers. Oliver & Boyd.
Abramowitz, M. & Stegun, I.A. (1964). Handbook of Mathematical Functions. National Bureau of Standards.

Learn More: Related Topics

These guides on Statistics Fundamentals cover the concepts behind the tests this calculator supports.