One-tailed vs two-tailed t-test
A two-tailed test looks for a difference in either direction. A one-tailed test looks in one direction only, chosen before seeing the data. Choosing after looking, or halving p when the effect went the wrong way, gives misleading results.
Sources checked on November 21, 2026. Results computed by the site's engine and tested against R and SciPy.
The difference in one picture
For a two-tailed test at 5%, the rejection region is split: 2.5% in each tail of the t distribution. For a one-tailed test, all 5% sits in the predicted tail. So with 10 df, a two-tailed test needs |t| above 2.228, while an upper one-tailed test needs t above 1.812. The one-tailed test finds effects in its chosen direction more easily and cannot find effects in the other direction at all.
Worked example: the sleep data
In Student's paired sleep data, the mean difference (drug 1 minus drug 2) is −1.58 hours and t = −4.0621 on 9 df.
| Alternative hypothesis | p-value |
|---|---|
| Two-sided: the drugs differ | 0.0028 |
| One-sided: drug 1 gives less extra sleep | 0.0014 |
| One-sided: drug 1 gives more extra sleep | 0.9986 |
When t falls in the predicted direction, the one-sided p is half the two-sided p. When t falls in the other direction, the one-sided p is 1 minus half the two-sided p: here 0.9986. A common mistake is to report half the two-sided p regardless of direction. That would turn a result strongly against the hypothesis into a "significant" one.
When a one-tailed test is justified
- The direction was stated in advance, in a protocol, preregistration or grant, before any data were seen.
- An effect in the other direction would lead to the same action as no effect. For example, a quality check only cares whether bottles are underfilled.
- You are willing to call any result in the other direction not significant, however large.
If you would have reported a surprising effect in the opposite direction, you were really running a two-tailed test, and a one-tailed p overstates the evidence. Many journals and reviewers expect two-tailed tests unless the case for one tail is made explicitly.
One-tailed tests and confidence intervals
A one-sided test at 5% matches a one-sided 95% confidence bound, which has a limit on one side only. It also matches the two-sided 90% interval's relevant end. Our calculators show the two-sided interval in the main result and the one-sided bound in the notes when you choose a one-sided alternative. For the sleep data, the one-sided 95% upper bound for the mean difference is −0.8670.
How software handles direction
In R, set alternative = "less" or "greater"; the direction refers to the first group minus the second. In SciPy, the alternative argument works the same way for ttest_ind, ttest_rel and ttest_1samp. Swapping the order of the groups flips the sign of t and swaps "less" and "greater". The R and Python code under each result on this site keeps the order you entered.
A simple rule
Decide the direction before you see the data. If you are not sure, use two tails. Never halve a two-sided p without checking that t points the way you predicted.
Sources
- R source code, stats package, t.test.R checked November 21, 2026
- SciPy documentation: scipy.stats.ttest_ind checked November 21, 2026