T-Test Calculator
Run a one-sample or two-sample t-test and get the t-statistic and p-value.
t-Statistic
Degrees of Freedom
p-Value
Verdict (α = 0.05)
One-Sample vs Two-Sample T-Tests
A one-sample t-test compares the mean of a single sample against a known or hypothesized value (μ₀). The statistic is t = (x̄ − μ₀) / (s / √n) with df = n − 1.
A two-sample (independent, equal-variance) t-test compares the means of two independent groups. Using the pooled variance sp² = ((n₁−1)s₁² + (n₂−1)s₂²) / (n₁+n₂−2), the statistic is t = (x̄₁ − x̄₂) / √(sp²·(1/n₁ + 1/n₂)) with df = n₁ + n₂ − 2.
Assumptions
- Normality: the data (or sampling distribution of the mean) is approximately normal.
- Independence: observations are independent of one another.
- Equal variance: the pooled two-sample test assumes both groups share the same population variance.
- Continuous data: the measured variable is interval or ratio scaled.
Interpreting the Result
The p-value is the probability of observing a t-statistic at least as extreme as the one computed, assuming the null hypothesis is true. If the p-value is less than the significance level α (commonly 0.05), the result is statistically significant and the null hypothesis is rejected. Otherwise, there is not enough evidence to reject it. A two-tailed test detects differences in either direction; a one-tailed test only detects a difference in one specified direction.
Related Calculators
Note: This calculator uses summary statistics and assumes the underlying assumptions of the t-test are met. Results are for educational purposes and should be verified for critical analyses.