gizmobench
BrowseDaily

T-Test Calculator

Paste or import up to 10,000 values per list. Choose a one-sample, paired, Welch or pooled Student two-sample t-test, then read t, degrees of freedom, the p-value and an interval for the mean or mean difference. The plot and sample summaries help you inspect the data; the listed assumptions explain what the calculation requires.

Your data

Test

Compares two independent means without assuming equal variances.

Alternative

ResultWelch two-sample t-testExample data

123456AB95%-5-4-3-2-10

Text equivalent: Dot plot of A: 3 values from 1 to 3, mean 2. Dot plot of B: 3 values from 4 to 6, mean 5. 95% interval -5.26696 to -0.733042 for the difference in means, A - B, estimate -3, null 0.

Example data: two short samples, tested with Welch. Replace them with your own values and run the test.

t
-3.674234614
Degrees of freedom
4
p (two-sided)
0.02131
95% interval
-5.26696 to -0.733042

p = 0.02131 is below alpha = 0.05.

The 95% interval excludes the null value 0.

The test

TestWelch two-sample t-test, A against B, variances not assumed equal
Alternativetwo-sided: the difference in means, A - B differs from the null value 0
Estimate-3, the difference in means, A - B
Null value0
Standard error0.816497
t-3.674234614
Degrees of freedom4
p (two-sided)0.02131
95% interval-5.26696 to -0.733042
Cohen's d (average-variance SD)-3, from (difference in means - null) / sqrt((SD_A^2 + SD_B^2) / 2)

Samples

SummaryAB
n33
Left out (NA)00
Mean25
SD11
SE0.577350.57735
Min14
Q11.54.5
Median25
Q32.55.5
Max36
Skewness g100
Beyond 1.5 IQR00
  • The larger sample variance is 1 times the smaller.

Assumptions

  • The two samples are independent of each other, and the values within each are independent.
  • Each sample mean is close to normally distributed.
  • The variances are not assumed equal: each sample's own variance goes into the standard error, and the degrees of freedom come from the Welch-Satterthwaite approximation.
  • This page shows these assumptions and the summaries beside them; it does not test the assumptions or say whether they hold.

Worked cases

Each line is computed by the same code as the answer above. Load one to fill the boxes, then run it.

  • One-sample[2, 4, 6] against 0
    t 3.464101615, df 2, p 0.07418
  • Welch[1, 2, 3] against [4, 5, 6]
    t -3.674234614, df 4, p 0.02131
  • PairedSeven before and after pairs
    t 3.580141859, df 6, p 0.01164
  • Paired, unequal lengths[1, 2, 3] and [1, 2]
    Refused: Paired lists need the same number of entries, matched by position: A has 3 and B has 2. Add or remove entries so they line up, or use NA for a missing value.
  • Paired, equal differences[1.1, 2.2, 3.3] minus [0.1, 1.2, 2.3]
    t undefined: The 3 differences A - B have zero variance (every difference is 1), so the standard error is 0 and t is undefined.

Common questions

How do you calculate a t-test by hand?
Every version divides a difference by its standard error. For one list, t is the mean minus the null value, over the standard deviation divided by the square root of n, on n - 1 degrees of freedom: [2, 4, 6] against 0 has mean 4, SD 2 and standard error 1.1547, so t = 3.464101615 on 2 degrees of freedom and the two-sided p = 0.07418. A paired test does the same to the differences A - B. Welch divides the difference in means, less the null value, by the square root of each sample's variance over its size, added together. The page prints each of these figures, so every step can be checked.
What do one-sample, paired, independent and Student t-tests mean?
A one-sample test compares one list's mean with a fixed value. A paired, dependent or matched-pairs test uses differences A - B from the same things measured twice, matched by position. Independent or unpaired tests compare two separate groups. Welch uses each group's own variance; Student pools them and assumes equal population variances. Choose the test that matches how the values were collected and its assumptions. The page shows those assumptions without checking whether they hold.
How do Welch and pooled Student t-tests differ?
Welch does not assume the two groups share a variance. Each group's variance enters its standard error, and the Welch-Satterthwaite degrees of freedom can be fractional. Student assumes equal population variances, pools the sample variances with weights nA - 1 and nB - 1, and uses nA + nB - 2 degrees of freedom. Choose Student for that calculation or Welch for the unpooled one. With equal sample sizes and variances, they agree: [1, 2, 3] against [4, 5, 6] gives t = -3.674234614 on 4 degrees of freedom, two-sided p = 0.02131, and a 95% interval of -5.26696 to -0.733042.
Why does the calculator say t is undefined?
Because the arithmetic has no answer. A t needs a standard error, and the standard error is zero when nothing varies: for a one-sample or paired test that means every value or every difference is the same, and for Welch or pooled Student it means both samples are constant. It also cannot be estimated from fewer than two values. The page says which of these happened and still shows the summaries. The means and variances are exact on the digits typed, which is what makes the zero exact: [1.1, 2.2, 3.3] paired with [0.1, 1.2, 2.3] differs by exactly 1 each time, while floating point leaves the three differences unequal in the last digit and can turn them into a t near 1.1e16.
How accurate is the p-value, and how small can it get?
The p-value is a tail of the Student t distribution at the degrees of freedom shown. A two-sided p is twice the smaller tail, capped at 1. A p-value below 1e-300 is printed from its logarithm so it keeps four significant digits even when its ordinary value rounds to zero.
Can I paste data from a spreadsheet or open a CSV file?
Yes. Values can be separated by spaces, tabs, new lines, commas or semicolons, so a column copied from a spreadsheet pastes straight in, and NA marks a missing value. Open CSV file reads a comma, semicolon or tab separated file in the browser, with quoted cells and a header row, and lets you pick the columns for A and B. Blank cells become NA so pairs stay lined up, and a cell that is not a number is refused by its row and column rather than skipped. A number written with a thousands separator, such as 1,250, is refused too, because a comma also separates values. Nothing is uploaded.
What does the confidence interval tell me?
It is the estimate plus and minus the t critical value times the standard error, at the level set by alpha: 0.05 gives a 95% interval for the mean or the mean difference. For Welch [1, 2, 3] against [4, 5, 6] that is -5.26696 to -0.733042. A one-sided test gets a one-sided bound to match, such as -infinity to -1.25935 for the same data with the alternative Less. The page says whether the interval includes the null value and whether p is below alpha, and draws no conclusion from either.
What are the assumptions of a t-test, and does this check them?
Values within a sample must be independent, and the sample mean or mean of paired differences must be close to normally distributed. A paired test needs correctly aligned pairs that are independent of other pairs. Two-sample tests need independent groups; pooled Student also assumes equal population variances. The page lists these conditions and shows quartiles, skewness and values beyond 1.5 times the interquartile range. It does not test the assumptions or decide whether they hold.
Does the page keep my data?
It remembers only the test type, the alternative and alpha in this browser, so the page opens the way you left it. The values stay in the page's memory and are gone when you close it, and the Start over button above the tool clears the remembered settings. Copy report and Download CSV hand the current result to your clipboard or your downloads; in the CSV, a sample name that begins like a spreadsheet formula is written with a leading apostrophe.
Can I run a one-tailed or two-tailed t-test?
Yes. Choose Two-sided when the alternative is a difference in either direction. Greater tests whether the mean or A - B is above the null value; Less tests whether it is below. These one-sided choices also produce a matching one-sided confidence bound. Alpha sets the comparison threshold and interval level, not the direction.
What does a statistically significant result mean here?
The result says whether p is below the alpha you entered and whether the interval includes the null value. It reports those numerical comparisons without deciding practical importance or recommending a clinical, hiring or investment action. The effect-size row reports Cohen's d: paired uses the SD of the differences, Student uses the pooled SD, and Welch uses the square root of the average sample variance.
Can I enter a t statistic, a critical value, or only mean and SD?
This page runs a test from the raw values. Use the related T Distribution Calculator to turn a known t statistic and degrees of freedom into a p-value, or a probability into a critical t value. This page does not accept mean, SD and sample size as a substitute for raw data, or calculate power or a planned sample size.

Classical t-tests under the assumptions displayed with each result; no clinical, hiring or investment decision recommendation. Means and variances are exact arithmetic on the digits entered, and p-values and intervals come from a Student t distribution matched to independent reference values within 1e-12. Zero variance and undersized samples are explicit: t is reported as undefined, never as a number.