Skip to main content
Back to Statistics

Statistics · Hypothesis Testing

T Tests and Z Tests

The one idea: Z-tests and t-tests answer the exact same question — "is this sample mean too far from the assumed value to be chance?" — using the exact same logic. The only thing that changes is how much you actually know about the population. Know the true population standard deviation? Use Z. Have to estimate it from your sample, especially with fewer than about 30 observations? Use t, which is Z's more honest, wider-shouldered cousin.
⚠️ The trap: "We only have 12 customers in the pilot, but I'll just run a Z-test since it's simpler." Using Z with an estimated standard deviation and a small sample understates how uncertain that estimate really is — the critical value you're comparing against is too small, so you reject H₀ more often than you should. Small samples plus an estimated σ is exactly the situation the t-distribution was built for; substituting Z there manufactures false positives out of thin air.

The one fork in the road: do you know σ, or are you guessing it?

Every single-sample mean test asks the same question with the same formula skeleton: (observed − assumed) / standard error. The fork is entirely about the denominator.

Use a Z-test when the population standard deviation (σ) is known — genuinely known, from a large historical record, not estimated from the sample you're currently testing. The test statistic is:

Z = (X̄ − μ) / σ_x̄, where σ_x̄ = σ/√n

Use a t-test when σ is unknown — the overwhelmingly common real-world case, since you almost never have the true population standard deviation, only what you can compute from your own sample.…

Keep reading: T Tests and Z Tests

Unlock the full Statistics track — every lesson, the AI tutor, and full mock assessments.

  • Full lesson content
  • AI tutor for this section
  • Practice questions