Hypothesis Test Calculator

Z-Test & T-Test Proportion Tests Auto Decision Free · No Signup

Free online hypothesis test calculator for means and proportions. Perform Z-tests, T-tests, one-proportion and two-proportion tests with automatic reject/fail-to-reject decision, step-by-step KaTeX formulas, and Python scipy export.

Hypothesis Test
Null hypothesis value

Result

🧪

Enter parameters and click Perform Test

Run hypothesis tests for means, proportions, or group comparisons.

Distribution Visualization

Python Compiler

What Is Hypothesis Testing?

Hypothesis testing is a statistical procedure used to determine whether sample data provides sufficient evidence to reject a claim (the null hypothesis) about a population parameter. It is fundamental to scientific research, quality control, and data-driven decision making.

1. State H₀ & H₁ 2. Choose α level 3. Compute Test stat 4. Find p-value 5. Decide Reject?
📝

State Hypotheses

Define H₀ (null — no effect) and H₁ (alternative — the claim you want to test). H₀ always contains the equality.

📊

Calculate Evidence

Compute a test statistic that measures how far the sample result is from the null hypothesis value in standard-error units.

⚖️

Make Decision

Compare the p-value to α. If p ≤ α, reject H₀. Otherwise, fail to reject H₀. Never “accept” H₀.

Test Formulas

Z-test for mean (σ known):  z = (x̄ − μ₀) / (σ / √n)
Use when the population standard deviation is known or n is very large.
T-test for mean (σ unknown):  t = (x̄ − μ₀) / (s / √n),  df = n − 1
Use when the population SD is unknown. Uses sample SD s with t-distribution.
One-proportion Z-test:  z = (p̂ − p₀) / √(p₀(1−p₀) / n)
Tests a sample proportion against a claimed population proportion.
Two-proportion Z-test:  z = (p̂₁ − p̂₂) / √(p̂(1−p̂)(1/n₁ + 1/n₂))
Pooled p̂ = (x₁ + x₂) / (n₁ + n₂). Tests if two population proportions are equal.

Decision Making

If p-value ≤ α

Reject H₀. The result is statistically significant. There is sufficient evidence to support H₁.

If p-value > α

Fail to reject H₀. The result is not statistically significant. Insufficient evidence to support H₁.

Common Significance Levels

αConfidencez* (two-tailed)Use Case
0.1090%±1.645Exploratory analysis, social science
0.0595%±1.960Standard for most research
0.0199%±2.576High-stakes, medical trials

Type I and Type II Errors

❌ Type I Error (α)

False positive. Rejecting H₀ when it is actually true. The probability is controlled by α (significance level).

Example: Concluding a drug works when it does not.

⚠️ Type II Error (β)

False negative. Failing to reject H₀ when it is actually false. Related to sample size and effect size.

Example: Missing a real drug effect due to small sample.

✅ Correct: Reject true H₁

H₀ is false and we correctly reject it. This is the desired outcome of a well-powered test.

✅ Correct: Fail to reject true H₀

H₀ is true and we correctly fail to reject it. No false alarm.

Statistical Power = 1 − β — the probability of correctly rejecting a false H₀. Increase power by increasing sample size, using a larger α, or when the true effect size is large.

When to Use Each Test

TestData TypeWhen to Use
Z-test (mean)Continuousσ is known, or n > 30 with known population SD
T-test (mean)Continuousσ is unknown (use sample s). Works for any n with normal population
One-proportion ZCategoricalCompare sample proportion to a claimed value. Need np₀ ≥ 5 and n(1−p₀) ≥ 5
Two-proportion ZCategoricalCompare proportions from two independent groups. Uses pooled proportion under H₀

Tip: In practice, the population σ is almost never known, so the T-test is the most commonly used test for means. The Z-test is primarily used for proportions and in textbook problems.

Frequently Asked Questions

Use the Z-test when the population standard deviation (σ) is known or the sample size is very large. Use the T-test when σ is unknown and you rely on the sample standard deviation (s). The T-distribution has heavier tails, especially for small samples, giving more conservative results.
Choose a one-tailed test if you predict a specific direction (e.g., the new treatment is better). Choose a two-tailed test if you are testing for any difference in either direction. This decision must be made before collecting data to avoid bias.
Rejecting H₀ means the data provides sufficient evidence that the null hypothesis is unlikely. It does not prove H₁ is true. It means that if H₀ were true, the probability of seeing results this extreme is less than α.
Type I error (α) is rejecting H₀ when it is actually true (false positive). Type II error (β) is failing to reject H₀ when it is actually false (false negative). Alpha is controlled by the significance level you choose.
Use a proportion test when your data is categorical (yes/no, pass/fail). A one-proportion test compares a sample proportion to a claimed value. A two-proportion test compares proportions from two independent groups, such as treatment vs. control conversion rates.
Z-test assumes known σ and a normal population (or large n). T-test assumes a normal population (or large n). Proportion tests need np₀ and n(1−p₀) both at least 5. All tests assume random, independent samples.

Support This Free Tool

Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.

500K+ users
200+ tools
100% private
Privacy Guarantee: Private keys you enter or generate are never stored on our servers. All tools are served over HTTPS.