Professor Turing

Study guides · Other study skills

Z test or t test: how to know which to use

Last updated: 2026-12-01

Your problem gives you a mean or a percentage, a sample size and maybe a standard deviation, it is due tonight, and you can't tell whether it wants z or t. For a test about means, use z when the problem gives you the population standard deviation as known, and use t when you estimate the spread from your sample. Proportions usually take z, with a condition on the counts. Check what your problem compares before you pick a formula.

Start learning No account needed

1. Four questions to ask your problem

  1. What is being compared? If each observation is a yes or no and you are testing a share, such as the fraction who passed, you have a proportion. A z test fits when the observations are independent (for two groups, within and between them) and you expect at least 10 successes and 10 failures if the null hypothesis is true. For two separate groups whose proportions are tested as equal, check those counts in each group and compute the standard error with the pooled proportion, which is all successes divided by all cases. Use that pooled proportion for the expected counts too. If the counts are too small, the normal model is a poor fit, so check which other method your course uses. If each observation is a measurement and you are testing a mean, go on.
  2. One sample or two, and are they paired? One group compared with a stated number is a one-sample test. Two unrelated groups make a two-sample test. If each value in one list has exactly one partner in the other, such as two readings from the same person, subtract within each pair and run a one-sample test on the differences.
  3. Is the population standard deviation known? Look for where the number came from. A standard deviation you computed from this sample is an estimate, so use t. One that the problem states for the whole population, or tells you to treat as known, points to z. For two unrelated groups, the two-sample z test needs both population standard deviations.
  4. Is the sample large enough for the method? The observations need to be independent. For a t test with fewer than 30 observations, look for clear outliers. With 30 or more, look for particularly extreme ones. Strong skew can call for a larger sample than 30. In a paired test these checks apply to the differences, and with two groups they apply to each group.

For degrees of freedom, a one-sample t test uses n − 1, and a paired test uses the number of pairs minus 1. Two-sample courses differ. Some pool the spreads and use n1 + n2 − 2, some use the Welch formula, and some introductory ones take the smaller of n1 − 1 and n2 − 1. Use the version your course teaches.

If your problem compares three or more means, see what is ANOVA. If it counts how many cases fall in several categories, see what is a chi-square test.

2. Where sample size comes in

The t distribution has thicker tails than the normal, which allows for the extra uncertainty of estimating the spread. As the degrees of freedom grow, it gets closer to the normal. These are the two-sided cutoffs at alpha 0.05 for a one-sample test.

Sample sizet cutoffz cutoff
102.2621.960
302.0451.960
1001.9841.960

The gap between the cutoffs shrinks as the sample grows. If your assignment states a rule that allows z for large samples, apply it. Otherwise, an unknown population standard deviation means t at these sizes too.

When neither test fits

With a small sample, a z or t test about a mean relies on the population being roughly normal. Suppose you have fewer than 30 observations, you haven't seen the individual values and nothing tells you the population's shape. You can't support that condition, whether or not you know the population standard deviation. A nonparametric test, which doesn't assume a normal population, or more information is the honest next step. A nonparametric test needs the individual values or counts taken from them, and it has conditions of its own. If your problem says to treat the population as normal, that supplies the missing condition, and you can go back to choosing z or t by what you know about the population standard deviation.

A repair shop says its mean repair time is 45 minutes. A report on 8 randomly chosen repairs gives a mean of 52 minutes and a sample standard deviation of 13.8 minutes. It lists no individual times and says nothing about the shape of repair times. Which test do you use to ask whether the mean differs from 45 minutes?

Write down z, t or neither, with your reason, then open the answer.

Show the answer

Neither, on what the report gives you. The population standard deviation is unknown, so the z test is out. A t test with a sample this small needs a roughly normal population, and without the 8 values you can't check for clear outliers. You can still compute t = (52 − 45) / (13.8 / √8) = 1.43, which is inside the cutoff of 2.365 for 7 degrees of freedom, but the arithmetic doesn't show that the condition holds. Ask for the individual times.

Say the shop sends them, and they are 40, 46, 47, 48, 49, 50, 51 and 85 minutes. The 85 is a clear outlier, so the t test remains doubtful. A sign test is one nonparametric choice. It asks about the median, so your question becomes whether the median differs from 45 minutes. Seven times are above 45 and one is below. If the median were 45, a split at least this uneven in either direction would have probability 18/256 = 0.070. At alpha 0.05 you don't reject a median of 45. That doesn't show the median is 45, and it doesn't settle the question about the mean.

3. Worked decision: the bakery loaves

A bakery says its loaves average 500 g. A random sample of 40 loaves has a mean of 495 g and a sample standard deviation of 12 g. Test at alpha 0.05 whether the mean differs from 500 g.

  • Weight is a measurement and the claim is about a mean.
  • There is one group, compared with the stated 500 g.
  • The 12 g came from the 40 loaves, so the population standard deviation is unknown.
  • The sample is random and has 40 loaves. The problem shows no raw data, so you assume there are no particularly extreme weights.

The choice is a one-sample t test with 39 degrees of freedom. The statistic is t = (495 − 500) / (12 / √40) = −2.64. Its size, 2.64, is beyond the cutoff of 2.023, so you reject the claim of a 500 g mean. Here the z cutoff of 1.960 would lead to the same decision, but the method to write down is t.

4. Worked decision: two keyboards

Twelve randomly chosen students each type one passage on keyboard A and another of equal difficulty on keyboard B, in random order. You count the errors and ask whether the mean count differs between keyboards.

  • The outcome is a number of errors and the question is about means.
  • There are two lists, and each count on A has one partner on B from the same student, so the data are paired.
  • No population standard deviation of the differences is given.
  • There are only 12 differences, so you need to look at them for clear outliers before trusting the result.

The choice is a paired t test on the 12 differences, with 11 degrees of freedom. If 12 students had used A and 12 other students had used B, there would be no partners and you would use a two-sample t test. For the arithmetic of both, see what is a t test.

5. Test yourself

A filling machine's long-run records give a population standard deviation of 4 ml, and the problem says to treat it as known. Fill volumes are roughly bell-shaped. You measure 25 randomly chosen bottles and ask whether the mean fill is still 330 ml. Which test do you use?

Write down your choice and your reason for each of the four questions, then open the answer.

Show the answer

Use a one-sample z test. You are testing one mean against 330 ml, and the population standard deviation is known. The bottles are random and the volumes are roughly bell-shaped, so a sample of 25 is workable. The standard error is 4 / √25 = 0.8 ml. If the 4 ml had been computed from these 25 bottles, you would use a one-sample t test with 24 degrees of freedom.

The letter z also names a score for a single value, which is a different job from a test. See what is a z-score.

What the sources found, and their limits

NIST/SEMATECH e-Handbook of Statistical Methods, sections 7.2.2 and 7.3.1. NIST, the U.S. National Institute of Standards and Technology. Section 7.2.2 gives a t statistic for one mean when the standard deviation is not known and a z statistic when it is. Section 7.3.1 gives the pooled and Welch two-sample t statistics. Sources: 7.2.2, Are the data consistent with the assumed process mean? and 7.3.1, Do two processes have the same mean?, read on 2026-11-28.

NIST Dataplot Reference Manual, Sign Test. NIST. It says the t test may not be valid for non-normal populations, particularly with small samples, and describes the sign test as an alternative, stated in terms of medians and based on a binomial distribution. Source: sign test, read on 2026-12-01.

Introduction to Modern Statistics. Mine Çetinkaya-Rundel and Johanna Hardin, OpenIntro, second edition. It supports the proportion conditions and pooling, the independence and outlier checks, the thicker tails of the t distribution, the smaller degrees of freedom choice and the analysis of paired differences. Sources: single proportion, two proportions, single mean, two independent means and paired means, read on 2026-11-28.

Comparison of Two Means. Course notes on the Yale University statistics department website, in its 1997-98 course folder. It gives the two-sample z statistic for two normal populations with known standard deviations. Source: course page, read on 2026-11-28. Limits: these are introductory rules, and your course may set its own cutoffs for sample size or counts. We made up the four problems on this page and calculated the cutoffs, statistics and probability ourselves.

How Professor Turing helps

Professor Turing is a tutor for adults learning any subject, in college or on their own. It asks for your own answer first and works from your attempt, does not grade a bare guess, and, with a free account, keeps what you got wrong for your topic review. No account is needed to start.

Bring a topic you are studying, such as how to choose between a z test and a t test. If you start with a topic, it first asks a few short questions, including how familiar you are with it, before it teaches. If you give a worked-out value without your steps, it asks how you got there before saying whether it is right, and when you stay stuck it changes its approach and makes the next step smaller. Later in a session it can offer one optional check without hints, scored apart from the tutoring, so you can tell what you can do alone from what the tutor carried you through.

It does not hand you the answer before you have shown you can do the step, so your choice of test and your reason for it have to be your own. You must be 18 or older, and guest conversations are deleted 7 days after the last activity.

FAQ

Do I use a z test when the sample is larger than 30? A large sample does not turn a sample standard deviation into a known population one. With a mean and an unknown population standard deviation the statistic is t, and its cutoff moves close to the z cutoff as the sample grows. If your course tells you to use z for large samples, follow the rule your assignment is graded on and treat it as an approximation.

Which test do I use for a proportion? For one proportion, or two separate groups tested for equal proportions, the introductory textbook cited on this page uses a z test when the observations are independent and you expect at least 10 successes and 10 failures under the null hypothesis, in each group if there are two.

Start with what you're working on

Tell the tutor which topic you are studying and let it ask you the questions.

Start learning No account needed

See also: population and sample · hypothesis testing · all study guides