T-Test Calculator
Free t-test calculator for one-sample, two-sample & paired t-tests. Calculate t-value, p-value, degrees of freedom with step-by-step results.
Two-tailed tests. Use matched pairs for before/after measurements, or Welch’s test for independent groups.
Difference direction: first sample minus target, or first sample minus second sample. For a positive after−before change, enter after scores first.
Choose a mode that matches the design
| Mode | What it tests | Required input |
|---|---|---|
| One sample | A population mean equals a specified value | One dataset and hypothesized mean |
| Two samples (Welch) | Two independent population means are equal | Two independent datasets |
| Paired samples | The mean within-pair difference is zero | Two equally sized lists in matching row order |
All modes calculate two-sided tests. The two-sample mode uses Welch’s unequal-variance method, not a pooled common-variance test. The paired mode subtracts sample 2 from sample 1.
Enter finite numbers separated by commas, spaces, or newlines. Do not paste column headings or measurement units into the numeric fields. Each dataset needs enough values for its sample variability to be estimated; zero standard error cannot support a finite t statistic.
Reproduce a one-sample result
Enter 12,14,16,18,20, hypothesized mean 15, and α = 0.05.
- Mean = 16; sample SD = 3.1623.
- SE = 1.4142.
- t = 0.7071, df = 4.
- Two-sided p = 0.5185.
The test does not reject the hypothesized mean at 5%. This is not evidence that the population mean is exactly 15. The t-test lesson also calculates the matching confidence interval by hand.
Reproduce a paired result
Select paired mode. Enter sample 1 12,14,16,18,20 and sample 2 10,11,15,15,18.
The differences are 2, 3, 1, 3, 2, with mean 2.2. The test gives t ≈ 5.8797, df = 4, and two-sided p ≈ 0.0042.
Reversing the samples reverses the difference and t signs but leaves a two-sided p-value unchanged. Never sort the two lists independently. Pairing depends on matching identities, not just equal list lengths.
Understand the output
The t statistic is an estimated difference divided by its estimated SE. Degrees of freedom depend on the mode; Welch df can be fractional. The p-value is the probability of a statistic at least as extreme under the null model and analysis assumptions.
The significance label compares p with the α you selected. It does not measure practical importance, establish causation, or prove equality when nonsignificant. Use the effect in original units and an appropriate interval to interpret the result.
Check what the calculator cannot check
The calculator validates numeric input, but cannot establish random sampling, independence, valid pairing, or an appropriate distributional model. Inspect small samples for extreme values and strong skew. For paired tests, inspect differences; for independent tests, inspect each group.
Clustered data, serial measurements, more than two repeated conditions, and ordinal outcomes can need different methods. Rank alternatives also have assumptions and may test a different target.
A before-and-after mean change alone does not establish intervention effectiveness. Time trends and other mechanisms may contribute.
Learn the method
Read t-tests, follow the paired walkthrough, or use the t-table for critical values. This tool does not calculate one-sided, equivalence, or multigroup tests.
Want to learn the theory?
Our lessons explain the statistical concepts behind this calculator with clear examples.
Understand this method →