Are the two population standard deviations known? Use the two sample z test calculator instead.
How to Use the Two Sample T Test Calculator
This calculator helps you determine whether there is a significant mean difference between two independent samples, assuming the pooled variance assumption is met. The tool allows you to enter either summary data or raw data and get instant results, with a clear, step-by-step solution.
To use the calculator:
- Select the alternative hypothesis that matches your research question.
- Enter the significance level, α.
- Choose Summary Data or Raw Data.
- Enter the information for both samples.
- Click Calculate.
The calculator will instantly return the test statistic, p-value, and critical value for the test. It will also provide a clear, step-by-step solution, showing you exactly how to perform an independent sample t-test by hand using the 6 steps of hypothesis testing.
Tip.
- Select the summary data option if you have summary information such as the sample mean of each group, sample standard deviation of each group, and sample size for each group.
- However, if you have raw data values for both groups, select the raw data option and enter the values into the data input fields. You can enter values separated by commas, spaces, line breaks, or tabs. You can also copy and paste values directly from Excel, Google Sheets, or even text documents.
Recall. This calculator is only appropriate when the homogeneity of variance assumption is met. However, if the variances are assumed to be unequal, consider using the Welch’s t-test calculator.
Not sure whether the homogeneity of variance assumption is met? Use the F-test calculator to test for the equality of variance.
What Is a Two Sample T Test?
A two sample t test or the independent samples t test is a hypothesis test used to determine whether the means of two independent populations are significantly different.
Therefore, you should use a 2 sample t test whenever you want to determine whether there is a significant mean difference in a single dependent variable between two independent groups. Some common scenario where this test is appropriate are:
- Mean examination scores for two teaching methods
- Average blood pressure for treatment and control groups
- Mean production output from two machines
- Average waiting times at two service centers
- Mean product weights from two factories
Recall. The test is also referred to as the unpaired t-test, pooled two sample t-test, or independent t-test.
Hypotheses in Two Sample T Test
In a two sample t test, we want to test the null hypothesis:
H0: μ1 = μ2 (The mean between the two groups are equal). This is sometimes written as: H0:μ1– μ2 = 0
However, the alternative hypothesis can be either of these:
- Two-tailed. H1:μ1≠ μ2 (The two groups are significantly different).
- Right Tailed test. H1:μ1> μ2 (The mean of Group 1 is significantly greater than that of Group 2).
- Left-Tailed Test. H1:μ1< μ2 (The mean of Group 1 is significantly smaller than that of Group 2).
Tip. In most independent sample \(t\)-tests, the alternative hypothesis is two-tailed (non-directional).
Two Sample T Test Assumptions
Before using a pooled two sample t-test, make sure the following assumptions are met:
- You have a single dependent variable measured on a continuous scale. Examples include income, height, weight, etc.
- There are two independent groups.
- The observations within each sample are independent.
- The data is approximately normally distributed.
- The population variances are equal (homogeneity of variance assumption is met).
Two Sample T Test Formula
The test statistic formula for a two-sample t-test (assuming equal variances) is:

Where:
- t is the test statistic
- x̄1 is the mean of Group 1
- x̄2 is the mean of Group 2
- sp is the pooled standard deviation
- n1 and n2 are the sample sizes of Group 1 and Group 2 respectively.
The pooled standard deviation formula is:

Where:
- sp is the pooled standard deviation
- s1 and s2 are the sample standard deviations for Group 1 and 2, respectively
- n1 and n2 are the sample sizes
Remember. You can easily get pooled standard deviation by taking the square root of pooled variance. However, if the two-sample t-statistic formula uses the pooled variance instead, the pooled variance calculator might be helpful.
How do You perform a Two Sample T Test
To perform a two-sample t-test manually, assuming that the variances are equal, you only need to follow the 6 steps of hypothesis testing. To help you understand, let’s consider the following example.
Example
A researcher wants to compare examination scores for two independent teaching methods. A sample of 15 students taught using Method 1 has a mean score of 78.4 and a sample standard deviation of 6.2. A separate sample of 13 students taught using Method 2 has a mean score of 72.1 and a sample standard deviation of 5.8. At the 0.05 significance level, is there evidence that the two population means are different? (Assume equal population variances)
Solution
From the question, we have summary data. In particular, we know that:
- Sample size of Group 1, n1 = 15
- Mean of Group 1, x̄1= 78.4
- Sample standard deviation of Group 1, s1= 6.2
- Sample size of Group 2, n2 = 13
- Mean of Group 2, x̄2= 72.1
- Sample standard deviation of Group 2, s2= 5.8
To conduct the independent sample t-test manually using the above summary data, follow these steps:
Step 1: State the hypotheses
The researcher wants to determine whether the two population means differ in either direction. Therefore, this is a two-tailed test.
The hypotheses are:
- H0:μ1= μ2 or H0:μ1– μ2 = 0
- H1:μ1 ≠ μ2 or H1:μ1 – μ2 ≠ 0
Step 2: State the significance level
From the question, we need to test the hypothesis at 0.05 significance level. Thus, α = 0.05
Step 3: Calculate the test statistic
By definition, the test statistic formula for a two-sample t-test is: t = (x̄1-x̄2)/sp√(1/n1+1/n2)
Thus, we need to first find the pooled standard deviation.
By definition, sp = √[(n1-1)s12+ (n2-1)s22]/(n1+n2-2)
Substituting the values into the formula gives:
sp = √[(15-1)6.22+ (13-1)5.82]/(15+13-2)
=√941.84/26
=6.01869
You can also verify the value using the pooled standard deviation calculator.
Since, we now have all the required values, we can now compute the test statistic. Substituting the values into the formula gives:
t = (78.4 -72.1)/6.01869√(1/15+1/13)
=6.3/2.2807
=2.7623
Step 4: Find the p-value and critical value
Using the the p-value calculator from t, the two-tailed p-value for the test is 0.010394. Also, using the critical t value calculator, the two-tailed critical value for the test is: t0.05/2, 26 =±2.0555
Recall. in the formula, t0.05/2, 26, 26 are the degrees of freedom for a two-sample t-test assuming equal variances. You can find this using the formula: df = n1+n2-2 or simply using the degrees of freedom calculator.
Step 5: Make the decision
Since the p-value (0.010394) is less than the significance level, we reject the null hypothesis. Alternatively, since the test statistic (2.7623) is greater than the absolute critical value (2.0555), we reject the null hypothesis.
Step 6: Write the conclusion
At the 0.05 significance level, there is sufficient evidence to conclude that the population mean examination scores for the two teaching methods are different.
Using the Calculator
You can also verify the results using the two sample t test calculator and following these simple steps:
- Select the alternative hypothesis as: H1:μ1 – μ2 ≠ 0
- Enter the significance level, α = 0.05.
- Choose Summary Data
- Enter n1 = 15, x̄1= 78.4, s1= 6.2, n2 = 13, x̄2= 72.1, and s2= 5.8
- Click Calculate.
The calculator will instantly return similar results and show you the manual steps shown above.
Frequently Asked Questions
It tests whether the means of two independent populations differ when the population variances are assumed to be equal. It returns the t statistic, p-value, and critical value and show you how to perform the test manually using the 6 steps of hypothesis testing.
Yes. The terms two sample t test, independent samples t test, independent t test, and unpaired t test commonly refer to procedures for comparing the means of two unrelated groups.
Yes. The pooled formula allows n₁ and n₂ to be different. The pooled variance weights each sample variance according to its degrees of freedom.
The traditional pooled two sample t test combines the two sample variances into one estimate of a common population variance. This calculation is valid when the population variances can reasonably be treated as equal.
Use Welch’s t test. It does not pool the variances and uses a different standard-error and degrees-of-freedom calculation.
