TTKTheTextKit

t-Test Calculator

Paste your data and choose the test: a one-sample t-test against a value, a two-sample test for separate groups (Welch's or the pooled version), or a paired test for before and after measurements. You get the t statistic, the degrees of freedom, the p-value for a two-sided or one-sided test, a confidence interval, Cohen's d and a plain sentence about the result. Everything runs in your browser.

t statistic
-1.8608
Degrees of freedom
17.776
p-value
0.07939
Two-sided
Difference of means
-1.58
95% interval
-3.365 to 0.2055
Two-sided, for the line above
Cohen's d
-0.8322
Effect size

The p-value 0.07939 is not below 0.05, so the data do not give enough evidence that the mean differs from the second sample.

SamplenMeanStd dev
Sample 1100.751.789
Sample 2102.332.0022

A t-test asks whether a difference in averages is bigger than chance alone would usually produce. The one-sample test compares a mean with a fixed value, the two-sample tests compare two separate groups, and the paired test compares two measurements on the same subjects, such as before and after. Welch's version does not assume the groups have equal spread and is the safer default, while the pooled version assumes they do. The p-value is the chance of a result at least this extreme if there were no real difference. It is not the chance that the hypothesis is true. The tests assume roughly bell-shaped data or a fair number of values. The example is Student's sleep data from R's documentation. Everything is worked out in your browser.

Related Tools

[5 suggestions]

About the t-Test Calculator

A t-test asks whether a difference between averages is larger than chance alone would usually give. The t statistic is the difference divided by its standard error, and the p-value is the chance of a t value at least that extreme if there were really no difference. A small p-value, below a chosen level such as 0.05, is evidence of a real difference. It is not the chance that the hypothesis is true. The one-sample test compares a mean with a fixed value. The two-sample tests compare two separate groups: Welch's test does not assume the groups have equal spread and uses adjusted degrees of freedom, and the pooled version assumes equal variances and uses n1 plus n2 minus 2. The paired test works on the differences between two measurements of the same subjects. The calculator uses the classic sleep data from R's documentation as its example, ten patients on two drugs. Welch's test gives t = -1.8608 with 17.776 degrees of freedom and p = 0.07939, the pooled test gives p = 0.07919, and the paired test, which uses the pairing, gives t = -4.0621 with 9 degrees of freedom and p = 0.002833. The same data can be unconvincing or convincing depending on the right test, which is why the choice matters. The confidence interval is for the difference in means, and Cohen's d measures the size of the effect in standard deviations. The tests assume roughly bell-shaped data or a fair number of values, and independent observations.

Which t-test should I use?▾

Use a one-sample test to compare one group with a known value, a paired test when the same subjects are measured twice, and a two-sample test for two separate groups. For two groups, Welch's test is the safer default.

What is the difference between Welch and pooled t-tests?▾

The pooled test assumes both groups have the same variance. Welch's test does not, and adjusts the degrees of freedom. When variances are equal they give nearly the same answer, and when they differ Welch's is more reliable.

What does the p-value mean?▾

It is the probability of getting a difference at least as large as yours if the true difference were zero. A p-value below 0.05 is the usual threshold for calling a result statistically significant. It does not give the probability that the hypothesis is true.

When do I use a paired t-test?▾

When each value in one list is linked to a value in the other, such as before and after measurements on the same people. It tests whether the average difference is zero, and is more powerful than a two-sample test on paired data.

Is my data uploaded?▾

No. The calculation runs in your browser and nothing you enter is sent anywhere.