Statistics

T-Test Calculator: Independent, Welch, Paired and One-Sample

Compare two groups, a before-and-after measurement or a sample against a known value. Paste raw data or type means and SDs, and get t, df, p, the 95% CI, Cohen’s d and a sentence ready for your results section.

100% freeNo sign-upRuns in your browser
T-Test Calculator🔒 Your data never leaves your device

How to use the t-test calculator

  1. Pick the test: independent samples (two separate groups), paired samples (the same people measured twice) or one sample (compare with a known value).
  2. Choose raw data or summary statistics. For raw data, type or paste each group’s values into its box, or use Paste from Excel or Upload CSV / Excel to load your spreadsheet. A long-format sheet (a group column and a value column) is split into the two groups for you.
  3. Choose two-tailed (the usual choice) or one-tailed, and keep Welch’s test unless you have a good reason to assume equal variances.
  4. Click Run t-test and copy the APA sentence. Download the means plot for your thesis.

Which t-test should I use?

DesignExampleTest
Two separate groupsYield of treated vs untreated plotsIndependent samples (Welch)
Same subjects measured twiceBlood pressure before and after a dietPaired samples
One group vs a known valueIs mean IQ in our sample different from 100?One sample
Three or more groupsFour fertilizer dosesANOVA, not several t-tests

Formulas

Welch t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂) df = (s₁²/n₁ + s₂²/n₂)² / [ (s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1) ] Student t = (x̄₁ − x̄₂) / √(s_p² (1/n₁ + 1/n₂)), df = n₁ + n₂ − 2 Paired t = d̄ / (s_d / √n), df = n − 1 One sample t = (x̄ − μ₀) / (s / √n) Cohen’s d (x̄₁ − x̄₂) / s_p (paired: d_z = d̄ / s_d)

Assumptions

  • The observations are independent (except for the pairing in a paired test).
  • The data, or the paired differences, are roughly normally distributed. With more than about 30 per group, the t-test is robust to mild non-normality.
  • Student’s test also assumes equal variances. Welch’s test does not, which is why it is the recommended default.
Check your data’s shape first with the descriptive statistics calculator. If the data are strongly skewed and the samples are small, use a Mann–Whitney U or Wilcoxon signed-rank test instead.
Learn the statistics behind these numbers. Codanics has free statistics, R and Python lessons on YouTube and full courses for researchers.

Frequently asked questions

Should I use Welch's or Student's t-test?

Use Welch’s t-test by default. It gives almost the same answer as Student’s test when variances are equal, and it protects you when they are not. Many statisticians recommend skipping the equal-variance check altogether and always using Welch.

How do I report a t-test in APA style?

Report the means and SDs, then t(df) = value, p = value, and an effect size, for example: t(22) = 4.35, p < .001, d = 1.78. This tool writes that sentence for you.

What is the difference between one-tailed and two-tailed?

A two-tailed test checks for a difference in either direction and is the standard choice. Use one-tailed only if you specified the direction before collecting data and a difference in the other direction would be meaningless.

Can I run a t-test from mean and standard deviation only?

Yes. Switch the input to ‘Summary statistics’ and type the mean, SD and n of each group. This is handy for checking published papers or extracting data for a meta-analysis.

What if my p-value is above 0.05?

It means your data do not provide strong evidence of a difference. It does not prove that the groups are the same. Report the effect size and confidence interval so readers can judge the size and precision of the difference.

Is my data uploaded?

No. The test runs entirely in your browser.

More free tools

See all Codanics tools →

Made by Dr. Muhammad Aammar Tufail, Codanics. Found a bug or have an idea for a new tool? Tell us on the WhatsApp channel or in the YouTube comments. Results are for learning and planning; check important analyses with a statistician or your supervisor.