Hypothesis Calculator

This hypothesis calculator writes H0 and H1, finds the critical value and then gives the power, the Type II error and the sample size you need.

Checks on your data

  • This uses the z test (σ known). For an estimated SD with small n the true power is a little lower.
  • Power is the chance of rejecting H₀ when the alternative is true. β = 1 − power.

Results

Null hypothesis H₀
μ = 100
Alternative hypothesis H₁
μ ≠ 100
Critical z
±1.95996
Critical sample mean
95.1001 and 104.9
Power if the true mean is 105
0.516005
Type II error β
0.483995
n needed for power 0.8
71
Sampling distribution under H₀ (blue) and under the true mean (orange)
00.050.10.159095100105110115H₀True meansample mean
Show step-by-step solution
  1. H₀: μ = 100; H₁: μ ≠ 100.
  2. Standard error = σ ÷ √n = 15 ÷ √36 = 2.5.
  3. Critical z for α = 0.05 (two-tailed) = ±1.95996, so reject H₀ when x̄ is beyond 95.1001 or 104.9.
  4. If the true mean is 105, the standardised shift is (105 − 100) ÷ 2.5 = 2, giving power 0.516005.
  5. Required n = ((z_α + z_power)·σ ÷ (μ₁ − μ₀))² = 71 (rounded up).
H₀No effect
H₁Effect exists
Power1 − β
Common target0.80

What Is Hypothesis?

A hypothesis test starts with a null hypothesis, H₀, and an alternative, H₁. You reject H₀ when the sample mean falls beyond the critical value for your significance level.

Enter the hypothesised mean, the true mean you want to detect, the standard deviation, n and α. The calculator gives the critical z and critical sample mean, the power, β and the n needed for your target power, with a chart of both sampling distributions.

The sections below explain power, Type II error and how to plan a sample size.

How to Use the Hypothesis Calculator

  1. Enter μ₀ and the mean you want to detect.
  2. Enter σ, n and α.
  3. Pick the alternative.
  4. Read the critical value, power and required n.

Hypothesis Formula

Standard error

SE=σnSE=\frac{\sigma}{\sqrt n}

Sample size

n=((zα+zpower)σμ1−μ0)2n=\left(\frac{(z_{\alpha}+z_{power})\sigma}{\mu_1-\mu_0}\right)^2

Hypothesis Variables Explained

SymbolMeaningNotes
μ₀Hypothesised mean
μ₁True mean to detect
αSignificance level
βType II error rate

Hypothesis Worked Example

Test μ₀ = 100 against μ₁ = 105 with σ = 15, n = 36 and α = 0.05 (two-tailed). SE = 2.5, shift = 2, critical z = 1.96, and the power is about 0.516. To reach power 0.80 you need n = 71.

With the example values loaded in the calculator above, the steps are:

  1. H₀: μ = 100; H₁: μ ≠ 100.
  2. Standard error = σ ÷ √n = 15 ÷ √36 = 2.5.
  3. Critical z for α = 0.05 (two-tailed) = ±1.95996, so reject H₀ when x̄ is beyond 95.1001 or 104.9.
  4. If the true mean is 105, the standardised shift is (105 − 100) ÷ 2.5 = 2, giving power 0.516005.
  5. Required n = ((z_α + z_power)·σ ÷ (μ₁ − μ₀))² = 71 (rounded up).

Result: Null hypothesis H₀ = μ = 100; Alternative hypothesis H₁ = μ ≠ 100; Power if the true mean is 105 = 0.516005; n needed for power 0.8 = 71.

Where Hypothesis Is Used

Study planning

Pick a sample size before collecting data.

Power checks

Find the chance of detecting an effect.

Teaching

See H0, H1 and critical values.

Quality control

Plan a test for a shift in the mean.

Common Hypothesis Mistakes to Avoid

  • Choose the alternative before collecting data.
  • Bigger n or bigger effect raises power.
  • Do not lower α without checking power.

Hypothesis Terms and Definitions

Power
The probability of rejecting H₀ when H₁ is true.
Type II error
Failing to reject a false H₀, with probability β.

Hypothesis FAQs

How do I write H0 and H1?

H₀ states no effect, such as μ = μ₀; H₁ states what you want to show, such as μ ≠ μ₀, μ > μ₀ or μ < μ₀.

What is the critical value?

The cutoff on the test statistic beyond which H₀ is rejected at level α.

What is the power of a test?

The chance of correctly rejecting a false H₀.

How many samples do I need?

Enough that the standard error is small relative to the effect you want to detect; the tool gives the n for your target power.

Related calculators

Last updated 2026-11-09. See our disclaimer.