T-Test Calculator

One-sample and two-sample t-tests with p-value and t-statistic

The t-test calculator performs one-sample t-tests with t-statistic, degrees of freedom, and approximate p-value. Test whether a sample mean significantly differs from a hypothesized population mean.

One-Sample T-Test Calculator

How to Use the T-Test Calculator

The one-sample t-test tests whether a sample mean is significantly different from a specified value μ₀, accounting for sample variability through the t distribution.

Example

A manufacturer claims their bolts are 10 mm. You measure 25 bolts: x̄=10.3 mm, s=0.8 mm. H₀: μ = 10. t = (10.3−10)/(0.8/√25) = 0.3/0.16 = 1.875. df=24. Two-tailed p ≈ 0.073. At α=0.05, fail to reject null — not enough evidence to dispute the manufacturer's claim.

Choosing One vs Two-Tailed Test

Two-tailed: "Is the mean different from μ₀?" (could be higher or lower). Right-tailed: "Is the mean greater than μ₀?" Left-tailed: "Is the mean less than μ₀?" Always choose the test direction before collecting data, not after seeing the results.

Frequently Asked Questions

What is a t-test?

A t-test determines whether the mean of a sample significantly differs from a hypothesized value (one-sample) or whether two groups have different means (two-sample). The t-statistic = (x̄ − μ₀) / (s / √n) for one-sample. The p-value tells you the probability of seeing results this extreme if the null hypothesis is true.

When should I use a t-test vs z-test?

Use a t-test when n < 30 or when the population standard deviation is unknown (most real situations). Use a z-test when n ≥ 30 and σ is known. For small samples, the t distribution has heavier tails, giving more conservative (wider) p-values, which is appropriate when you have less data.

Is this calculator free?

Yes, completely free with no signup required. All calculations run in your browser.

Is my data private?

Yes. All calculations run locally. Nothing is transmitted.

What is a paired t-test?

A paired t-test compares measurements from the same subjects before and after an intervention. You subtract the pairs and perform a one-sample t-test on the differences, testing whether the mean difference = 0. Pairing reduces variability by controlling for individual differences, giving more statistical power.