🧮
🧮 Math & statistics

Hypothesis Testing Calculator (z test, t test, one-proportion test)

Results update as you type.

Your numbers

Understanding the hypothesis testing calculator — concept and principle

This calculator runs the three most common one-sample tests: a z test for a mean with known σ, a t test for a mean with unknown σ, and a z test for one proportion. It gives the test statistic, the p-value, the critical value, the standard error, the degrees of freedom and the decision at your significance level. Use it for statistics homework and quick checks of survey or experiment results.

One-sample t testOne-sample t testt = 2.3−2.032.03pink = rejection regionStandard error6 ÷ √36 = 1t (35 df)(52.3 − 50) ÷ 1 = 2.3p-value0.02753DecisionReject H₀
t lands beyond the critical value, so p is below 0.05 and H₀ is rejected.

How it is calculated

Mean, σ known: z = (x̄ − μ₀) ÷ (σ/√n)

Mean, σ unknown: t = (x̄ − μ₀) ÷ (s/√n), with n − 1 degrees of freedom

One proportion: z = (p̂ − p₀) ÷ √(p₀(1 − p₀)/n), with p̂ = successes ÷ n

Reject H₀ when p < α (equivalently, when the statistic falls beyond the critical value).

The principle

A test starts from the assumption that nothing unusual is going on (H₀) and asks how surprising the data would be under it. The test statistic counts how many standard errors the sample result is from the hypothesised value. The p-value is the probability of a result at least that far out if H₀ were true. If that probability is below α, the data are judged inconsistent with H₀. The t distribution replaces z when σ is estimated from the sample, adding a little extra uncertainty.

Worked example

Default inputs: t test, x̄ = 52.3, μ₀ = 50, s = 6, n = 36, α = 0.05, two-sided.

  1. Standard error = 6 ÷ √36 = 1.
  2. t = (52.3 − 50) ÷ 1 = 2.3, with 35 degrees of freedom.
  3. Two-sided critical value at α = 0.05: ±2.03.
  4. p-value = 2 × P(t₃₅ > 2.3) = 0.02753.
  5. Decision: Reject H₀ — significant at this α.
How p-value changes with Sample size nHow p-value changes with Sample size n00.10.20.39182736455472Example: 0.02753Sample size n
Each point is the calculator re-run with only “Sample size n” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Sample size np-value
90.2834
180.1223
270.05699
360.02753
450.01358
540.006797
720.001751

How to read the result

The sample mean is 2.3 standard errors above 50, and a difference that large would happen only about 2.8 % of the time if the true mean were 50. That is evidence the mean differs from 50, but it does not say the difference is large or important: 2.3 units may or may not matter in practice. Report the estimate with a confidence interval as well.

Common mistakes

Keep in mind: Tests assume random, independent observations and, for small samples, roughly normal data. Statistical significance is not proof of cause or of practical importance.

Frequently asked questions

What does a p-value of 0.0275 mean?

If H₀ were true, a result at least this extreme would occur about 2.75 % of the time.

When do I use a t test instead of a z test?

When the population standard deviation is unknown and estimated from the sample.

What is the significance level α?

The false-alarm risk you accept, commonly 0.05.

Sources: NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.2 Confidence Limits for the Mean · OpenStax, Introductory Statistics 2e (2023), Chapter 9 Hypothesis Testing with One Sample

Checked 9 Nov 2026. NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.2 Confidence Limits for the Mean (t = (Ȳ − μ₀)/(s/√N), N − 1 degrees of freedom, two- and one-sided rejection regions); OpenStax, Introductory Statistics 2e, §9.3 (normal and t distributions for means; p′ normal with mean p and SD √(pq/n) when np and nq are above 5).

🧮 All math & statistics tools →🌍 Calculators by country →