Skip to content
LoveToCalc

P-value calculator

Choose a test, fill in your numbers and see the statistic, the degrees of freedom, the p-value and whether to reject the null hypothesis.

Reject the null hypothesis when the p-value is below α. Usually 0.05, 0.01 or 0.10.

The values shown are an example: the first 10 patients of R’s sleep data for the two-sample and paired tests.

Test result

Null hypothesis (H₀): μ₁ = μ₂

Alternative (H₁): μ₁ ≠ μ₂

t statistic
-1.8609
Degrees of freedom
17.7769
p-value
0.0794
Difference of means (x̄₁ − x̄₂)
-1.58
Standard error
0.849

p = 0.0794 is not below α = 0.05: do not reject the null hypothesis. The result is not statistically significant at this level.

Assumes two independent random samples from approximately normal populations, or large samples.

How to use it

The tests

Test Statistic Degrees of freedom
z-test for a mean (σ known) z = (x̄ − μ₀) / (σ/√n) none
One-sample t-test t = (x̄ − μ₀) / (s/√n) n − 1
Two-sample t-test (Welch) t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂) Welch–Satterthwaite
Two-sample t-test (pooled) t = (x̄₁ − x̄₂) / (sₚ√(1/n₁ + 1/n₂)) n₁ + n₂ − 2
Paired t-test a one-sample t-test on the differences pairs − 1
Chi-square goodness of fit χ² = Σ (O − E)²/E categories − 1
Chi-square independence χ² = Σ (O − E)²/E (rows − 1)(columns − 1)

What the p-value means

The p-value is the probability of a result at least as extreme as yours if the null hypothesis were true. When it is below your significance level α the result is called statistically significant and the null hypothesis is rejected. It is not the probability that the null hypothesis is true, and a small p-value does not say that an effect is large.

Checked against R

The calculator reproduces R’s output for the same data: for the sleep data, t.test gives t = −1.8608, df = 17.776, p = 0.07939 (Welch) and t = −4.0621, df = 9, p = 0.002833 (paired); chisq.test on the table 762 327 468 / 484 239 477 gives χ² = 30.07, df = 2, p = 2.954·10⁻⁷.

Common questions

Welch or pooled? Welch’s test does not assume equal variances and loses almost nothing when they are equal, so it is the default. Tick the box for the pooled test only when your course asks for it.

One-tailed or two-tailed? Use a one-tailed test only when the direction was decided before seeing the data. Otherwise use two-tailed.

To describe a list of numbers first, use the statistics calculator.

Last reviewed October 20, 2026 ·How pages are reviewed

The formula behind this

All math calculators

Put this calculator on your site

Copy the code into your page where the calculator should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.