T-Statistic Calculator: t-Value, p-Value and Critical Value
Enter your sample statistics to compute the t-statistic, degrees of freedom, p-value and critical value for one-sample, two-sample or paired t-tests. Choose a significance level and tail direction, and the step-by-step panel shows every arithmetic step with your actual numbers so you can verify the work by hand.
Formula
Worked example
One-sample example: sample mean 52, population mean 50, s = 5, n = 25. SE = 5 / sqrt(25) = 1.0. t = (52 - 50) / 1.0 = 2.000. df = 24. Two-tailed p-value at df = 24 is about 0.057, so this result is not significant at alpha = 0.05 (critical t = 2.064).
What is the t-statistic and when do you use it?
The t-statistic measures how many standard errors a sample result sits away from a null-hypothesis value. It was introduced by William Sealy Gosset in 1908 under the pseudonym "Student" so that small-sample inferences could be made without knowing the true population standard deviation. You use a t-test instead of a z-test whenever the population standard deviation is unknown (which is nearly always in practice) and the data come from a reasonably bell-shaped distribution. Three situations call for three different formulas:
- One-sample t-test: compare a single sample mean to a fixed reference value (e.g., does average systolic blood pressure in a clinical trial differ from the known normal of 120 mmHg?).
- Two-sample (Welch) t-test: compare the means of two independent groups when their variances may differ (Welch's test does not assume equal variances, making it more robust than the older pooled version).
- Paired t-test: compare before-and-after measurements on the same subjects, or measurements on matched pairs. Pairing removes between-subject variability and typically gives more statistical power than an unpaired test on the same data.
How the t-statistic is calculated
Each formula follows the same logic: difference of interest divided by the standard error of that difference. For a one-sample test, t = (sample mean - hypothesised mean) / (sample SD / sqrt(n)). The denominator, s / sqrt(n), is the standard error, the estimated spread of sample means if you repeatedly drew samples of size n from the same population. For the two-sample Welch test, the standard error is sqrt(s1^2/n1 + s2^2/n2), and degrees of freedom are approximated by the Welch-Satterthwaite equation rather than the simpler n1 + n2 - 2 used when equal variances are assumed. For paired data, you first compute the difference for each pair, then apply the one-sample formula to those differences. The degrees of freedom are always n - 1 for one-sample and paired tests, and the Welch-Satterthwaite value for two-sample tests.
Interpreting the p-value, critical value and decision
Once you have t and degrees of freedom, the p-value is the probability of observing a t-statistic this large in magnitude (for a two-tailed test) or this far in one direction (for a one-tailed test) if the null hypothesis were true. A small p-value means the data are improbable under H0, which is evidence against it. The critical value is the boundary of the rejection region: if |t| exceeds the critical value, you reject H0. Both approaches always agree on the decision. Common choices are alpha = 0.05 (5% chance of a false positive per test) and alpha = 0.01 for more stringent control. Key caveats:
- A p-value does not measure the size or importance of an effect, only its consistency with the null.
- With very large samples, trivially small differences can be statistically significant.
- Report an effect size (Cohen's d, Hedges' g, or a confidence interval) alongside the p-value to communicate practical significance.
One-tailed vs. two-tailed tests
A two-tailed test asks: is the effect non-zero in either direction? The rejection region is split equally across both tails. A right-tailed test asks: is the effect positive? The full rejection region is in the upper tail. A left-tailed test is the mirror image. Use a one-tailed test only when you have a strong, pre-specified directional prediction registered before seeing the data. Using a one-tailed test after peeking at results is a form of p-hacking that inflates the false-positive rate.
Degrees of freedom and why they matter
Degrees of freedom (df) govern the shape of the t-distribution used to convert t into a p-value. With few degrees of freedom (small samples), the t-distribution has heavier tails than the normal distribution, producing larger critical values and wider confidence intervals. This is the mechanism by which t-tests account for extra uncertainty from estimating the standard deviation from the data. As df grows beyond roughly 30, the t-distribution converges toward the standard normal, and critical values approach the familiar z-scores (1.96 for alpha = 0.05, two-tailed). For very small samples (df < 5), assumptions about normality are hard to verify and the t-test can be unreliable; consider exact permutation tests in those cases.
Common critical t-values
| df | α = 0.10 | α = 0.05 | α = 0.01 | α = 0.001 |
|---|---|---|---|---|
| 1 | 6.314 | 12.706 | 63.657 | 636.619 |
| 2 | 2.920 | 4.303 | 9.925 | 31.599 |
| 5 | 2.015 | 2.571 | 4.032 | 6.869 |
| 10 | 1.812 | 2.228 | 3.169 | 4.587 |
| 20 | 1.725 | 2.086 | 2.845 | 3.850 |
| 30 | 1.697 | 2.042 | 2.750 | 3.646 |
| 60 | 1.671 | 2.000 | 2.660 | 3.460 |
| 120 | 1.658 | 1.980 | 2.617 | 3.373 |
| ∞ (z) | 1.645 | 1.960 | 2.576 | 3.291 |
Two-tailed critical values for common significance levels; reject H₀ when |t| exceeds the tabled value.
Frequently asked questions
What is the difference between a t-statistic and a z-score?
Both measure distance from a reference point in standard-deviation units. A z-score uses the known population standard deviation sigma; a t-statistic uses the estimated sample standard deviation s. Because s is uncertain (especially in small samples), the t-distribution has heavier tails than the normal, producing larger critical values. When the sample is large (roughly n > 30) and s is a reliable estimate of sigma, the two are nearly interchangeable.
How do I choose between a one-sample, two-sample, and paired t-test?
Use a one-sample test when you have a single group and a fixed reference (a known standard or a theoretical value). Use a two-sample (Welch) test when you have two independent groups with no natural pairing. Use a paired test when each observation in group 1 is matched to an observation in group 2, such as measuring the same subjects before and after a treatment. Pairing removes between-subject variation and usually gives more power.
What does a p-value of 0.03 actually mean?
It means that if the null hypothesis were true, you would observe a t-statistic this extreme (or more extreme) in 3% of random samples of this size, purely by chance. It does NOT mean there is a 3% probability that H0 is true, or a 97% probability that H1 is true. Statistical significance is a statement about data given a hypothesis, not about hypotheses given data.
My result is significant - does that mean the effect is real?
Statistical significance means the result is unlikely to be due to chance alone, given your significance level. It does not confirm the effect is large, practically important, or free from confounding. Multiple comparisons, publication bias, and poor measurement can all produce significant results that fail to replicate. Always report the effect size and a confidence interval alongside the p-value.
When should I use a one-tailed test?
Only when you have a strong theoretical or practical reason to expect the effect in one specific direction, and you registered that directional prediction before collecting data. A one-tailed test at alpha = 0.05 has less stringent critical values than the equivalent two-tailed test, so using it post-hoc to nudge a borderline result over the threshold is a form of p-hacking.
What sample size do I need for a t-test?
It depends on the expected effect size, desired power (typically 80-90%), and significance level. As a rough guide, detecting a moderate effect (Cohen's d = 0.5) at 80% power with alpha = 0.05 (two-tailed) requires about 64 subjects per group in a two-sample test. For smaller effects you need more. Use a dedicated power analysis (G*Power or a power calculator) to find the right n before you collect data.
Does the t-test require normally distributed data?
The t-test is remarkably robust to non-normality when sample sizes are moderate or large (n > 30 per group), thanks to the central limit theorem. With very small samples, the test is sensitive to outliers and heavy-tailed distributions. In those cases, consider a non-parametric alternative such as the Wilcoxon signed-rank test (paired) or the Mann-Whitney U test (two-sample independent).