Utinzo

T-Test Calculator

Perform a one-sample t-test to determine if a sample mean is significantly different from a known population mean. Returns t-statistic and p-value.

Did this tool work for you?

How to use this calculator

t = (x̄ − μ) / (s / √n)

The t-statistic measures how many standard errors the sample mean is from the hypothesised population mean. Large |t| → small p-value → reject null hypothesis.

  1. 1

    Enter the sample mean, the hypothesised population mean (μ₀), sample standard deviation, and sample size.

  2. 2

    Set the significance level (α) — commonly 0.05.

  3. 3

    If p < α, reject the null hypothesis: the sample mean is significantly different from μ₀.

Frequently asked questions

What exactly does this calculate?

A one-sample, two-tailed t-test from summary figures. It computes the standard error s ÷ √n, the statistic t = (x̄ − μ) ÷ (s ÷ √n), degrees of freedom n − 1, and the p-value from the Student t distribution with those degrees of freedom. The p-value is exact (computed through the regularised incomplete beta function), not a normal-curve shortcut, so it stays correct for very small samples.

Why does the p-value for a small sample differ from what a z-test would give?

The t distribution has heavier tails than the normal one, especially with few degrees of freedom. For a sample mean of 103 against μ = 100 with s = 6 and n = 16, t = 2.0000 with 15 df and the p-value is 0.0639, so you fail to reject at 0.05. A normal curve would give about 0.0455 for the same statistic and wrongly reject. The gap shrinks as n grows.

What do I enter for the standard deviation, and what are the limits?

The sample standard deviation s, computed with an n − 1 divisor, which is the "sample" option in the variance calculator. It must be above 0. The sample size must be at least 2, since a single observation has no spread, and α must be strictly between 0 and 1. Use whole numbers for n because degrees of freedom are n − 1.

Is this a one-tailed or two-tailed test?

Two-tailed only: the alternative is that the true mean differs from μ in either direction. If you predicted a direction in advance and the sign of t agrees with it, the one-tailed p-value is half the displayed one. Choosing the direction after seeing the data is not valid.

What does the p-value mean, and what does it not mean?

It is the probability of getting a t at least this far from zero if the true mean really were μ and the test assumptions held. It is not the probability that the null hypothesis is true, and it does not measure the size of the difference. "Fail to reject" also does not prove the means are equal; with n = 10, a 2-point gap and s = 8 gives p = 0.4495, which mainly reflects limited data.

Why can a tiny difference still be "significant"?

Because the standard error shrinks with √n. A sample mean of 105 against μ = 100 with s = 10 and n = 5000 gives t = 35.36 and a p-value shown as "< 0.0001"; the same gap with n = 5 would not be significant. Statistical significance is not practical importance, so compare the difference itself with what matters in your field.

What assumptions does the t-test need?

Independent observations from a random sample, and data that are roughly normal when n is small. With larger samples the test tolerates moderate non-normality because the sample mean is close to normal, but strong skew or outliers still distort s and t. The calculator has no way to check any of this from summary numbers.

Which tests are not included?

Two-sample, Welch, and paired tests, proportion tests, effect sizes, power, and confidence intervals. A paired comparison can be run here by entering the mean and sample SD of the pairwise differences with μ = 0. The tool accepts summary statistics only, not raw data.

About t-test calculator

One-sample t-test calculator with exact Student t p-values

From summary statistics to a p-value

The test asks whether a sample mean is far enough from a hypothesised value to be hard to explain by sampling variation alone. You supply x̄, μ, the sample standard deviation s, n and α. The calculator divides the gap x̄ − μ by the standard error s ÷ √n to get t, then converts t to a two-tailed probability using the Student t distribution with n − 1 degrees of freedom. If p is below α it reports "Reject H₀", otherwise "Fail to reject H₀". A p-value below 0.0001 is displayed as "< 0.0001".

Two-tailed critical t at α = 0.05
Degrees of freedomCritical |t|
112.706
102.228
292.045
Very large (normal limit)1.960

Worked example: same gap, two sample sizes

A sample mean of 52 against μ = 50 with s = 8. With n = 30 the standard error is 1.4606, t = 1.3693 on 29 df, and p = 0.1814. With n = 10 the standard error rises to 2.5298, t = 0.7906 on 9 df, and p = 0.4495. Neither rejects H₀ at 0.05. The two-point gap is identical, yet the smaller sample provides much less evidence against μ = 50.

Worked example: where the normal curve would mislead

Let x̄ = 103, μ = 100, s = 6 and n = 16. The standard error is 1.5, t = 2.0000, df = 15, and the exact p-value is 0.0639, so H₀ stands at α = 0.05. A normal approximation would produce roughly 0.0455 and call the result significant. The table above shows why: with 15 degrees of freedom the cut-off for 5% is larger than 1.96, so t = 2 falls just short.

Reading the decision correctly

The decision line only compares p with the α you typed in. Setting α is a choice made before looking at the data, and 0.05 is a convention. A rejection says the data are unlikely under H₀, not that the effect is large or important. A non-rejection says the evidence was insufficient, especially if n is small. Report t, df, p and the observed difference together, and consider a confidence interval for the mean as well, which this page does not compute.

Input checks

The tool returns an error when s is zero or negative, when n is below 2, or when α is outside the open interval from 0 to 1. Use the sample standard deviation with the n − 1 divisor, not the population version. If your data are paired, enter the differences’ mean and SD with μ = 0. If you have two independent groups, a different test is needed.

T-Test Calculator – Utinzo

Learn more from an authoritative source:

Wikipedia
Related tools

Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →