T-Test Calculator

Reviewed by CalcMulti Editorial Team·Last updated: ·Statistics Hub

The t-test is one of the most widely used statistical hypothesis tests. It determines whether there is a significant difference between a sample mean and a known value (one-sample t-test) or between two independent groups (two-sample t-test).

This calculator computes the t-statistic, degrees of freedom, and p-value, then interprets the result at the 0.05 significance level. Use it for A/B testing, clinical comparisons, before/after studies, and research hypothesis testing.

Formula

One-sample: t = (x̄ − μ₀) / (s / √n) Two-sample: t = (x̄₁ − x̄₂) / √(s₁²/n₁ + s₂²/n₂)

sample mean
μ₀
hypothesised population mean (one-sample test)
s
sample standard deviation
n
sample size
df
degrees of freedom (n−1 for one-sample; Welch approximation for two-sample)

The value you are testing your sample mean against

When to Use Each t-Test Type

TestUse whenExample
One-sampleComparing a sample mean to a known constantIs our product weight significantly different from the stated 500g?
Two-sample (independent)Comparing means of two unrelated groupsDo male and female students score differently on the same test?
Paired (not here)Same subjects measured twice (before/after)Did blood pressure change after treatment in the same patients?

Common Mistakes in t-Tests

Confusing statistical and practical significance

A statistically significant result (p < 0.05) does not mean the difference is large or meaningful. With very large samples, tiny differences become significant. Always report effect size (Cohen's d) alongside p-values.

Using paired t-test data in a two-sample test

If the same subjects were measured twice, you must use a paired t-test — not two-sample. Using two-sample on paired data reduces power and may give the wrong answer.

Checking significance after peeking at data

Deciding to run a t-test after seeing the data direction inflates Type I error. Pre-register your hypothesis and analysis plan before collecting data.

Disclaimer

This calculator is for educational and exploratory purposes only. Statistical significance does not imply practical importance. Consult a qualified statistician before making decisions based on hypothesis tests.

Frequently Asked Questions