A t-test is used when the population standard deviation is unknown and the data are roughly normal. It uses the sample standard deviation and a t distribution, whose heavier tails account for added uncertainty—especially with small samples. Learn how this differs from a z-test and why categorical data call for another method.

Multiple Choice

When is a t-test used?

A t-test is used when you don’t know the population standard deviation and the population is normal (or close to normal). Since sigma is unknown, you estimate it with the sample standard deviation and use the t distribution, which has heavier tails to reflect the extra uncertainty from estimating sigma. This makes the test more reliable, especially with smaller samples. If sigma were known and the data are normal, you’d use a z-test instead. Data that are categorical aren’t analyzed with a t-test. Even with a very large sample, the key condition is that sigma is unknown; the t distribution approaches the normal as n grows, but the defining factor is not knowing the population standard deviation.

A t-test helps researchers decide whether a difference in average values is likely to reflect a real pattern or could reasonably be due to chance. It’s especially useful when the population’s standard deviation is unknown—a common situation, since measuring every member of a population is rarely possible. Instead, the researcher estimates that spread from a sample and accounts for the extra uncertainty with the t distribution.

The idea sounds technical, but it starts with a familiar question: are two group averages meaningfully different? That might mean comparing average plant growth under two conditions, or checking whether a group’s average commute time differs from a stated value. A t-test gives a structured way to assess the evidence.

Why the t distribution matters

A population has a true standard deviation, often written as σ. It describes how spread out values are across the whole population. But researchers usually don’t know σ. They have a sample, so they estimate the population spread using the sample standard deviation, written as s.

That estimate brings uncertainty. A sample may not capture the full range of variation in the population, especially when the sample is small. The t distribution accounts for this uncertainty by having heavier tails than the normal distribution. Put simply, it allows for a little more room for unusually high or low results.

When a sample is small, that extra room matters. As the sample grows, the t distribution becomes closer to the standard normal distribution. But the main reason to use a t-test isn’t simply that a sample is small. It’s that the population standard deviation is unknown and must be estimated from the data.

If σ were known and the relevant assumptions held, a z-test would generally be used instead. In real research, though, σ is often unknown, so t-based methods are common.

What a t-test actually calculates

A t-test compares an observed difference with the amount of variation expected under a particular assumption. The result is a t-statistic. In broad terms, it expresses how large the observed difference is compared with its estimated standard error.

A large t-statistic means the observed difference is large relative to the variation in the data. A small one means the difference is modest compared with that variation. The statistic is then considered alongside a t distribution, whose shape depends on degrees of freedom. Degrees of freedom reflect how much independent information is available to estimate the variation.

Researchers often use the t-statistic to calculate a p-value: the probability, under a specified null hypothesis, of observing a result at least as extreme as the one found. A p-value isn’t the probability that the hypothesis is true. It’s one piece of evidence, not a verdict handed down by a calculator.

A confidence interval can add useful context. Rather than giving a single estimated difference, it provides a range of values that are compatible with the sample data under the method’s assumptions. That range can show both the likely direction and the possible size of an effect.

Three common forms

The right form of t-test depends on how the measurements were collected.

One-sample t-test

A one-sample t-test compares the mean of one sample with a reference value. For instance, a researcher might ask whether the average weight of a batch of packaged goods differs from the label value. The sample mean is compared with that reference, while the sample standard deviation estimates population variability.

Independent two-sample t-test

An independent two-sample t-test compares the means of two separate groups. The groups might be people in two different neighborhoods, or crops grown using two different methods. Each observation belongs to one group, not both.

There are two common versions. Student’s two-sample t-test assumes the groups have equal population variances. Welch’s t-test does not make that assumption and adjusts its degrees of freedom to reflect differences in variability and sample size. Welch’s version is often a sensible choice when equal variances aren’t well supported; it’s widely available in software such as R, Python, and spreadsheet tools.

Paired t-test

A paired t-test is used when observations come in linked pairs, such as measurements taken from the same people at two points in time. It doesn’t treat the two sets as unrelated groups. Instead, it calculates the difference within each pair, then assesses the average of those differences.

That distinction matters. If the same person’s measurement is recorded before and after a change, the two values share personal characteristics. Pairing uses that connection rather than ignoring it.

The assumptions behind the method

A t-test is not a universal tool for every set of numbers. Its assumptions help determine whether the result is trustworthy.

First, observations should be independent in the way the chosen method requires. In an independent two-sample t-test, one person’s value shouldn’t determine another person’s value, and the groups should be genuinely separate. In a paired t-test, the pairs are linked, but the differences between pairs should generally be independent of one another.

Second, the data—or, more precisely, the relevant values or differences—should come from a population that is roughly normal, particularly when samples are small. For a one-sample test, this refers to the population behind the sample. For a paired test, it refers to the within-pair differences. For an independent two-sample test, each group’s values should be reasonably well behaved, especially if the group sizes are modest.

T-tests can be fairly robust to mild departures from normality, particularly with larger samples and no extreme outliers. Still, a large sample doesn’t make every issue disappear. Strong skew, influential outliers, or clustered observations can distort results. A quick look at a plot—such as a histogram or box plot—can reveal features that a formula won’t flag on its own.

For the classic two-sample Student’s t-test, the groups are also assumed to have equal population variances. Welch’s t-test relaxes that condition, which is one reason it’s often preferred when the groups differ in spread or size.

Why sample size alone doesn’t decide

It’s tempting to think that a large sample automatically calls for a z-test, or that a small sample automatically calls for a t-test. The key distinction is more specific: is the population standard deviation known, or is it estimated from the sample?

When σ is unknown, the t distribution is the natural choice for inference about a mean, whether the sample is small or large. With a large sample, t and normal results often look very similar because the t distribution approaches the normal curve as degrees of freedom increase. The choice of distribution may matter less numerically, but the underlying reasoning remains the same.

That’s a useful detail to remember: sample size affects the shape of the t distribution and the precision of an estimate, but it doesn’t turn an unknown population standard deviation into a known one.

When another method may fit better

A t-test focuses on means, so it’s not suited to every kind of data. Categorical outcomes—such as yes/no responses or product categories—usually call for methods designed to compare counts or proportions. A t-test also may not be a good fit when the data contain severe outliers or when observations are heavily dependent.

Researchers should also distinguish statistical significance from practical importance. A very small difference can produce a low p-value when the sample is large, even if that difference has little real-world effect. Conversely, a meaningful difference may not be estimated precisely from a small or highly variable sample. Reporting the estimated difference and its confidence interval helps keep the focus on size and uncertainty, not just a threshold.

A small tool with a clear job

A t-test is most useful when the question concerns a mean, the population standard deviation is unknown, and the data meet the assumptions of the chosen version reasonably well. The t distribution adds a cushion for the uncertainty that comes from estimating variability, especially in smaller samples.

Choose the form that matches the study design: one sample against a reference value, two independent groups, or paired measurements. Then inspect the data, consider the assumptions, and read the result in context. The arithmetic matters, but so does the story of how those numbers were collected.