t-Test

Online t-Test Calculator (One-sample, Paired & Independent)

A free t-test calculator that runs in your browser. Paste a dataset, pick the variant you need — one-sample, paired or independent — and get the t-statistic, degrees of freedom, p-value, confidence interval and Cohen's d in one step.

Open the calculator

Run this analysis in the DeepStats analyzer. Free, no sign-up required, results appear instantly after you paste or upload data.

Open the calculator — run it in /analyze

When to use this test

  • You want to compare a sample mean against a known reference value (one-sample t-test).
  • You have two related measurements on the same subjects — before/after, left/right, matched pairs (paired t-test).
  • You have two independent groups and want to know whether their means differ (independent t-test).
  • Your outcome variable is continuous (metric) and roughly normally distributed.
  • Your sample size is small-to-moderate and the underlying variance is unknown.

How to use it

  1. 1

    Upload or paste your data

    Open the analyzer and drag a CSV or XLSX file into the upload area, or paste rows directly into the spreadsheet grid. One column should hold the outcome values; if you are running an independent t-test, a second column should hold the group label.

  2. 2

    Pick the t-test variant from the catalog

    Open Hypothesis Tests in the sidebar. Choose One-sample, Paired or Independent t-test depending on your design. The catalog only enables variants that match the column types you have assigned.

  3. 3

    Assign variables to roles

    Drag the outcome column into the Dependent slot. For an independent test, drag the group label into the Group slot. For a paired test, assign the two paired columns. For a one-sample test, enter the reference value (mu) you are comparing against.

  4. 4

    Review the results table and chart

    You get the t-statistic, degrees of freedom, two-tailed p-value, mean difference, 95% confidence interval for the difference, and Cohen's d. A boxplot or paired-difference plot is generated automatically.

  5. 5

    Export or save

    Download the results table as CSV, copy the plain-English interpretation into your report, or save the whole analysis to your DeepStats history if you are logged in.

Example with sample data

Below is a minimal dataset for an independent t-test. Two study groups, eight observed test scores. Paste the block into the analyzer grid.

Group,Score
A,85
A,92
A,91
A,88
B,78
B,72
B,80
B,75

With this sample the analyzer reports t ≈ 4.6, df = 6, p ≈ 0.0036, mean difference ≈ 10.25 and Cohen's d ≈ 2.3. Because p is below 0.05 you would reject the null hypothesis of equal means; the effect size is very large, so the difference is not just detectable but substantively big.

How to interpret the results

You will see: t-statistic, degrees of freedom, p-value (two-tailed), mean difference, 95% confidence interval, Cohen's d.

t-statistic
The ratio of the observed effect to its standard error. For the classical formula t = (x̄ − μ) / (s / √n) in a one-sample test, larger absolute values of t indicate the sample mean sits further from the reference than sampling noise alone would explain.
Degrees of freedom (df)
Controls which t-distribution is used to compute the p-value. df = n − 1 for one-sample and paired tests; for independent tests with Welch correction, df is computed from the Welch-Satterthwaite formula.
p-value
The probability of observing a test statistic at least as extreme as yours under the null hypothesis. A common threshold is 0.05: below it you reject the null, above it you do not. A p-value is not the probability that the null is true.
95% confidence interval for the mean difference
A range of plausible values for the true mean difference. If the interval excludes zero, the result is significant at the 0.05 level. The width of the interval tells you how precisely you estimated the effect.
Cohen's d
Standardised effect size. Conventional benchmarks: 0.2 small, 0.5 medium, 0.8 large. Always report d alongside the p-value — a tiny effect can be statistically significant in a huge sample without being practically meaningful.

Assumptions

  • Normality.Each sample should be roughly normally distributed. Moderate departures are tolerated thanks to the central limit theorem once n is above ~30 per group. For small, skewed samples, switch to the Mann-Whitney U test (independent design) or the Wilcoxon signed-rank test (paired design).
  • Independence.Observations within and between groups must be independent. Time-series data, nested designs (students within classes) or repeated measurements require a different test — paired t, repeated-measures ANOVA or a mixed model.
  • Equal variances (Student version only).Classical Student's t-test assumes the two groups share the same variance. Levene's test is run automatically; when variances differ, DeepStats applies Welch's correction so you still get a valid p-value.
  • Measurement scale.The outcome must be at least interval-scaled. Ordinal data (Likert ranks) should be analysed with a rank-based alternative like Mann-Whitney or Wilcoxon.

Related calculators

Frequently asked questions

Is this t-test calculator really free?+

Yes. Running a t-test on DeepStats is free and unlimited. No credit card, no trial period, no hidden export paywall — the calculator works the same whether you are signed in or not.

Do I need to install software?+

No. DeepStats runs entirely in your browser and requires nothing beyond a modern Chrome, Firefox, Safari or Edge window. There is nothing to download and no license to manage.

What is the difference between a paired and an independent t-test?+

Paired t-tests work on two measurements from the same unit (the same person measured before and after treatment, for example). Independent t-tests work on two separate groups of different units. Using the wrong one inflates error — always match the test to your design.

Should I use Welch's correction?+

By default, yes. Welch's version of the independent t-test does not assume equal variances and is more robust. DeepStats applies it automatically when Levene's test indicates the variances differ; otherwise it falls back to Student's formula.

Can I cite this calculator in my thesis?+

You can cite the underlying libraries — scipy.stats.ttest_ind, ttest_rel and ttest_1samp — in your methods section. Many supervisors simply require the software name; in that case, DeepStats (https://deepstats.draftlabs.org) is sufficient.

What sample size do I need?+

There is no strict minimum, but results become unstable below n ≈ 10 per group. For robust inference a rule of thumb is at least 20–30 per group. Very small samples are better analysed with exact or non-parametric tests.

Ready to run your own analysis?

Open the full DeepStats analyzer — free, browser-based, no account required.