When to Use a T-Test (and Which One)

You have two groups or a group against a target value. Should you run a t-test? And if so, which of the three variants fits your data?

Key takeaways:

  • Three t-tests exist: one-sample (one group vs. a value), independent-samples (two unrelated groups), paired (two related groups).
  • All require roughly normal data or n ≥ 30 per the Central Limit Theorem, independence of observations, and an interval or ratio outcome.
  • If your data is non-normal and n < 30, or you have >2 groups, or unequal variances (without Welch correction), you need a different test.
  • Use the t-test calculator to run your test once you know the variant. For help choosing, work through the checklist below.
  • No signup
  • Works offline
  • Decision checklist

§1The three t-tests and when each applies

A t-test compares means. But "comparing means" covers three distinct scenarios. You need to identify which one matches your study design before you run the test. The table below shows the core differences.

Scenario Which t-test Example research question Sample setup Data structure Null hypothesis
You have one group and want to know if its mean differs from a known or hypothesized value. One-sample Do students in our school have a mean IQ different from 100? n = 45 students; you know the population mean is 100. One column of scores. H₀: μ = 100 (the group mean equals the target).
You have two separate groups (no matching between individuals) and want to know if their means differ. Independent-samples Do students taught with method A score higher than those taught with method B? n₁ = 30 (method A), n₂ = 35 (method B); groups are independent. Two columns; one row per observation. No pairing. H₀: μ₁ = μ₂ (the two group means are equal).
You measure the same individuals twice (before–after, matched pairs, or repeated measures) and want to know if the mean difference is zero. Paired Does cognitive therapy reduce anxiety scores for the same clients before and after treatment? n = 28 clients; each has a before and after score. Two columns; each row is one person's pair. Row order matters. H₀: μ_diff = 0 (the mean of the differences is zero).
You have one group and the sample size is small (n < 30) but the data are clearly normal. One-sample Production line output is supposed to average 500 mL. Did today's batches drift? n = 12 batches; measurements are continuous and symmetric. One column of measurements. H₀: μ = 500 mL.
You have two matched groups (twin studies, case-control, husband–wife pairs) and they are small. Paired Are identical twins' IQ scores more similar than fraternal twins? n = 20 pairs; one twin per pair gets condition A, the other condition B (or you measure naturally matched pairs). Two columns, one row per pair. H₀: μ_diff = 0.
You have two unrelated groups, both are small, and you must verify equal variances or use Welch correction. Independent-samples (Welch) Do patients on drug X recover faster than those on placebo? n₁ = 15 (drug), n₂ = 12 (placebo); groups are independent and variances look unequal. Two columns; Welch adjustment applied automatically. H₀: μ₁ = μ₂.

How to read this table. Find the row that describes your data. If you have one sample and one target value, use the one-sample test. If you have two independent groups (nobody appears in both), use the independent-samples test. If each observation in one group is paired with (related to) exactly one observation in the other group, use the paired test.

§2When a t-test is the wrong choice

Even when you have the right number of groups and the right pairing structure, a t-test can be the wrong tool. Watch for these red flags:

Your data are non-normal and n < 30

The Central Limit Theorem says the t-test stays robust even with non-normal data if n ≥ 30. Below that, non-normality matters. If your data are skewed, bimodal, or have heavy tails, and your sample is small, a non-parametric alternative like the Mann–Whitney U test is safer. Mann–Whitney U does not assume normality; it tests whether the distributions differ in location.

You have more than two groups to compare

Do not run multiple t-tests (e.g., A vs. B, A vs. C, B vs. C). This inflates your false-positive rate. Instead, use ANOVA, which tests whether any group mean differs from the others in a single test. If ANOVA is significant, you can then run post-hoc tests to identify which pairs differ.

Your groups have very unequal variances

The independent-samples t-test assumes the two groups have similar variance (spread). If one group has much higher variance than the other, the test's Type I error rate can drift. The good news: Welch's correction, which adjusts the degrees of freedom, is now standard in most software and is built into our t-test calculator. If you are unsure, use Welch's version.

Your outcome is binary (yes/no, success/failure) or a proportion

If you are comparing proportions (e.g., % of patients who recovered in each group), do not use a t-test. Use a two-sample z-test for proportions instead. The t-test is for continuous interval or ratio outcomes, not counts or percentages.

§3Checklist before you run it

Before you input your data into the calculator, run through this checklist. If any item fails, reconsider whether a t-test is appropriate.

  1. Independence of observations. Each data point comes from a different person, item, or time point (except in a paired test, where the pairing is intentional). You cannot use a t-test if multiple measurements come from the same individual and are not part of the planned pairing.
  2. Outcome is interval or ratio scale. Your measured variable is continuous (height, time, reaction speed, test score) or at least ordinal with enough levels to treat as continuous. You cannot use a t-test for categorical data (e.g., color, disease yes/no).
  3. Data are roughly normal, or n ≥ 30. Plot your data or run a formal normality test (Shapiro–Wilk, Anderson–Darling). If you see strong skew, heavy tails, or discrete chunks and your n < 30, consider Mann–Whitney U instead. If n ≥ 30, the t-test is robust even with mild non-normality.
  4. For independent-samples t-test only: check for equal variances (or plan to use Welch correction). Levene's test is one formal check, but a rough visual inspection works too: if one group's spread is more than about two or three times the other's, flag it. Modern practice is to use Welch's version by default, which does not assume equal variances. Our calculator applies this by default.
  5. You have identified the correct t-test variant. Use the table in §1 above. One sample compares one group to a value. Independent-samples compares two unrelated groups. Paired compares two related measurements.
  6. You are testing one hypothesis. If you have multiple research questions (e.g., "Do men differ from women, and do younger differ from older?"), you need multiple tests or a more complex model (like regression or ANOVA). Running many t-tests on the same data without correction inflates false positives.

§4Worked example: choosing the right variant

Scenario: A physical therapist wants to know whether 8 weeks of a new upper-body strengthening protocol improves grip strength. She measures grip strength (in kg) for 22 patients at the start of the study and again 8 weeks later. She wants to test whether the mean improvement is real.

Decision:

  1. How many groups? One group of patients, measured twice. (Not two separate groups.)
  2. Are the measurements paired? Yes. Each of the 22 patients has a before and after score. The therapist will compute a difference score for each patient.
  3. Conclusion: Use a paired t-test.

Why not independent-samples? The same 22 people appear in both measurements. It is not 22 people in one group and a separate 22 in another; it is 22 pairs.

Assumptions check:

  • Independence: Each patient's measurements are independent from others. ✓
  • Continuity: Grip strength is measured in kg, a continuous ratio scale. ✓
  • Normality: With n = 22, the differences should be roughly normal. A Q–Q plot would confirm. Assuming they are, proceed with the paired t-test. ✓

Next step: Compute the difference score for each patient (post − pre). Run a one-sample t-test on those 22 differences, testing whether the mean difference is zero. (This is mathematically equivalent to a paired t-test and is how many statistical packages implement it.)

§5Frequently asked questions

Can I use a t-test with a small sample?

Yes, if your data are roughly normal. The t-test was designed for small samples (that is why it uses the t distribution instead of the normal distribution). However, normality becomes more important at small sample sizes. If n < 30, plot your data or run a normality test. If you see strong skew or outliers, a non-parametric test like Mann–Whitney U is safer. With n ≥ 30, the t-test is robust to violations of normality, thanks to the Central Limit Theorem.

T-test vs. z-test — which do I use?

Use a t-test when you do not know the population standard deviation. You estimate it from your sample, which introduces extra uncertainty, hence the wider t distribution. Use a z-test when the population standard deviation is known (rare in practice) or when you are testing proportions. In practice, most one-sample and two-sample tests of means use the t-test. The z-test appears mainly in the context of proportions (e.g., comparing % recovered between two groups) or when you have a very large sample and the t and z distributions are nearly identical.

What if my data are skewed or have outliers?

If n ≥ 30, the Central Limit Theorem protects you: the mean itself will be approximately normal even if individual data points are skewed. Go ahead with the t-test. If n < 30 and your data are strongly skewed, or if you have extreme outliers, consider a non-parametric alternative: Mann–Whitney U for independent samples or the Wilcoxon signed-rank test for paired samples. Alternatively, you might transform your data (e.g., log-transform) to reduce skew, then run the t-test on the transformed scale.

One-tailed or two-tailed t-test?

Use a two-tailed test unless you have a strong reason to predict the direction of the difference before seeing the data. Two-tailed tests are the default: you are testing whether the means differ, not whether one is specifically higher or lower. One-tailed tests are riskier because they commit all of your significance budget to one direction. If the effect goes the opposite way, you will miss it entirely, even if the magnitude is large. Specify the direction in your pre-registered hypothesis only if you have compelling theory or prior data.

Can I use a t-test to compare proportions?

No. If your outcome is a proportion (e.g., % passing a test, % recovered from an illness), use a two-sample z-test for proportions instead. The t-test assumes your outcome is a continuous measurement, not a binary or count variable. Proportions have their own distribution (binomial), and the z-test is designed for that family of hypotheses.

What if the t-test says my groups differ, but I see overlap in the data?

A significant p-value means the difference in means is unlikely under the null hypothesis (if the true means were equal). It does not mean every member of one group scores higher than every member of the other. Overlap is normal and expected. What matters is the mean, and whether that difference is large enough that random variation alone is unlikely to explain it. Consider also reporting the effect size (e.g., Cohen's d) and a confidence interval for the difference, not just the p-value. These give a fuller picture than a yes/no significance verdict.

§6Sources

Methodological references:

Related tools: