# T-Test Calculator

Free t-test calculator. Perform one-sample or two-sample (Welch's) t-tests with summary statistics. Get t-statistic, degrees of freedom, and p-value.

## What this calculates

Perform a one-sample or two-sample (Welch's) t-test using summary statistics. Enter the sample mean, standard deviation, and size to calculate the t-statistic and p-value.

## Inputs

- **Test Type** — options: One-Sample T-Test, Two-Sample T-Test — One-sample compares a sample mean to a known value. Two-sample compares two sample means.
- **Sample 1 Mean (x̄₁)** — Mean of the first sample.
- **Sample 1 Std Dev (s₁)** — min 0.0001 — Standard deviation of the first sample.
- **Sample 1 Size (n₁)** — min 2 — Number of observations in the first sample.
- **Hypothesized Mean (μ₀) / Sample 2 Mean (x̄₂)** — For one-sample: the hypothesized population mean. For two-sample: mean of the second sample.
- **Sample 2 Std Dev (s₂)** — min 0.0001 — Standard deviation of the second sample (two-sample test only).
- **Sample 2 Size (n₂)** — min 2 — Number of observations in the second sample (two-sample test only).

## Outputs

- **T-Statistic** — The calculated t-test statistic.
- **Degrees of Freedom** — Degrees of freedom for the test.
- **P-Value (Two-Tailed)** — Two-tailed p-value.
- **P-Value (One-Tailed)** — One-tailed p-value.
- **Significant at α = 0.05?** — formatted as text — Whether the result is statistically significant (two-tailed).

## Details

The t-test determines whether the means of groups are statistically different.

One-Sample T-Test:
t = (x̄ - μ₀) / (s / √n)

Two-Sample T-Test (Welch's):
t = (x̄₁ - x̄₂) / √(s₁²/n₁ + s₂²/n₂)

Welch's t-test does not assume equal variances and uses the Welch-Satterthwaite equation for degrees of freedom.

## Frequently Asked Questions

**Q: When should I use a t-test vs. a z-test?**

A: Use a t-test when the population standard deviation is unknown (you estimate it from the sample) or when the sample size is small (n < 30). Use a z-test when the population standard deviation is known and the sample is large.

**Q: What is Welch's t-test?**

A: Welch's t-test is a two-sample t-test that does not assume equal variances between groups. It adjusts the degrees of freedom using the Welch-Satterthwaite equation, making it more robust than the equal-variance (Student's) t-test.

**Q: What is the difference between one-tailed and two-tailed p-values?**

A: A two-tailed test checks if the means are different in either direction. A one-tailed test checks if one mean is specifically greater or less than the other. The one-tailed p-value is half the two-tailed p-value.

---

Source: https://vastcalc.com/calculators/statistics/t-test
Category: Statistics
Last updated: 2026-04-21
