Calculators

T-Test Calculator

Run a one-sample, two-sample (pooled or Welch), or paired t-test locally in your browser and read the t statistic, degrees of freedom, and two-tailed p-value.

Choose a test type and enter the summary statistics. One-sample compares a sample mean to a hypothesized mean; two-sample compares two independent groups (pooled or Welch); paired compares the mean difference across matched pairs. The t statistic, degrees of freedom, and two-tailed p-value are computed locally in your browser; your values are not uploaded or stored. Results assume approximately normal data and independent observations.

Your t-test results will appear here.

Test whether a mean or a difference is statistically significant.

A t-test compares a mean or a difference of means against a hypothesized value. For a one-sample test, t = (x̄ − μ) ÷ (s ÷ √n) with df = n − 1. For two independent samples, choose pooled or Welch: pooled uses sp² = [(n₁ − 1)s₁² + (n₂ − 1)s₂²] ÷ (n₁ + n₂ − 2) and t = (x̄₁ − x̄₂) ÷ [sp × √(1 ÷ n₁ + 1 ÷ n₂)] with df = n₁ + n₂ − 2; Welch uses t = (x̄₁ − x̄₂) ÷ √(s₁² ÷ n₁ + s₂² ÷ n₂) with the Satterthwaite df. For paired data, t = d̄ ÷ (sd ÷ √n) with df = n − 1. The two-tailed p-value comes from the Student t distribution, and a result below α = 0.05 rejects the null hypothesis. For example, a one-sample test with mean 5.2, hypothesized mean 5, standard deviation 1.4 and n = 30 gives t ≈ 0.7825, df = 29 and p ≈ 0.4403; a Welch test with means 5.2 and 4.0, standard deviations 1.4 and 1.3, and n = 30 each gives t ≈ 3.4403, df ≈ 57.68 and p ≈ 0.0011; a paired test with mean difference 0.8, SD of differences 1.1 and 25 pairs gives t ≈ 3.6364, df = 24 and p ≈ 0.0013. Means and differences accept signed numbers and standard deviations must be zero or positive with sample sizes of at least 2; at least one standard deviation must be greater than zero for a two-sample test. The p-value is computed with a regularized incomplete beta function, so large test statistics stay accurate. Results assume approximately normal data and independent observations and are not a substitute for a full statistical review. All calculations run locally in your browser; your values are not uploaded or stored.

Frequently Asked Questions

Everything you need to know about this tool, how it works, and privacy.

What is a t-test?

A t-test compares a sample mean, or a difference of means, against a hypothesized value and reports how likely the observed difference would be if the null hypothesis were true. It returns a t statistic, degrees of freedom, and a p-value.

Which t-test should I use?

Use a one-sample test to compare a single sample mean with a known or hypothesized mean. Use a two-sample test to compare two independent groups. Use a paired test when the observations come in matched pairs and you analyse the differences.

What is the difference between pooled and Welch?

The pooled test assumes both groups share one variance and uses a single pooled standard deviation with df = n1 + n2 − 2. Welch does not assume equal variances, uses each group variance separately, and computes the Satterthwaite degrees of freedom. Welch is the safer default when group variances may differ.

How is the p-value calculated?

The two-tailed p-value is the probability of a t statistic at least as extreme as the observed value under the Student t distribution, computed with a regularized incomplete beta function. The one-tailed p-value is half the two-tailed value in the direction of the observed t.

What does significant at α = 0.05 mean?

A p-value below 0.05 means the observed result would occur less than 5% of the time if the null hypothesis were true, so the calculator reports rejecting the null hypothesis. A higher p-value means there is not enough evidence to reject it. This is a convention, not proof.

Are my data values uploaded?

No. All calculations run locally in your browser. CodeASystem does not upload or store your input values.