Statistics

T-Test Calculator: Compare Two Groups from a CSV or Excel File

Welch, Student and paired t-tests plus Mann-Whitney and Wilcoxon, straight from your spreadsheet. p-value, confidence interval and effect size included.

Drag & Drop your file here

or browse files | paste raw data


Example
GroupScore
A12
A14
A15
B19
B21
B22
StatisticValue
Mean A / B13.7 / 20.7
t (df)−5.61 (4)
p-value0.005
Cohen's d−4.58

Welch's t-test with effect size, confidence interval and a box plot.

Learn More

How to Run a T-Test

A complete guide to configuring your data pipeline.

Step 1: Upload Your Data

The t-test accepts two common layouts. In the long layout, one column holds the measurements and another column says which group each row belongs to (e.g. Group = control / treated). In the wide layout, each group is in its own column — this is also the layout for paired data, with one row per subject and the before and after values side by side.

Step 2: Choose the Columns and the Test

In the Compare Groups tool, pick how your data is organized and select the columns. Then choose the test:

  • Welch's t-test (default): two independent groups; does not assume equal variances. This is the safest default.
  • Student's t-test: two independent groups with similar variances.
  • Paired t-test: the same subjects measured twice (before / after).
  • Mann-Whitney U and Wilcoxon signed-rank: non-parametric alternatives for skewed data or small samples.

Step 3: Interpret the Result

The result opens with a plain-language sentence (e.g. "The mean of B is significantly higher than the mean of A"), followed by the t statistic, degrees of freedom, p-value, the 95% confidence interval of the difference and the effect size (Cohen's d). A box plot with every data point lets you see the comparison, and a note warns you if the data look strongly non-normal.

Technical Specifications & FAQ

A t-test asks whether the difference between two means is larger than what random sampling variation would produce. The p-value is the probability of observing a difference at least this large if the two groups truly had the same mean; values below 0.05 are conventionally called significant. Because a p-value says nothing about how large the difference is, flowingTable always reports the mean difference with its 95% confidence interval and Cohen's d.

All calculations use SciPy (scipy.stats.ttest_ind and ttest_rel) and match the output of R's t.test(). Welch's correction is used by default because it remains valid when the groups have different variances or sizes, with almost no loss of power when they do not. Rows with an empty or non-numeric value in the selected columns are skipped, and the number of rows used is shown in the result.


Frequently Asked Questions

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

Use Welch's t-test unless you have a specific reason not to. It does not assume that both groups have the same variance and gives almost identical results to Student's t-test when the variances are equal. Student's t-test can give misleading p-values when variances and group sizes differ. R's t.test() also uses Welch by default.

When do I need a paired t-test?

Use the paired t-test when each value in one group is linked to one value in the other — the same patient before and after treatment, the same sample measured by two instruments, or matched pairs. Put the two measurements in two columns, one row per subject, and choose the 'Each group in its own column' layout.

What if my data are not normally distributed?

With moderate sample sizes the t-test is fairly robust to non-normality. For small samples or strongly skewed data, choose Mann-Whitney U (independent groups) or Wilcoxon signed-rank (paired data). flowingTable runs a Shapiro-Wilk check and shows a note when a group looks clearly non-normal.

Can I compare more than two groups?

A t-test compares exactly two groups. For three or more groups, choose One-way ANOVA or Kruskal-Wallis in the same tool; both include pairwise post-hoc comparisons that tell you which groups differ, with the appropriate correction for multiple testing.