T Test Calculator

By Easy Stat CalcLast updated December 3, 2026

This free t test calculator is an online t test calculator that runs a one-sample, two-sample (independent) or paired t test, so it works as a student t test calculator (or Student’s t test calculator), a paired t-test calculator and a two sample t test calculator in one tool. Paste raw data from Excel or enter the mean, standard deviation and sample size, choose Welch or pooled variances, set the tail and alpha, and press Calculate. You get the t statistic, degrees of freedom, exact p-value, confidence interval, Cohen’s d, a plain decision, a shaded curve, the step-by-step working and a sentence you can paste into a report. Not sure which test you need? Press Help me choose.

Loading calculator…

What is a t test?

A t test checks whether an average (a mean) differs from a given value, or whether the means of two groups differ, by more than chance would explain. It was published in 1908 by William Sealy Gosset, a statistician at the Guinness brewery in Dublin who wrote under the pseudonym “Student”, which is why it is also called Student’s t-test. Gosset needed a way to judge small samples when the population standard deviation is unknown, and the t test is still the standard answer to that problem.

The idea is a signal-to-noise ratio. The t statistic (also called the t score or t value, and the observed t or t observed once you have your data) is the test statistic for this test. To find the test statistic, divide the difference you observed by its standard error, the typical size of random variation in that difference. A large t, positive or negative, means the difference is big compared with the noise. The p-value then tells you how often a t at least that extreme would turn up if the null hypothesis, usually “no difference”, were true. So what does a t test tell you? Whether your data give enough evidence against the null hypothesis, and with the confidence interval and effect size, how large the difference is.

Use a t test, which is a test of means, when the outcome is a number (a score, a weight, a time), you have one or two groups, and the groups are small or the population standard deviation is unknown. With three or more means you need ANOVA instead. For counts in categories you need a different test, such as the chi-square test.

Which t test do I need?

There are three types of t tests, and the right one depends on how your data were collected, not on the numbers.

Decision chart: one group leads to the one-sample t test; two groups lead to the paired or two-sample t test
Figure 1. Choosing between the one-sample, paired and two-sample t test.
The three types of t test and when to use each
TypeUse it whenDegrees of freedom
One-sample t testOne group is compared with a known or claimed value, for example a batch average against a 500 mg label.n − 1
Paired t test (dependent samples)The same subjects are measured twice, such as before and after, or matched pairs.pairs − 1
Two-sample t test (independent samples, unpaired)Two separate groups, with different people or items in each.Welch: estimated, pooled: n₁ + n₂ − 2

Within the two-sample case there are two versions. Welch’s unpaired t test does not assume the two groups have equal variances, and it is the default here because it loses almost nothing when the variances are equal and protects you when they are not. The pooled (equal variances) test, also called Student’s two-sample test, combines the two variances and assumes they are the same. The calculator shows both side by side so you can see how much the choice matters.

An independent samples t test is the same thing as a two-sample or unpaired t test (a t test for two means from separate groups), and a dependent t test (dependent samples) is the same thing as a paired sample t test or paired samples t test. A one-sample t test is also called a single sample t test. A matched pairs t test is another name for the paired t test: each subject, or each matched partner such as a twin or a matched patient, is measured in both conditions, and the analysis uses the difference within each pair (this set-up is called a matched pairs design). In the paired vs unpaired t test choice, the question is always whether each value in one group has a partner in the other. That is the difference between paired and unpaired data. Paired data have a natural partner for every value, and unpaired data come from separate groups, so unpaired vs paired t test is decided by how the data were collected. If you answer the two questions in the Help me choose box, it sets the right mode for you.

How to use the t test calculator

The same tool covers every common version. Use One-sample as a one sample t test calculator (also called a 1 sample t test calculator), Two-sample as a two sample t test calculator (a 2 sample t test calculator) or independent samples t test calculator, independent t test calculator or unpaired t test calculator (Welch’s t test calculator when you keep Welch), and Paired as a paired t test calculator, including a paired t test calculator with mean and SD when you only have summary statistics for the differences. It is a t test calculator with mean and SD input as well as raw data, and a t test calculator for 2 dependent means when you choose Paired. The steps are:

  1. Choose One-sample, Two-sample or Paired, or let the Help me choose questions pick it.
  2. Choose the input format: Raw data or Summary statistics.
  3. For raw data, type or paste the values, separated by spaces, new lines or semicolons, and use a point for decimals. Pasting two Excel columns into the first box splits them into group 1 and group 2. For paired data you can instead tick that you already have the differences. For summary statistics, enter the mean, standard deviation and n of each group. For a paired test the standard deviation must be the SD of the differences, not of each measurement.
  4. For a one-sample test, enter the value you are comparing with (the hypothesized mean). There is no default, so it is never assumed to be zero.
  5. For a two-sample test, keep Welch or switch to pooled variances.
  6. Pick the alternative hypothesis (two-tailed, right-tailed or left-tailed), so the tool works as a two tailed t test calculator or a one tailed t test calculator (including a two tailed paired t test) and alpha (0.10, 0.05, 0.01 or your own value between 0.0001 and 0.5).
  7. Press Calculate. You get t, degrees of freedom, p-value, mean (or mean difference), standard error, confidence interval, critical t, Cohen’s d and Hedges’ g, a Welch and pooled comparison, descriptive statistics, an assumption check for raw data, the working, a plain-English reading and a sentence in APA style.

The tool takes up to 5,000 values per group. A decimal comma such as 1,5 is stopped with a message instead of being read as two numbers, because it would silently change your result. Nothing you enter is saved or sent anywhere, and the page address updates so you can share a link to your result.

T test formulas

The t test equation is always the same idea: every t test divides a difference in means by a standard error. The symbols are: x̄ the sample mean, μ₀ the value being tested, s the sample standard deviation, n the sample size, d̄ the mean of the paired differences, and s_d the standard deviation of those differences.

t statistic and degrees of freedom formulas for each t test
Testt statisticDegrees of freedom
One-samplet = (x̄ − μ₀) / (s / √n)n − 1
Pairedt = d̄ / (s_d / √n)n − 1 (n is the number of pairs)
Two-sample, Welcht = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)(s₁²/n₁ + s₂²/n₂)² / [ (s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1) ]
Two-sample, pooledt = (x̄₁ − x̄₂) / (s_p × √(1/n₁ + 1/n₂))n₁ + n₂ − 2

The one sample t test formula and the paired t test formula have the same shape, because a paired test is a one-sample test on the differences. The independent samples t test formula (the two sample t test formula, or 2 sample t test formula) comes in the Welch version, also called the unequal variance t test, and the pooled version, also called the equal variance t test. The pooled standard deviation is s_p = √[ ((n₁ − 1)s₁² + (n₂ − 1)s₂²) / (n₁ + n₂ − 2) ]. The Welch degrees of freedom formula is the Welch–Satterthwaite approximation (so Welch’s test is also called the Welch t test, the Welch test or the Satterthwaite t test), which is why Welch’s df is usually not a whole number and is never larger than n₁ + n₂ − 2. The confidence interval for a difference is the estimate ± t* × the standard error, where t* is the critical t for your alpha and df. The effect size Cohen’s d is the mean difference divided by the pooled SD (for paired data, by the SD of the differences, written d_z), and Hedges’ g multiplies d by 1 − 3/(4 × df − 1) to correct its small-sample bias.

Worked example 1: two sample t test with Welch’s t test (summary statistics)

This first t test example shows how to solve an independent t test by hand, so you can compare it with the calculator.

A team times how many minutes it takes new staff to finish the same task after one of two training methods. Method A: n = 12, mean 14.8, SD 2.1. Method B: n = 15, mean 16.9, SD 3.4. The question is whether the average time differs (two-tailed, alpha = 0.05).

  1. Hypotheses. H₀: μ₁ = μ₂. H₁: μ₁ ≠ μ₂.
  2. Standard error: √(2.1²/12 + 3.4²/15) = √(0.3675 + 0.7707) = 1.0669.
  3. t = (14.8 − 16.9) / 1.0669 = −1.968.
  4. Welch degrees of freedom: 23.68.
  5. Two-tailed p-value: 0.0608. The critical t for 23.68 df at alpha = 0.05 is ±2.065.
  6. 95% CI for the difference: −4.30 to 0.10. Cohen’s d = −0.72 (medium) and Hedges’ g = −0.70.
t distribution with 23.68 degrees of freedom, observed t of minus 1.968 and both tails shaded, p equals 0.0608
Figure 2. The shaded area is the p-value: both tails beyond ±1.968.

Because 0.0608 is above 0.05, you fail to reject H₀. The observed t of −1.968 sits just inside the critical value of −2.065, and the interval includes 0. The pooled version of the same data gives t = −1.869, df = 25 and p = 0.0733, so the conclusion does not change. In a report: Welch’s t(23.68) = −1.97, p = .061, 95% CI [−4.30, 0.10], d = −0.72. A medium effect with a wide interval is a signal to collect more data, not proof that the methods are equal.

Worked example 2: one sample t test against a claimed value

A packer claims tablets contain 500 mg of active ingredient. Ten tablets weigh 498.2, 501.5, 499.1, 497.8, 500.4, 496.9, 499.6, 498.7, 500.9 and 497.5 mg. The mean is 499.06 and the SD is 1.527. Test H₀: μ = 500 (two-tailed, alpha = 0.05).

  1. Standard error = 1.527 / √10 = 0.4829.
  2. t = (499.06 − 500) / 0.4829 = −1.947, with df = 10 − 1 = 9.
  3. p = 0.0834. The critical t is ±2.262, and the 95% CI for the mean is 497.97 to 500.15.
  4. Cohen’s d = −0.62.

The p-value is above 0.05 and the interval contains 500, so this sample does not show that the average tablet differs from 500 mg. Ten tablets is a small sample, so the result also says little about whether the true average is close to 500.

Worked example 3: paired t test (dependent samples)

Eight people complete a reaction task before and after two weeks of practice. Reaction times in milliseconds: before 312, 298, 345, 330, 287, 305, 322, 340; after 298, 290, 331, 318, 285, 296, 309, 325. The differences (before minus after) are 14, 8, 14, 12, 2, 9, 13, 15, with mean 10.875 and SD 4.357.

  1. Standard error = 4.357 / √8 = 1.540.
  2. t = 10.875 / 1.540 = 7.06, with df = 8 − 1 = 7.
  3. Two-tailed p = 0.0002. The critical t is ±2.365, and the 95% CI for the mean difference is 7.23 to 14.52 ms.
  4. Effect size d_z = 2.50.

At alpha = 0.05 you reject H₀: practice is associated with faster reactions, by about 11 ms on average. Treating the same data as two independent groups would ignore the pairing and give t = 1.16 and p = 0.267, which is why a paired design needs the paired test.

T test assumptions and how to check them

These requirements, also called conditions, apply to every t test, whether it is a one sample, paired or two sample test.

  • Independent observations. Each value must not influence another. Repeated measures on the same person belong in a paired test, not an independent one. This is the main independent samples t test assumption, and for the paired t test assumptions the pairs, not the individual values, must be independent of each other.
  • A numeric outcome. The data are interval or ratio measurements, not categories or ranks.
  • Roughly normal data. Each group, or for a paired test the differences, should be roughly bell-shaped. The test is fairly robust with 30 or more values per group, but small samples with strong skew can mislead.
  • Equal variances, only for the pooled test (the equal variance t test). Welch’s test does not need this.
  • No extreme outliers. A single wild value can move a mean and inflate the standard deviation.

How to check them: look at a histogram or a normal Q-Q plot of your data, and use a Shapiro–Wilk normality test in statistical software if you need a formal one. This calculator does not run a normality test. For raw data it reports the SD ratio, a Brown-Forsythe (Levene-type) test of equal spread, a skewness flag when the skew is beyond ±1 and the values that lie beyond 1.5 × the interquartile range, so you can spot outliers. With fewer than 15 values per group it tells you that normality cannot be judged well. If the data are strongly skewed with a small sample, consider a nonparametric alternative (there is no single nonparametric t test, but the Mann–Whitney U test for independent groups and the Wilcoxon signed-rank test for paired data are the usual substitutes, and the sign test is a simpler option for paired data). Mann–Whitney U test vs t test: the t test compares means and has more power when its assumptions hold, while the Mann–Whitney test is the safer choice for small, strongly skewed samples.

One-tailed or two-tailed t test, and critical values

A two-tailed (two-sided) test asks whether the means differ in either direction. A one-tailed test (right-tailed for “greater”, left-tailed for “less”) asks about one direction only, and its p-value is half the two-tailed p when the difference is in the predicted direction. Choose the direction before you see the data. Switching to a one-tailed test afterwards to get below 0.05 inflates false positives.

There are two equivalent ways to decide. In the p-value approach you reject H₀ when p ≤ alpha. In the critical-region approach (the rejection region) you reject H₀ when your t falls beyond the critical t, which depends on alpha, the tail and the degrees of freedom. The calculator shows both. If you only need the cut-off, the t critical value calculator works as a t test critical value calculator for any alpha and df, and the t table lists the same cut-offs in the t test table or t test chart format you may have seen in a textbook. For a one-tailed test the confidence interval is shown as a one-sided bound (for example, “lower bound 3.08, no upper limit”), because that matches the one-tailed decision.

How to interpret t test results

  • t test statistics: the t statistic shows how many standard errors the observed difference is from the null value. Its sign shows the direction.
  • Degrees of freedom: set by your sample size, and they control how heavy the tails of the t distribution are.
  • p-value: the t test p value is the probability of a t at least this extreme if H₀ were true. If you only have a t and df, the p value calculator works as a p value from t test calculator and turns them into a p-value.
  • Confidence interval: a range of plausible values for the true mean or mean difference. If a 95% interval for a difference excludes 0, the two-tailed test at 0.05 is significant.
  • Effect size: how big the difference is in standard-deviation units. As a rough guide d of 0.2 is small, 0.5 medium and 0.8 large, but what counts as large depends on your field.

What the p-value is not: it is not the probability that the null hypothesis is true, it does not measure how important a difference is, and a non-significant result is not proof that there is no difference. A small sample can easily miss a real one. To plan the sample size or work out test power, use the power analysis calculator.

How to report a t test in APA style

Report the test, the degrees of freedom in brackets, the t value to two decimals, the exact p-value (or p < .001) and an effect size, with the confidence interval of the difference. Drop the leading zero for p, which cannot exceed 1, and keep it for d. For example: “A Welch independent-samples t test found no statistically significant difference between method A (M = 14.80, SD = 2.10) and method B (M = 16.90, SD = 3.40), t(23.68) = −1.97, p = .061, 95% CI [−4.30, 0.10], d = −0.72.” The calculator writes this sentence for your own numbers and has a Copy button. Italicize t, p, M, SD and d in a manuscript, and say which version you used (Welch or pooled, paired, one- or two-tailed).

T test vs z test and other tests

In the z test vs t test question, both tests compare a mean with a value. A z test needs the population standard deviation (σ) to be known, and it uses the standard normal distribution N(0, 1). A t test estimates σ from the sample and uses the t distribution, which has heavier tails, so its critical values are larger for small samples: about 2.045 at 29 df compared with 1.96 for z. As the sample grows the two become nearly identical, which is why large samples give almost the same answer. So when to use t test vs z test? Use z only when σ is known. In practice σ is rarely known, so the t test is the usual choice. For z scores and normal probabilities use the z-score calculator.

The difference between t test and z test comes down to whether σ is known. Common mix-ups: in t test vs ANOVA, a t test is not for three or more means (use ANOVA), not for relationships between two numeric variables (use correlation and regression) and not for counts in a contingency table (use a chi-square test, see the chi-square table). A t test also says nothing by itself about spread, so check your data first with the standard deviation calculator or look for outliers with the IQR calculator.

Chi square vs t test is a question about the outcome: a chi-square test works on counts in categories, while a t test works on the mean of a numeric outcome. T test vs p value is not a choice either, because the t test is the procedure and the p-value is one of its results, read from the t statistic and its degrees of freedom.

Graphing a t test

A t test does not need a graph, but a plot catches what the numbers hide. Plot the individual data points and the group means (a dot plot or an estimation plot with the mean difference and its interval is better than bars), or a box plot or violin plot for larger samples. This calculator draws the t curve for your result with the p-value area shaded, so you can see what “at least as extreme” means.

T test in Excel, R and Python

A t test in R, a t test in Python, a t test in Excel and a t test in Google Sheets all give the same numbers as this page. Each row reproduces a result from this page, so you can check it yourself.

T test functions in Excel, R and Python
TestExcelRPython
Welch (unequal variances)=T.TEST(A2:A13, B2:B16, 2, 3)t.test(x, y)scipy.stats.ttest_ind(x, y, equal_var=False)
Pooled (equal variances)=T.TEST(A2:A13, B2:B16, 2, 2)t.test(x, y, var.equal = TRUE)scipy.stats.ttest_ind(x, y)
Paired=T.TEST(C2:C9, D2:D9, 2, 1)t.test(x, y, paired = TRUE)scipy.stats.ttest_rel(x, y)
One-sample=T.DIST.2T(ABS((AVERAGE(A2:A11) − 500) / (STDEV.S(A2:A11) / SQRT(COUNT(A2:A11)))), COUNT(A2:A11) − 1)t.test(x, mu = 500)scipy.stats.ttest_1samp(x, 500)

In T.TEST the third argument is the number of tails (1 or 2) and the fourth is the type (1 paired, 2 equal variances, 3 unequal variances). T.TEST needs the raw data ranges. With only summary statistics, find t yourself and use T.DIST.2T(ABS(t), df). Excel cuts a fractional df down to a whole number in T.DIST.2T and T.INV.2T, so for a Welch test use T.TEST type 3, which uses the exact df. R’s t.test() uses Welch’s version by default. To do a t test in R, put each group in a vector and call t.test(x, y), as in the table. Google Sheets has the same function, =T.TEST(range1, range2, tails, type), with the same type numbers, so the Excel formulas in the table work unchanged in Google Sheets. On a TI-84, press STAT, choose TESTS, then 2:T-Test for a one-sample test or 4:2-SampTTest for two independent samples. For the data type choose Data (lists) or Stats (summary numbers), and for the two-sample test set Pooled to No for Welch’s version or Yes for the pooled version. For a paired test, put the differences in a list, run 2:T-Test on that list with a hypothesized mean of 0.

Common mistakes with t tests

  • Using an independent test on paired data, or the reverse.
  • Entering the SDs of the two measurements instead of the SD of the differences for a paired test from summary statistics.
  • Choosing a one-tailed test after seeing which way the data point.
  • Reading “p > 0.05” as “no difference”.
  • Running many t tests on three or more groups, which inflates the false-positive rate (use ANOVA). Pairwise t tests between several groups need a multiple-comparison adjustment such as Bonferroni or Holm.
  • Ignoring a strong outlier or heavy skew with a small sample.
  • Reporting only the p-value, without the effect size and interval.

For where this test sits among others, see the hypothesis testing calculators.

T test calculator FAQs

What is a t test?

A t test compares a mean with a value, or two means, using the t distribution, and tells you whether the difference is bigger than chance would explain. It was introduced by William Sealy Gosset (“Student”) in 1908.

What does a t test tell you?

It gives a t statistic and a p-value. The p-value is the probability of a result at least this extreme if the null hypothesis were true. The confidence interval and effect size tell you how large the difference is.

When to use a t test?

Use it when the outcome is numeric, you have one or two groups, and the population standard deviation is unknown, especially with small samples. For three or more groups use ANOVA.

What is a paired t test?

A paired t test compares two measurements on the same subjects, such as before and after, by testing whether the mean of the differences is zero.

What are the three types of t tests?

The one-sample t test compares a mean with a value, the paired t test compares two measurements on the same subjects, and the two-sample (independent samples) t test compares two separate groups.

What is the t test formula?

For one sample, t = (x̄ − μ₀) / (s / √n), with n − 1 degrees of freedom. For Welch’s two-sample test, t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂).

How to do a t test?

The hypothesis testing steps are: state H₀ and H₁, choose alpha and the tail, compute t and the degrees of freedom, find the p-value, and compare it with alpha. Or enter your data above and press Calculate.

Paired vs unpaired t test: what is the difference?

A paired test compares two measurements on the same subjects and analyses the differences, while an unpaired (independent) test compares two separate groups. The pairing removes variation between subjects, which usually makes the paired test more powerful.

Should I use Welch’s t test or the pooled t test?

Use Welch’s as the default. It does not assume equal variances, and when the variances are equal it gives almost the same answer as the pooled test.

One tailed vs two tailed t test: what is the difference?

A two-tailed test looks for a difference in either direction. A one-tailed test looks in one direction only, and must be chosen before seeing the data.

What is the difference between a t test and a z test?

In a z test vs t test comparison, a z test needs the population standard deviation to be known and uses the normal distribution. A t test estimates it from the sample and uses the t distribution, which has heavier tails.

T test vs ANOVA: what is the difference?

A t test compares one or two means. ANOVA compares three or more means at once without inflating the error rate.

How many degrees of freedom does a t test have?

One-sample and paired tests have n − 1 (n is the number of pairs for a paired test). The pooled two-sample test has n₁ + n₂ − 2. Welch’s test estimates df with the Welch–Satterthwaite formula, so it is usually not a whole number.

What does a p-value of 0.05 mean in a t test?

It means that if there were really no difference, you would see a t at least this extreme about 5% of the time. It is not the probability that the null hypothesis is true.

How do I interpret the results of a t test?

Compare the p-value with alpha, read the confidence interval for the size and direction of the difference, and look at the effect size. Report all of them, not only the p-value.

How to do a t test in Excel?

Use =T.TEST(array1, array2, tails, type) with type 1 for paired, 2 for equal variances and 3 for unequal variances. See the table above.

What is a matched pairs t test?

A matched pairs t test is the paired t test. In a matched pairs design each subject, or each matched partner such as a twin, is measured in both conditions, and the test checks whether the mean of the within-pair differences is zero.

When to use Welch’s t test?

Use Welch’s t test, also called the Welch test, whenever you compare two independent groups and cannot be sure the variances are equal. It is the default in this calculator because it gives almost the same answer as the pooled test when the variances are equal.

How to do a t test in R?

Put each group in a vector and call t.test(x, y) for Welch’s test, t.test(x, y, var.equal = TRUE) for the pooled test, t.test(x, y, paired = TRUE) for a paired test and t.test(x, mu = 500) for a one-sample test.

What is a pairwise t test?

A pairwise t test runs a two-sample t test for every pair of groups when you have three or more groups. Because many tests inflate the false-positive rate, use a multiple-comparison adjustment such as Bonferroni or Holm, or start with ANOVA.

Chi square vs t test: which one do I use?

Use a t test to compare the means of a numeric outcome, such as scores or weights. Use a chi-square test to compare counts or proportions in categories.

Does this t test calculator work with summary statistics?

Yes. Enter the mean, standard deviation and sample size of each group, or for a paired test the mean and SD of the differences and the number of pairs.

What is an independent samples t test?

An independent samples t test, also called a two sample t test or unpaired t test, compares the means of two separate groups. This calculator runs it as Welch’s t test by default and shows the pooled version beside it.

What is a one sample t test?

A one sample t test (single sample t test) compares the mean of one group with a known or claimed value, using t = (x̄ − μ₀) / (s / √n) and n − 1 degrees of freedom.

What is Welch’s t test?

Welch’s t test is the independent samples t test that does not assume equal variances. It estimates the degrees of freedom with the Welch–Satterthwaite formula, so df is usually not a whole number.

What is the paired t test formula?

t = d̄ / (s_d / √n), where d̄ is the mean of the paired differences, s_d is their standard deviation and n is the number of pairs, with n − 1 degrees of freedom.

Is this t test calculator accurate?

Yes. The results were checked against Python, R and Excel formulas, including Welch degrees of freedom, one-sided bounds and very small p-values.

Easy Stat Calc · Results checked against Python, R and Excel formulas · Last updated December 3, 2026 · Methodology