A Lot Of Tools
Toggle language
Toggle theme

T-Test Calculator

Perform one-sample, two-sample (independent), and paired t-tests. Calculate t-statistics, p-values, and determine statistical significance.

T-Test Calculator

Test if the sample mean differs from a hypothesized population mean.

How to Use the T-Test Calculator

Enter your data values separated by spaces, commas, or newlines. Choose the appropriate test type based on your research design and set the significance level (alpha).

Types of T-Tests

One-Sample T-Test

Tests whether a sample mean differs from a hypothesized population mean:

  • H₀: μ = μ₀ (sample mean equals hypothesized mean)
  • H₁: μ ≠ μ₀ (two-tailed) or μ < μ₀ / μ > μ₀ (one-tailed)
  • Example: Testing if average test scores differ from 75

Two-Sample (Independent) T-Test

Compares means of two independent groups:

  • Student's t-test: Assumes equal variances
  • Welch's t-test: Does not assume equal variances (recommended)
  • Example: Comparing treatment vs. control group

Paired T-Test

Compares two related measurements on the same subjects:

  • Before/After studies: Same subjects measured twice
  • Matched pairs: Subjects paired on relevant characteristics
  • Example: Blood pressure before and after treatment

Interpreting Results

  • t-Statistic: Measures how many standard errors the sample mean is from H₀
  • p-Value: Probability of observing results as extreme under H₀
  • Significant if: p-value < α (reject null hypothesis)
  • Not significant if: p-value ≥ α (fail to reject null hypothesis)

Choosing the Right Test

  • One sample vs. known value: Use one-sample t-test
  • Two independent groups: Use two-sample t-test
  • Same subjects, two conditions: Use paired t-test
  • Large samples (n > 30): T-test approximates z-test

Assumptions

  • Normality: Data should be approximately normally distributed
  • Independence: Observations should be independent (except paired)
  • Equal variances: For Student's t-test (use Welch's if uncertain)
  • Random sampling: Data should come from random samples

Common Applications

  • Medical research (drug effectiveness)
  • Psychology experiments (treatment effects)
  • Quality control (process comparisons)
  • Education research (teaching methods)
  • A/B testing (conversion rates)

Formula Reference

One-sample: t = (x̄ - μ₀) / (s/√n)

Two-sample (pooled): t = (x̄₁ - x̄₂) / √(sp² × (1/n₁ + 1/n₂))

Paired: t = d̄ / (sd/√n)

Worked Example: One-Sample T-Test

Suppose five students score 78, 82, 75, 85, and 80 on an exam, and you want to test whether the class mean differs from 75. The sample mean is 80 and the sample standard deviation is about 3.81, so t = (80 − 75) / (3.81/√5) ≈ 2.93 with 4 degrees of freedom. The two-tailed p-value is about 0.043, which is below α = 0.05, so you reject the null hypothesis: the class average is significantly different from 75.

Frequently Asked Questions

How do I know which t-test to use?+

Use a one-sample t-test to compare one group's mean against a fixed value, a two-sample (independent) t-test to compare two separate groups, and a paired t-test when the same subjects are measured twice, such as before and after a treatment. If you are unsure whether two independent groups have equal variances, choose Welch's version — it is safer and loses almost no power.

What does the p-value from a t-test mean?+

The p-value is the probability of observing a t-statistic at least as extreme as yours if the null hypothesis were true. If it is below your significance level (commonly 0.05), the difference is called statistically significant and you reject the null hypothesis. A p-value of 0.03, for instance, means such a result would occur only 3% of the time by chance alone.

What sample size do I need for a t-test?+

A t-test can technically run with as few as 2 observations per group, but small samples have little power to detect real differences and depend heavily on the normality assumption. With roughly 30 or more observations per group, the t-distribution closely approximates the normal distribution and the test becomes robust to moderate non-normality.

What is the difference between one-tailed and two-tailed tests?+

A two-tailed test asks whether the mean differs in either direction, while a one-tailed test asks only whether it is greater (or only less) than the comparison value. A one-tailed p-value is half the two-tailed one, but you should only use it when the direction was specified before collecting data.

Is this t-test calculator free, and is my data kept private?+

Yes. The calculator is free, requires no registration, and all computation runs in your browser — your data never leaves your device, which matters for sensitive research or student records. It also works on mobile devices, so you can run quick significance checks anywhere.