UTILS.
Private by default
📊

Two-Sample t-Test Calculator

Run a one-sample, paired or two-sample t-test from raw data or summary stats, with the t-statistic, degrees of freedom and two-tailed p-value.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

Sample (n − 1) standard deviations. Two-tailed p-value from the t distribution via the regularized incomplete beta function.

About this tool

The Two-Sample t-Test Calculator runs the three classic Student's t-tests — one-sample, paired and two-sample — and reports the t-statistic, degrees of freedom, two-tailed p-value and a significance verdict at α = 0.05. Enter raw numbers into the boxes (separated by commas, spaces or new lines) or switch to summary mode and type the mean, standard deviation and sample size directly. Nothing leaves your browser.

For one sample, t = (x̄ − μ₀) ÷ (s ÷ √n) with df = n − 1. A paired test computes the differences and runs that same formula on them. The two-sample test offers a pooled version — sp² = [(n₁−1)s₁² + (n₂−1)s₂²] ÷ (n₁+n₂−2), t = (x̄₁ − x̄₂) ÷ (sp·√(1/n₁ + 1/n₂)), df = n₁+n₂−2 — and a Welch version for unequal variances, whose degrees of freedom use the Satterthwaite approximation. Standard deviations are the sample (n − 1) form.

The two-tailed p-value comes from the Student's t distribution using the regularized incomplete beta function (with a Lanczos log-gamma and a continued-fraction evaluation), so p = I₍df/(df+t²)₎(df/2, ½). If p is below 0.05 the difference is flagged significant. It is a teaching and analysis aid — check the test's assumptions before drawing conclusions.

Frequently asked questions

Which test should I pick?
Use one-sample to compare a mean against a known value μ₀, paired for two measurements on the same subjects (before/after), and two-sample for two independent groups. For two independent groups with clearly unequal variances, choose the Welch option.
Pooled or Welch for two samples?
The pooled test assumes both groups share the same variance and gives df = n₁+n₂−2. Welch drops that assumption and adjusts the degrees of freedom (Satterthwaite), which is safer when the two standard deviations or sample sizes differ.
How is the p-value computed?
From the t distribution's CDF via the regularized incomplete beta function I_x(a,b), evaluated with a continued fraction and a Lanczos log-gamma. The two-tailed value is I₍df/(df+t²)₎(df/2, ½), accurate to many decimal places.
What does the significance verdict mean?
It compares the two-tailed p-value with α = 0.05: p < 0.05 is labelled significant (reject the null hypothesis of no difference), otherwise not significant. The 0.05 threshold is a convention, not proof — consider effect size and assumptions too.

More tools