t-Statistic Calculator — One-Sample t-Test
Enter your sample mean, the null-hypothesis population mean, sample standard deviation, and sample size. The calculator computes the one-sample t-statistic, degrees of freedom, standard error, and exact two-tailed p-value using Student's t-distribution.
t = (x̄ − μ₀) / (s / √n)
- 1
Standard error (SE)
4 ÷ √30 = 0.7303 - 2
t-statistic
(52 − 50) ÷ 0.7303 = 2.7386
How does this calculator work?
One-sample t-statistic: t = (x̄ − μ₀) / (s/√n). Degrees of freedom = n − 1. The two-tailed p-value comes from Student's t-distribution CDF. A p-value below 0.05 indicates the sample mean is unlikely to arise by chance if the true population mean were μ₀. Larger samples give smaller standard errors and more powerful tests.
Formula
How this is calculated
The one-sample t-test asks: could a sample with mean x̄ and standard deviation s (based on n observations) plausibly have come from a population with mean μ₀? The test statistic t = (x̄ − μ₀) / (s/√n) measures how many standard errors the sample mean is from the null value. The denominator s/√n is the standard error of the mean — it shrinks as n grows, reflecting that larger samples give more precise estimates.
The two-tailed p-value is the probability of observing a t-statistic at least as extreme as the one computed, if the null hypothesis (μ = μ₀) were true. This calculator computes the exact p-value using the regularised incomplete beta function to evaluate Student's t-distribution CDF with df = n−1 degrees of freedom. When df is large (n ≥ 30), the t-distribution closely approximates the standard normal; for smaller samples the heavier tails of the t-distribution produce larger p-values for the same t, making the test correctly more conservative.
By convention, a p-value below 0.05 is called statistically significant at the 5 % level (α = 0.05), and below 0.01 at the 1 % level. Statistical significance does not imply practical importance — always report the effect size (difference x̄ − μ₀) and confidence interval alongside the p-value.
Frequently asked questions
A z-statistic is used when the population standard deviation σ is known, and the test statistic follows a standard normal distribution. The t-statistic is used when σ is unknown (the usual case) and is estimated from the sample as s; it follows Student's t-distribution with n−1 degrees of freedom. As n increases, the t-distribution converges to the standard normal, so for n ≥ 30 the practical difference is small.
A two-tailed p-value tests the hypothesis that the population mean differs from μ₀ in either direction (greater or smaller). It equals the probability of observing a t-statistic at least as extreme (positive or negative) as the computed value, under the null hypothesis. Use a one-tailed test only when you have a strong prior reason to care about deviation in only one direction — two-tailed tests are the standard default.
This calculator implements the one-sample t-test (comparing one sample mean to a fixed null value). For a two-sample independent t-test (comparing two group means), use t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂) with the Welch–Satterthwaite degrees of freedom, which a two-sample t-test calculator would handle. For the paired t-test, compute the differences first and apply this one-sample test to those differences with μ₀ = 0.
Also known as
TG we-Calculate Editorial Team. (2026). t-Statistic Calculator — One-Sample t-Test [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/t-statistic-calculator
TG we-Calculate Editorial Team. "t-Statistic Calculator — One-Sample t-Test." TG we-Calculate. 2026. https://we-calculate.com/calculator/t-statistic-calculator.
TG we-Calculate Editorial Team, "t-Statistic Calculator — One-Sample t-Test," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/t-statistic-calculator
@misc{wecalculate_t_statistic_calculator, title = {t-Statistic Calculator — One-Sample t-Test}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/t-statistic-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
