Type I / II Error Visualizer
Every statistical test has two error types: rejecting a true null hypothesis (Type I, alpha) or missing a real effect (Type II, beta). Their trade-off is hard to picture from formulas. Drag the sliders to watch two sampling distributions slide apart and see how power, alpha, and effect size move together.
New to alpha and beta? Read the 4-min primer ▾
The two errors. A Type I error (false positive) is rejecting the null hypothesis when it is actually true; its rate is alpha and you set it. A Type II error (false negative) is failing to reject the null when an effect really exists; its rate is beta and you compute it. Power equals 1 minus beta: the probability your test catches a real effect.
How to read the picture. The dashed gray curve is the sampling distribution of the test statistic when the null is true. The solid blue curve is the sampling distribution when the alternative is true. The yellow shaded tails on the gray curve add up to alpha. The red hatched region under the blue curve, on the wrong side of the critical value, is beta.
Why dragging teaches. Move the effect slider; the blue curve shifts away from the gray, beta shrinks, power grows. Move n; both curves narrow, the overlap shrinks, power grows. Move alpha; the critical line slides, the red beta region resizes in the opposite direction. The four quantities (effect, n, alpha, power) form a tight quartet: pin any three, the fourth is determined.
When this is the wrong tool. If you want to solve for the sample size that hits a target power, use the Power Analysis calculator. This page is the picture; that page is the answer.
Try a real-world example to load.
How we got there
Read more Anatomy of the two distributions
Caveats When this is the wrong tool
- If you want to…
- Use instead
- Solve for the n that hits a target power
- The Power Analysis tool. This page is the picture; that one is the calculator.
- Check equivalence (TOST), not difference
- Equivalence framing has different shading (two one-sided tests). Coming as a separate equivalence tool.
- Use a Bayesian framing
- Bayesian posterior overlap is a different framing; alpha and beta are frequentist constructs. Try a brms or rstanarm tutorial.
- Plan a sequential / group-sequential trial
- Sequential boundaries reshape the rejection region; out of scope here. See the A/B Test Calculator's sequential tab.
- Compute "observed power" from a finished study
- Don't. Post-hoc power is a one-to-one transform of the p-value (Hoenig & Heisey, 2001) and not informative.
- Type I and Type II errors in R - the long-form tutorial behind this visualizer.
- Statistical power analysis in R - the pwr package and the noncentrality story.
- Hypothesis testing in R - where alpha and beta sit in the Neyman-Pearson framework.
- Power Analysis tool - solve for n, power, or detectable effect.
- Effect Size Converter - translate between d, r, h, f, eta-squared.
Numerical accuracy: noncentral t uses Cornish-Fisher; noncentral F and chi-square use Poisson-mixture series; results match R's pwr package to ~3 decimals across the calibrated test cases.