T Test Calculator
A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call
Free t test calculator. Paste your data for a one-sample, Welch two-sample or paired t-test to get t, degrees of freedom, the p-value and a confidence interval.
- p-value (two-tailed)
- 0
- Degrees of freedom
- 0
- Difference in means
- 0
- Confidence interval
- 0
- Means
- 0
Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.
How to use the t test calculator
- Choose the test:
- Two independent samples (Welch): compare the means of two separate groups.
- Paired samples: compare two measurements on the same people or items, such as before and after.
- One sample against a value: compare one group's mean with a known or target value.
- Paste your data for sample A and, for two-sample or paired tests, sample B. Separate numbers with commas, spaces or new lines.
- For a one-sample test, enter the hypothesized mean.
- Choose the confidence level for the interval, usually 95%.
The t test calculator shows the t statistic, the two-tailed p-value, the degrees of freedom, the difference in means, the confidence interval for that difference, and the means of each sample.
What is a t-test?
A t-test checks whether the difference between means is larger than you'd expect from random variation alone. It was developed by William Sealy Gosset, a chemist at the Guinness brewery in Dublin, who published it in 1908 under the pen name "Student". That's why the distribution it uses is called Student's t distribution.
The t-test is designed for small samples, where the population standard deviation isn't known and has to be estimated from the data. The t distribution has heavier tails than the normal distribution, which allows for the extra uncertainty in that estimate. As the sample size grows, the t distribution gets closer and closer to the normal distribution.
Two independent samples: Welch's t-test
To compare two separate groups, such as customers who saw two different versions of a page, the t test calculator uses Welch's t-test:
t = (mean A − mean B) ÷ √(s²A ÷ nA + s²B ÷ nB)
Here s² is each sample's variance and n is its size. Welch's test doesn't assume the two groups have the same variance, which makes it safer than the older "Student's" two-sample test with pooled variance. Many statisticians now recommend Welch's test as the default, because it performs well whether or not the variances are equal. Its degrees of freedom come from the Welch–Satterthwaite formula and usually aren't a whole number.
For example, with sample A of 20.1, 22.4, 19.8, 24.0, 25.2, 21.3 and 23.1, and sample B of 18.2, 17.9, 20.4, 16.8, 19.1, 18.5 and 19.7, the means are about 22.27 and 18.66. Welch's test gives t ≈ 4.10 with about 9.8 degrees of freedom and a p-value of about 0.002. The 95% confidence interval for the difference is about 1.65 to 5.58.
Paired samples
When the same people or items are measured twice, the measurements are linked, and a paired t-test is more powerful than comparing two independent groups. It works on the differences between pairs:
t = mean of differences ÷ (standard deviation of differences ÷ √n)
with n − 1 degrees of freedom, where n is the number of pairs. Typical uses include before-and-after studies, comparing two methods on the same samples, and testing twins or matched pairs.
For example, if five people's blood pressure readings were 200, 190, 210, 205 and 195 before a change and 195, 185, 200, 200 and 192 after, the differences are 5, 5, 10, 5 and 3, with a mean of 5.6. The paired test gives t ≈ 4.80 with 4 degrees of freedom and p ≈ 0.009.
One-sample t-test
A one-sample t-test compares a sample mean with a fixed value:
t = (sample mean − hypothesized mean) ÷ (s ÷ √n)
with n − 1 degrees of freedom. For example, if a machine should fill bottles with 500 ml on average, you could test a sample of bottles to see whether the average differs from 500.
Reading the result
- The t statistic measures the difference in units of its standard error. Larger values, positive or negative, mean stronger evidence of a difference.
- The p-value is two-tailed: the probability of a difference at least this large in either direction, if there were no real difference.
- The confidence interval gives a range of plausible values for the true difference. If a 95% interval doesn't include zero, the result is significant at the 5% level.
Always look at the size of the difference as well as the p-value. A statistically significant difference can be too small to matter, and a large, important difference can fail to reach significance if the sample is small.
Assumptions
- Independence: observations within each group are independent of one another.
- Roughly normal data, or a large enough sample. The t-test is fairly robust, especially with similar sample sizes, but very skewed data or extreme outliers in small samples can distort it.
- Continuous measurements, such as times, weights or scores.
If your data are very skewed or contain big outliers, consider a non-parametric test such as the Mann–Whitney U test or the Wilcoxon signed-rank test.
Who uses a t test calculator
Students use it for statistics courses and research projects. Researchers use it to compare treatments, groups and conditions. Analysts and marketers use it to compare averages, such as order values or time on site, between versions of a product. Quality engineers use it to check whether a process change shifted the average.
Need more customers from Google?
This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. That is the whole job of DeepRit: a PPC-only agency that sets up and runs Google Ads accounts so every click is accounted for. You keep full ownership of your account, get a written report every week, and can stop at any time. See our pricing or ask for a free audit.
Reporting a t-test
A typical report includes the means, the t statistic, degrees of freedom, p-value and a confidence interval. For example: "Scores were higher in group A (M = 22.3) than group B (M = 18.7), Welch's t(9.8) = 4.10, p = .002, 95% CI [1.65, 5.58]." Including an effect size, such as Cohen's d, helps readers judge how big the difference is.
Common mistakes
- Using an independent test on paired data, which throws away information and lowers power.
- Running many t-tests on the same data without adjusting for multiple comparisons.
- Ignoring outliers in small samples.
- Treating p > 0.05 as proof that the means are equal.
Effect size: Cohen's d
The t test calculator tells you whether a difference is statistically significant; an effect size tells you how big it is. The most common effect size for comparing two means is Cohen's d: the difference in means divided by a standard deviation. For two independent groups, a common version divides by the pooled standard deviation of the two samples. Jacob Cohen suggested rough benchmarks of about 0.2 for a small effect, 0.5 for a medium effect and 0.8 for a large one, though what counts as important depends on the field. In the two-sample example above, the standard deviations are about 2.0 and 1.2, so d is roughly 2.2, a very large effect.
Sample size and power
With small samples, a t-test can easily miss a real difference. Before running a study or experiment, decide the smallest difference that would matter to you and use the sample size calculator to estimate how many observations you need. Collecting data until the t test calculator happens to show p < 0.05 and then stopping inflates the false positive rate, so fix the sample size in advance where you can.
One-tailed tests
The t test calculator reports a two-tailed p-value, which tests for a difference in either direction. If you decided before collecting data that only one direction mattered, and the difference is in that direction, the one-tailed p-value is half the two-tailed one. You can also enter the t statistic and degrees of freedom in the p value calculator and choose a one-tailed test there.
Using the t test calculator for business data
Businesses use t-tests to compare average order values between two checkout designs, average handling times between two support processes, or average scores between two training methods. Paste the individual values for each group into the t test calculator rather than just the averages, because the test needs the spread of the data as well as the means.
Sources and further reading
- Student's t-test on Wikipedia: one-sample, paired and two-sample tests.
- Welch's t-test on Wikipedia: the unequal-variance test and its degrees of freedom.
- NIST/SEMATECH e-Handbook: Two-sample t-test for equal means, the reference description.
Frequently asked questions
Which t-test should I use?
Use a paired test for two measurements on the same subjects, Welch's test for two separate groups, and a one-sample test to compare one group with a fixed value.
Why use Welch's test instead of Student's?
It doesn't assume equal variances and performs well either way, so many statisticians recommend it as the default.
What does the p-value mean?
The chance of a difference at least this large if there were really no difference between the means.
How many data points do I need?
At least two per group, but larger samples give more reliable results and more power.
Can I paste data from a spreadsheet?
Yes. Copy a column of numbers and paste it into the sample box.
Is the t test calculator free?
Yes. It's free, needs no sign-up, and works in your browser.
Free PPC audit
See where your ad budget leaks.
We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.