What a t-test checks
A t-test checks whether an average differs from a value you care about, or whether two averages differ from each other. A class averages 72 and you want to know if that is really above 70. A new drug lowers blood pressure by 5 points and you want to know if that is real or noise. The t-statistic measures the gap in units of standard error — how many wobbles away from zero the result sits.
The t-statistic on its own means little, because the yardstick changes with the sample size. A t of 2.0 with 10 degrees of freedom gives a p-value of 0.07 and is not significant; the same t of 2.0 with 100 degrees of freedom gives p = 0.05 and sits right on the line. That is why this calculator needs the degrees of freedom alongside the statistic.
This calculator takes your t-statistic, degrees of freedom and choice of tails, and returns the p-value, the critical value at 0.05 and a yes-or-no verdict. It runs entirely in your browser, so nothing is uploaded and nothing is stored.
How the t-test p-value is worked out
The p-value comes from the t-distribution, which is like the normal curve but with fatter tails — a penalty for small samples, where the standard deviation itself is uncertain. The two-tailed p-value is the regularised incomplete beta function I_x(df ÷ 2, 0.5), with x set to df ÷ (df + t²). The calculator works this out with the Numerical Recipes continued-fraction method, accurate to far more digits than a p-value needs.
The critical value is found the other way round: it is the t whose two-tailed p-value is exactly 0.05. The calculator finds it by bisection, narrowing a bracket sixty times until the value settles. With 10 degrees of freedom the critical value is 2.23; with 20 it is 2.09; with 30 it is 2.04; and with very large samples it approaches 1.96, the normal value. Small samples demand a bigger t before they believe you.
Degrees of freedom for a one-sample test are n − 1, where n is the sample size. For a two-sample test with equal variances they are n₁ + n₂ − 2. Get this number wrong and both the p-value and the critical value are wrong, so count the observations first and check the rule for your test.
One-tailed or two-tailed, and small samples
This is the input people get wrong most often, and it can halve or double your p-value. A two-tailed test asks whether the mean differs in either direction; a one-tailed test asks only about one direction, because you decided before seeing the data that only that direction counts. A t of 1.5 with 20 degrees of freedom gives a two-tailed p-value of 0.15 and a one-tailed p-value of 0.07. Same data, very different verdicts.
The rule is to decide before you collect the data, and to have a real reason. One-tailed is right only when the other direction is impossible or meaningless. Picking it after seeing which way the result went is halving your p-value by hand. Two-tailed is the safe default, and it is what journals and examiners expect unless you justify otherwise.
Small samples are where the t-test earns its keep. With 10 degrees of freedom, the critical value is 2.23 instead of 1.96, because the fat tails make extreme results more likely by chance. The calculator uses the t-distribution throughout, so it stays honest where a normal-based check would overclaim. For very large samples the difference fades away, and the t-test agrees with the z-test.
A worked example: t = 2.0 with 10 degrees of freedom
Take the default numbers on this page: a t-statistic of 2.0 with 10 degrees of freedom, two-tailed. The p-value is I_x(5, 0.5) with x = 10 ÷ (10 + 4) = 0.714, which works out to 0.07. The critical value at 0.05 is 2.23. Since 2.0 is below 2.23 and the p-value of 0.07 is above 0.05, the result is not significant — a gap two standard errors wide happens about 7 times in 100 by chance alone.
Now raise the statistic. A t of 3.0 with the same 10 degrees of freedom gives a p-value of 0.01, against the same critical value of 2.23. This time the statistic clears the line comfortably, and the result is significant. The difference between the two cases is one standard error — 2.0 against 3.0 — and it flips the verdict entirely. That is how sharp the 0.05 line is.
A third case shows the one-tailed side. A t of 1.5 with 20 degrees of freedom, one-tailed, gives a p-value of 0.07 and a two-tailed critical value of 2.09, so it is not significant. The same t two-tailed would give p = 0.15. Either way the evidence is weak, and the honest report is that the data has not settled the question — not that the effect is zero.
Where t-tests do real work
In medicine, the t-test compares a treatment group with a control group. A drug lowers blood pressure by 5 points on average, and the t-test asks whether that gap could be chance. If the p-value is 0.01, the drug ships to a bigger trial; if it is 0.30, the trial stops. The whole pipeline of drug testing runs on this one calculation, repeated thousands of times.
In manufacturing, a t-test checks whether a process change worked. A machine is adjusted and the next 20 parts are measured; the average length is compared with the target. A significant result means the adjustment moved the process; a non-significant one means the change is lost in the noise and the machine needs a different fix.
In education and psychology, the t-test compares two classes, two teaching methods or two groups of students. A new method lifts scores by 4 points with p = 0.02, and the school adopts it; the same lift with p = 0.40 is treated as noise. A average calculator gives you the two means; the t-test tells you whether their gap means anything.
T-test vs z-test vs chi-square: what is the difference?
The t-test and the z-test answer the same question — is this average different? — but the z-test assumes you know the population standard deviation, and the t-test estimates it from the sample. In practice you almost never know the true standard deviation, so the t-test is the honest choice for real data. With large samples they agree; with small samples the t-test is stricter, which is exactly what you want.
The chi-square test is a different tool entirely. It works on counts in categories — how many people chose each option — while the t-test works on means of measured numbers. If your data is counts, use chi-square; if it is measurements with an average, use a t-test. Mixing them up is the most common error in student projects, and the two statistics live on different scales, so they cannot be compared with each other.
The p-value is not a test at all. It is the output every test shares: the probability of data this extreme if the null were true. A t-test p-value of 0.07 and a chi-square p-value of 0.07 mean the same thing in plain language, but they come from different curves. A standard deviation calculator shows the spread that feeds the t-statistic, and a probability calculator handles the everyday chances behind the p-value.
Common t-test mistakes
The first mistake is running a t-test on data that is not roughly bell-shaped, or on tiny samples with wild outliers. The t-test assumes the sample mean is roughly normal, which holds for decent-sized samples but breaks for small, skewed ones. One extreme value in a sample of 8 can drag the mean and wreck the test. Plot the data first; if it is badly skewed, use a non-parametric test instead.
The second mistake is the wrong degrees of freedom. For a one-sample test it is n − 1, not n. Forgetting the minus-one makes the critical value slightly too small and the p-value slightly too good — a small error, but an avoidable one. For a two-sample test it is n₁ + n₂ − 2 under equal variances, and the Welch version uses a different formula when the variances differ.
The third mistake is picking one-tailed after seeing the data. A one-tailed test halves the p-value, so choosing it after the result is known is a free halving. Decide the tails before the data arrives, write the reason down, and stick to it. The calculator lets you switch, but the honest switch happens before the experiment, not after.
The fourth mistake is reading a non-significant result as proof of no effect. A p-value of 0.07 does not mean the effect is zero; it means the data is too thin to tell. Absence of evidence is not evidence of absence. The honest report is that the study was too small to settle the question, and the fix is more data, not a stronger claim.
How to use this t-test calculator
Type your t-statistic into the first box — it can be positive or negative, and the calculator uses its size, not its sign, for a two-tailed test. Then type the degrees of freedom: n − 1 for a one-sample test, or n₁ + n₂ − 2 for a two-sample test. Pick the tails, with two-tailed as the default. The p-value, the critical value at 0.05 and the verdict update live.
Read the verdict with the p-value beside it. If the statistic is above the critical value, the p-value is below 0.05 and the answer is Yes. Borderline cases — a t just above or just below the line — deserve a second look at the data before you claim anything, and the p-value itself belongs in your report, not just the verdict.
Everything runs in your browser. No account, no upload, no data sent anywhere. Pair it with the variance calculator when you want to check the spread behind your statistic, and remember the fine print: this calculator takes a t-statistic you already have. Working one out from raw data needs the means, standard deviations and sample sizes first.