For testing difference in means of two independent samples with n1 and n2, the number of items in the two samples, respectively, the t-statistic is computed with the following degree of freedom.
1
n1 + n2 - 1
2
n1 + n2 - 2
3
n1 + n2
4
n1 + n2 + 1