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.

How to Read a Power Calculation

This tool sets up a test before you collect data. Testing μ₀ = 100 against a true mean of 105 with σ = 15, n = 36 and α = 0.05 gives a standard error of 2.5, a critical z of 1.96 and a power of about 0.516. That means the test would detect a true shift of 5 only about half the time.

To reach a power of 0.80 you need n = 71. Power rises with a larger sample, a larger true effect, a larger α and a smaller σ. The Type II error β is 1 minus the power, the chance of missing a real effect.

Where Hypothesis Is Used

Planning a study

Find the sample size that gives the power you want.

Writing hypotheses

See H₀ and H₁ written out for your test.

Critical values

Get the critical z and the critical sample mean.

Understanding Type II error

See how β changes with n and effect size.

Common Hypothesis Mistakes to Avoid

  • Decide the smallest effect worth detecting before you compute power.
  • Aim for a power of at least 0.8 in the planning stage, which is a common convention.
  • A two-tailed test needs a larger sample than a one-tailed one for the same effect.
  • This calculation assumes σ is known. With an estimated σ, use a t-based power calculation.

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, for example μ = 100. H₁ states the alternative you want evidence for, such as μ ≠ 100 for a two-tailed test or μ > 100 for a one-tailed test.

What is the critical value?

It is the cut-off for the test statistic. For a two-tailed z-test at α = 0.05 it is ±1.96. Results beyond it lead you to reject H₀.

What is the power of a test?

It is the probability of rejecting H₀ when the true mean really is different, equal to 1 − β. In the example it is about 0.516.

How many samples do I need?

Enough to reach your target power for the smallest effect you care about. For a shift of 5 with σ = 15, α = 0.05 and power 0.80, you need about 71.

Related calculators

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