When you collect a sample and want to know whether its mean is meaningfully different from a known population mean, the Student's t-test is the standard tool. This t score calculator computes the t-statistic, the standard error, the degrees of freedom, and Cohen's d (the effect size) in one step — no spreadsheet, no hand arithmetic.
Enter your sample mean, the population (or hypothesized) mean, the sample standard deviation, and the sample size. The calculator returns the t-statistic you can then compare against a t-table at your chosen significance level. Converting t into a two-tailed p-value requires the Student's t cumulative distribution function (an integral the browser does not compute inline), so this page hands you the exact t and df to look up, rather than guessing at the CDF.
How to Use
- Enter the Sample Mean (x̄) — the average value of your sample data. For example, if 25 students averaged 48 on a practice exam, enter 48.
- Enter the Population Mean (μ) — the known mean or the benchmark you are comparing against. If the historical class average is 50, enter 50.
- Enter the Sample Standard Deviation (s) — the spread of your sample, computed with n−1 in the denominator.
- Enter the Sample Size (n) — how many observations are in your sample. Degrees of freedom are n−1.
- Read the result card: the t Statistic (highlighted), the mean difference, the standard error, degrees of freedom, and Cohen's d.
- Take |t| and df to a Student's t-table (or
scipy.stats.t.sf(abs(t), df) * 2in Python) to get the two-tailed p-value. If |t| exceeds the critical value at α = 0.05 for your df, the difference is significant.
The t-Test Formula
The one-sample t-statistic is defined as:
t = (x̄ − μ) / (s / √n)
Where:
- x̄ is the sample mean.
- μ is the population or hypothesized mean.
- s is the sample standard deviation.
- n is the sample size.
- s / √n is the standard error (SE) — the estimated standard deviation of the sample mean.
The denominator shrinks as n grows, so the same raw difference in means produces a larger t-statistic for larger samples. The degrees of freedom are df = n − 1, and they determine the shape of the Student's t-distribution used to convert t into a p-value. Cohen's d, d = (x̄ − μ) / s, is the standardized effect size: roughly 0.2 is small, 0.5 is medium, and 0.8 is large.
Worked example: x̄ = 48, μ = 50, s = 5, n = 25. The standard error is 5 / √25 = 1.0. The t-statistic is (48 − 50) / 1.0 = −2.0, with df = 24 and Cohen's d = −0.4. Looking |t| = 2.0 up in a t-table for df = 24 gives a critical value of about 2.064 at α = 0.05 two-tailed. Since 2.0 < 2.064, the result is just shy of significance — which matches the exact two-tailed p-value of about 0.0569.
t-Test vs. z-Test
Students often confuse the t-test with the z-test. The key difference is the standard error:
- z-test uses the population standard deviation σ, which must be known. It is rare in real research because σ is almost never known.
- t-test uses the sample standard deviation s, estimated from the data. It has heavier tails than the normal curve, especially for small n, and adjusts for the extra uncertainty.
As n grows large (roughly n ≥ 30), the t-distribution converges to the standard normal, and t and z become nearly identical. For small samples, the t-test is the correct choice.
Examples
Example 1 — The textbook case. A teacher gives a practice exam to 25 students. The class averages 48 points, but the historical average (population mean) is 50, with a sample standard deviation of 5. The mean difference is −2 points, the standard error is 1.0, and t = −2.0 with df = 24. The critical t at α = 0.05 two-tailed is 2.064, so the result is suggestive but not quite significant at the 5% level.
Example 2 — A clear effect. A researcher measures 16 participants who averaged 78 on a memory test, compared to a population mean of 75 with a sample standard deviation of 6. The standard error is 6/4 = 1.5, so t = (78 − 75) / 1.5 = 2.0 with df = 15. The critical t at df = 15 is about 2.131, so again the result is marginal. Cohen's d = 0.5 is a medium effect.
Example 3 — A large survey. A polling firm collects 1,000,000 responses and finds a mean of 100 against a benchmark of 95, with a standard deviation of 10. The standard error is 10/1000 = 0.01, giving t = 500.0 with df = 999,999. The p-value rounds to 0.0000. This illustrates that very large samples can make even tiny differences "statistically significant" — so always examine Cohen's d (here 0.5, a medium effect) rather than relying on p alone.
FAQ
What is a t-score?
A t-score (or t-statistic) measures how far a sample mean is from the population mean in units of standard error. It is computed as t = (x̄ − μ) / (s / √n). A large absolute t-score indicates that the sample mean is far from the hypothesized population mean.
How do I turn my t-score into a p-value?
This calculator gives you t and df directly. To get the two-tailed p-value, compare |t| to a t-table row for your df at α = 0.05, or run scipy.stats.t.sf(abs(t), df) * 2 in Python. The Student's t CDF is an integral that the arithmetic engine does not compute inline, so the honest next step is a t-table or a statistics package.
What is the difference between one-tailed and two-tailed tests?
A two-tailed test looks for a difference in either direction (sample mean could be higher or lower than μ). A one-tailed test looks for a difference in a specific direction only, and its critical |t| is smaller. Use a two-tailed test unless you pre-registered a directional hypothesis — otherwise one-tailed testing inflates your Type I error rate.
When should I use a t-test instead of a z-test?
Use a t-test whenever the population standard deviation is unknown and you must estimate it from the sample. This is almost always the case in real research. Use a z-test only when σ is known exactly and the sample size is large. For small samples (n < 30), the t-distribution's heavier tails give a more conservative, more accurate result.
What does degrees of freedom mean?
Degrees of freedom (df = n − 1) reflects how many independent pieces of information are in your sample. Because you estimated the mean from the same data, you lose one degree of freedom. Larger df makes the t-distribution narrower and closer to the normal curve; smaller df (especially df < 10) has much heavier tails, so the same t-statistic needs a larger critical value.
Is a negative t-score significant?
Yes. The sign of t only tells you the direction of the difference (sample mean below or above μ). Significance depends on the absolute value |t|, so t = −2.0 and t = +2.0 are treated the same by a two-tailed test.
What is Cohen's d?
Cohen's d standardizes the mean difference by the sample standard deviation: d = (x̄ − μ) / s. It puts effects on a common scale across studies: about 0.2 is a small effect, 0.5 is medium, and 0.8 is large. Report it alongside t and df so readers can judge practical significance, not just statistical significance.
Disclaimer
This t score calculator is provided for informational purposes only and does not constitute statistical, academic, or research advice. The t-statistic assumes independent observations, an approximately normal distribution, and a randomly sampled population. The page computes the t-statistic, standard error, df and Cohen's d exactly; the two-tailed p-value and confidence interval require the Student's t CDF and should be verified against a textbook, a t-table, or a statistics package such as scipy.stats, R, or SPSS before drawing formal conclusions.