Want a Custom tool for Yourself?

Need a Custom Tool? We build custom tools that can save hours per employee per day.

T Test Calculator

Run a one sample or two sample unpaired t test. Enter means, standard deviations, and sample sizes to get t value, df, and significance.

Enter the Details

Compare the means of two samples using a single-sample or two-sample t-test below.

Sample :





Result will appear here...


Last updated: March 7, 2026

Created by: Eon Tools Dev Team

Reviewed by: Ankit Khatiwada



What the t-test calculator does

A t-test checks whether a difference between means is more than chance would produce. This calculator runs two versions: a single-sample test, comparing one sample mean against a known value, and a two-sample test, comparing the means of two independent groups. It returns the t-value and the degrees of freedom, the two numbers a t-test turns on.

It is the standard tool for questions like whether a group differs from a benchmark, or whether two groups differ from each other. Below is how it works and how to finish the test.

How to use it

  1. Choose the sample type, single sample or two sample.
  2. Enter the figures: for a single sample, the population mean plus your sample's mean, standard deviation, and size; for two samples, the mean, standard deviation, and size of each.
  3. Press Calculate for the t-value and degrees of freedom, or Reset to clear it.

The two kinds of t-test

The single-sample test asks whether one group's mean differs from a specific known value, like checking whether a batch of parts meets a target measurement. You compare your sample mean against that fixed number.

The two-sample test asks whether two independent groups differ from each other, like a treatment group against a control. This calculator runs the unpaired, pooled version, which combines the two groups' spreads into a single pooled standard deviation and assumes their underlying variances are similar. It also reports that pooled standard deviation, the difference of the means, and the standard error of that difference.

How the t-value is worked out

The t-value is the difference you are testing, measured against the standard error, the natural wobble of that difference. For a single sample it is the gap between the sample mean and the known value, divided by the standard error of the mean:

t = (sample mean minus the known value) ÷ (s ÷ √n)

For two samples it is the difference between the two means, divided by the standard error of that difference. Either way, a t-value far from zero means the difference is large compared to the noise, and a t-value near zero means it is small. The degrees of freedom, which is the sample size minus one for a single sample and the two sizes minus two for two samples, sets the exact shape of the curve used to judge it.

Why a t-test and not a z-test

The t-test exists for the common situation where you do not know the true standard deviation of the population and have to estimate it from your sample. That estimate carries its own uncertainty, especially with a small sample, and the t-distribution accounts for it by being a little wider than the normal bell curve, with heavier tails.

As the sample grows, the estimate gets more reliable and the t-distribution draws closer to the normal curve, until for large samples they are almost the same. So the rule of thumb is simple: if the population standard deviation is unknown, which is nearly always, the t-test is the honest choice, and it matters most when the sample is small.

A worked example

Suppose a target value is 50, and your sample of 25 items has a mean of 52 and a standard deviation of 4.

The standard error is 4 ÷ √25 = 0.8, so the t-value is (52 minus 50) ÷ 0.8 = 2.5, with degrees of freedom of 25 minus 1 = 24. A t-value of 2.5 says the sample mean sits two and a half standard errors above the target, which is far enough out to be worth taking to the next step.

Turning the t-value into a decision

This calculator gives you the t-value and the degrees of freedom, which are what you need to judge significance, but the final p-value is a separate step. Take the t-value and the degrees of freedom to our p-value calculator, choose the t-score option, and it returns the p-value.

From there the usual logic applies: a p-value below your chosen level, commonly 0.05, means the difference is unlikely to be chance alone. Whether to read one tail or two depends on whether your question had a direction, a point worth settling before you look at the result.

Questions people ask

What does a t-test do?

It checks whether a difference between means is larger than chance would produce, by comparing the difference to its standard error. The result is a t-value and its degrees of freedom.

What is the difference between one-sample and two-sample?

A one-sample test compares a single group's mean to a known value. A two-sample test compares the means of two independent groups against each other.

When do I use a t-test instead of a z-test?

When the population standard deviation is unknown and estimated from the sample, which is nearly always. The t-distribution accounts for that extra uncertainty, especially in small samples.

Does it give a p-value?

It gives the t-value and degrees of freedom. Take those to the p-value calculator, using the t-score option, to get the p-value and judge significance.

References

A quick note on where the methods here come from. One-sample and two-sample t-tests and the t-distribution are set out in the NIST/SEMATECH e-Handbook of Statistical Methods, the US government's public statistics reference. OpenStax Introductory Statistics is a free, widely used textbook covering t-tests.

  1. NIST/SEMATECH e-Handbook of Statistical Methods (t-tests for means). https://www.itl.nist.gov/div898/handbook/
  2. OpenStax, Introductory Statistics (the Student's t-distribution and tests of means). https://openstax.org/details/books/introductory-statistics-2e


Ankit Khatiwada

Ankit Khatiwada is a researcher and graduate student in Computer Science at Saarland University, with strengths in statistics, data analysis, data engineering, and full stack development. His work sits at the intersection of quantitative reasoning and applied technology, making him a strong fit for tools that depend on clear numerical logic. At Eon Tools, he reviews number and statistical tools.