Hypothesis Test Calculator

Run a one-sample z-test or t-test.
Enter sample mean, hypothesized mean, standard deviation, and sample size to get test statistic and p-value.

Hypothesis Test

A hypothesis test starts with two competing claims. The null hypothesis (H0) says there is no effect: the population mean equals some specified value mu0. The alternative hypothesis (H1) says the mean is different (two-tailed), greater than (right-tailed), or less than (left-tailed) mu0. You use sample data to decide which claim the evidence supports.

The test statistic: z (or t) = (x-bar - mu0) / (sigma / sqrt(n))

This measures how many standard errors the sample mean is away from the hypothesized mean. A test statistic near zero supports the null. A large absolute value — large enough that such a result would be rare if H0 were true — leads to rejection.

The p-value is the probability of observing a test statistic at least as extreme as yours, assuming H0 is true. If p < alpha, reject H0. If p >= alpha, fail to reject H0.

Use a z-test when the population standard deviation is known or n >= 30 (central limit theorem). Use a t-test for small samples with unknown population SD — the t-distribution has heavier tails that account for the extra uncertainty.

Common significance levels:

  • alpha = 0.05: used in most published research; roughly 1 in 20 chance of a false positive
  • alpha = 0.01: more conservative; used in medicine and safety-critical decisions
  • alpha = 0.10: used in exploratory research where false negatives are costly

The chart plots the sampling distribution under H0, showing the test statistic location and shading the rejection region(s) in red.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.

Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.