T-Test Calculator

Share:
Mathematics

T-Test Calculator

One-sample / Welch / paired

By Checked against sources by Last reviewed A/B TESTING HYPOTHESIS RESEARCH STATISTICS T-TEST
Your browser is too old for this tool’s interactive features. Please update to Safari 13.1, Chrome or Edge 80, Firefox 74 or newer.

T-Test Calculator

t-statistic
—
Degrees of freedom
—
p-value (2-tailed)
—
—
📅 Research current as of 03 Nov 2026 · Sources: Student, The Probable Error of a Mean, Biometrika 6 (1908) 1-25; Fisher, Statistical Methods for Research Workers (1925) ch. 3 and 5; NIST/SEMATECH e-Handbook §1.3.5.3; ASA statement on p-values, news release, 7 Mar 2016; Delacre, Lakens and Leys, International Review of Social Psychology 30 (2017).
Standards, published formulas, and reference data are revised over time — check against a current authoritative source before relying on these figures.
Advertisement
After results · AD-W1Responsive · Post-tool — peak engagement

How to use the T-Test Calculator

Pick the right test type

Two-sample compares the means of two separate groups. Welch's version is the default; Student's pooled version is there to compare against it, and both are shown side by side either way. One-sample compares one group with a fixed value. Paired is for the same subjects measured twice, or matched rows.

Paste your data

Raw values, one group per box, separated by spaces, newlines, or a comma and a space. The result shows how many values were read in each group, and says what it ignored. "120,115,130" with no spaces reads as one number, because that is how a thousands separator looks; the page tells you when it does this. In paired mode order matters: row 1 of A goes with row 1 of B. Mark a missing value with NA, and that whole pair is left out rather than shifting the rows below it.

Set the threshold (α)

Choose α before you look at the result. It changes the verdict and the width of the interval, not t or p. 0.05 is the convention: Fisher wrote in 1925 that it is "convenient to take this point as a limit".

Read the result

If p < α the difference is significant at that threshold; if not, the data did not rule out no difference. "Not significant" does not mean no difference: small samples often miss real ones. Read the interval and Cohen's d as well, since they show how large the difference may be, and p does not.

Advertisement
After how-to · AD-W2Responsive

What a t-test compares, and where each version misleads

A t-test takes a difference between means, divides it by a measure of how noisy that difference is (the standard error), and reads the result against a t-distribution to get a p-value. Student's 1908 paper, "The Probable Error of a Mean", was about one series of numbers. Its aim was "to determine the point at which we may use the tables of the probability integral in judging of the significance of the mean of a series of experiments". The paper's statistic was z rather than t, its table stopped at n = 10, and its illustrations were sleep and farm trials. Fisher's 1925 book uses t and degrees of freedom, and it compares two groups by "pooling the sums of squares from the two samples". That pooled test is the one usually called Student's.

Which version to use

One-sample: one group against a fixed value, such as a batch of batteries against a stated 200-minute life. Two-sample: two groups with no link between them, such as treatment and control. Paired: each row in one column belongs with a row in the other, such as before and after on the same person. Pairing removes the differences between subjects when the two columns move together. On Student's own sleep table (the sample data here), the paired test gives p = 0.0028 and Welch's, which ignores the pairing, gives p = 0.0794. The two columns correlate at 0.795. Fisher ran the same comparison on the same table in 1925.

"the normal curve gives a false feeling of security" Student, The Probable Error of a Mean, 1908

Group size decides which way the equal-variance test errs

The pooled test goes wrong when spread and group size are mismatched, and the direction depends on which group is the noisy one. If the smaller group has the larger variance it finds too many differences; if the larger group does, too few. Delacre, Lakens and Leys set this out in 2017 and recommend Welch as the default. We re-ran it with no true difference between the groups, normal data and a nominal 5%, one million runs per row:

False-positive rates of Student's and Welch's tests by group size and spread
Group sizesSpread (SD ratio)Student false positivesWelch false positives
10 and 101:14.99%4.84%
10 and 104:16.08%5.06%
10 and 402:118.23%5.11%
10 and 404:129.40%5.04%
40 and 104:10.08%4.98%
20 and 804:128.55%4.99%

The last row shows that a bigger sample does not cure it; the ratio of the group sizes drives it. The two-sample result here shows both tests on your data, and warns when one group is both smaller and at least twice as spread out.

Welch is not free, and neither test is safe everywhere

With equal variances and equal groups, Welch costs almost nothing: 79.95% power against Student's 80.38% at 10 and 10. With small lopsided groups it costs more, 70.80% against 81.92% at 5 and 20. It also has a weak spot of its own. With skewed data and unequal groups, where both groups share the same shape, Welch ran 8.34% false positives on lognormal data at 10 and 40, and Student's 4.68%.

The pitfalls of reading a t-test

"Not significant" is not "no effect": the data did not rule out zero, and with small samples that is common. "Significant" is not "important": in the words of the American Statistical Association's 2016 statement, "A p-value, or statistical significance, does not measure the size of an effect or the importance of a result." A p-value is not the chance you are wrong: p = 0.04 means that if there were truly no difference, data this extreme would turn up 4% of the time. The ASA again: p-values "do not measure the probability that the studied hypothesis is true, or the probability that the data were produced by random chance alone." Many tests produce false positives: 20 independent tests at α = 0.05 with no real effects give one significant result on average, and a 64.2% chance of at least one. Use a Bonferroni or false-discovery-rate adjustment. A threshold is not a decision: "Scientific conclusions and business or policy decisions should not be based only on whether a p-value passes a specific threshold."

What the 1908 paper held, and what 30 observations buy

01

Student checked his result by shuffling: 3000 criminals' measurements on "3000 pieces of cardboard", dealt into samples of 4, "750 in all".

02

In his sleep example Student gave odds of "about 666 to one". This tool's paired test on the same table gives one-sided p = 0.00142, about 705 to 1. He was working from a table to four places.

03

Judging t against 1.96 instead of the right t value gives 8.16% false positives at 9 df, 5.97% at 29 and 5.46% at 60. The curve is smooth, with no jump at 30.

04

On skewed data the size of the sample matters more. One-sample at n = 30 ran 7.28% on exponential data and 11.73% on lognormal, against a nominal 5%, nearly all of it in one tail.

Frequently Asked Questions

  • Paired: when each observation in one column belongs with one in the other, such as the same patient before and after, or twins. Pairing helps when the two columns move together, because subject-level variation cancels out. If they do not, it costs you degrees of freedom for nothing. Two-sample: when the groups are unrelated. Running a two-sample test on paired data throws the pairing away: on the sample sleep table, p goes from 0.0028 to 0.0794.

  • The classic two-sample test, in the form Fisher gave in 1925, pools the two groups' spread into one estimate. Student's 1908 paper has no two-group test. Welch's test keeps separate variance estimates and adjusts the degrees of freedom (Welch-Satterthwaite). Why it is the usual default: pooling is fine with equal groups, but with unequal groups and unequal spread it can go badly wrong in either direction (29.40% or 0.08% false positives against a nominal 5%, in the table above). NIST's handbook says the Welch-Satterthwaite degrees of freedom "are robust for unequal sample sizes and/or unequal variances". Welch loses almost nothing at equal group sizes, and more when groups are small and lopsided. This tool runs both and shows them together.

  • It depends on the size of effect you want to detect. For 80% power at α = 0.05, two-sided, with equal groups: d = 0.8: 26 per group; d = 0.5: 64 per group; d = 0.2: 394 per group. Use the Sample Size Calculator for pre-test sizing. There is no single n that makes a t-test safe: what a sample needs depends on how skewed the data are and on how unequal the groups are.

  • It depends on the design. Two equal groups with the same shape hold up well: lognormal data at 30 and 30 gave 4.09% false positives with Student's test and 3.90% with Welch's. One sample on skewed data does not: 7.28% (exponential) to 11.73% (lognormal) at n = 30, and 5.80% to 8.25% at n = 100. Log transform right-skewed positive data such as incomes or times, and test the logs. Rank tests (Mann-Whitney U, Wilcoxon signed-rank) do not assume normality, but Mann-Whitney does not test means, and it does not protect you from unequal spread: with equal means, 10 and 40, 4:1 spread, it rejected 15.34% of the time in our runs, against Welch's 5.04%.

  • This tool reports two-tailed p-values, which count a difference in either direction. A one-tailed test looks in one direction only, and that direction has to be fixed before you see the data. To convert when the result lies in that direction, halve the two-tailed p, as Fisher noted in 1925: "the values of P should be halved".

  • A common format is "t(df) = X.XX, p = .XXX, d = X.XX". Example: "Treatment group (M = 12.4, SD = 2.1) scored higher than control (M = 9.8, SD = 1.9), t(58) = 5.03, p < .001, d = 1.30." (Those figures follow from the means and SDs with 30 per group; check any report by recomputing them.) Include the means and SDs, t with its degrees of freedom, the exact p, an effect size and an interval for the difference. All of these are in the result above. Say which test you ran: a fractional df means Welch's.

  • d is the difference between means in standard-deviation units: d = (M₁ − M₂) / SD_pooled. d = 1.0 means the groups differ by one standard deviation. Cohen's rough labels are 0.2 small, 0.5 medium, 0.8 large. In paired mode this tool reports dz, the mean difference over the SD of the differences, which is on a different scale. Why it matters: p depends on sample size, and d does not. p = 0.01 with d = 0.05 is a very small difference measured on a very large sample. p = 0.15 with d = 0.8 is a large observed difference that a small sample could not pin down.

  • Not directly. A t-test suits continuous metrics such as revenue per user or time on page. For a yes/no outcome use a z-test for proportions or a chi-square test of independence.

  • No. All calculations run in your browser, and the data you enter is not sent anywhere. You can confirm it in DevTools → Network.

  • Chi-Square Test for categorical data; ANOVA for 3+ group comparisons; Sample Size Calculator for pre-test sizing; Standard Deviation for descriptive stats; Confidence Interval for a single mean or proportion; Linear Regression for relationships.

Method & sources

How it computes

Welch t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂) with Welch-Satterthwaite df. Student t pools the sums of squares on n₁ + n₂ − 2 df. One-sample t = (x̄ − μ₀) / (s/√n). Paired: a one-sample test on the row differences. Two-tailed p from the t distribution; interval at 1 − α on the same df and standard error. Cohen's d uses the pooled SD; paired dz uses the SD of the differences. Computed in your browser.

What this tool implements

  • NIST/SEMATECH e-Handbook §1.3.5.3: the Welch-Satterthwaite degrees of freedom are robust to unequal sample sizes and unequal variances, which is why the two-sample mode uses them by default.
  • Student's 1908 paper has no two-group statistic: its illustrations are a single series or a series of differences, and its statistic is z, computed with s on n. The pooled two-sample test is taken from Fisher 1925 ch. 5, which pools the sums of squares of the two samples. No claim is made about who was first.
  • The verdict is p < α at the chosen α and nothing else. The interval uses the same df and standard error as the test, so it excludes the null exactly when the verdict rejects.
  • For 80% power at α = 0.05 two-sided, exact-t sample sizes are 26, 64 and 394 per group for d = 0.8, 0.5 and 0.2.
  • ASA statement, 2016: a p-value does not measure the probability that the hypothesis is true or that the data arose by chance alone, nor the size of an effect, and decisions should not rest only on a threshold. The page quotes these from the ASA news release; the journal text was not opened.
  • P-values were checked against 306 (t, df) cells of a 30-digit tail integral: worst absolute error under 1e-6.
  • Corrected 2026-11-03: the verdict box used fixed 0.001/0.01/0.05/0.10 bands and could contradict the chosen α on one screen; a comma list with no spaces read as one number in silence; an NA in paired data shifted every later row and gave a clean, wrong result; n was never shown; zero spread left the page blank.
Show 2 more
  • Added 2026-11-03: Student's pooled test beside Welch's, a confidence interval, Cohen's d and a warning when group size and spread are mismatched. Student's 1908 sleep table is the sample data.
  • Cut 2026-11-03: that Student's original test assumed two groups with equal variances; "beer ingredients" and the Guinness secrecy story, neither in the paper and neither traced to a primary record here; the sentence that a significant result is unlikely due to chance alone; that significance is a necessary condition for a decision; named companies said to run these tests; n > 30 as a general safety rule; the Welch date, not opened; and uncited claims about journals, clinical trials and A/B sample sizes.

Sources

Advertisement
Pre-footer · AD-W3 728 × 90