Calculator Suite

T-Test Calculator

Statistical Hypothesis Testing

Perform one-sample, two-sample, and paired t-tests with comprehensive statistical analysis

Analysis Settings
Test Type Selection
Choose the appropriate t-test for your research question

One-Sample T-Test

Selected

Compare sample mean to a known value

Examples:

  • Testing if average height differs from 170cm
  • Checking if test scores differ from 75%

Two-Sample T-Test

Compare means of two independent groups

Examples:

  • Comparing test scores between two classes
  • Testing difference in sales between regions

Paired T-Test

Compare before/after or matched pairs

Examples:

  • Before/after training scores
  • Comparing performance of same subjects under different conditions
Test Configuration
Set up your statistical test parameters

The population mean you want to test against

Enter numeric values separated by commas, spaces, or line breaks

Educational Resources

T-Test Formulas
Mathematical formulas for different t-test types

One-Sample T-Test

t=xˉμ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}

xˉ\bar{x} = Sample mean

μ0\mu_0 = Hypothesized mean

ss = Sample standard deviation

nn = Sample size

Two-Sample T-Test

t=x1ˉx2ˉsp1n1+1n2t = \frac{\bar{x_1} - \bar{x_2}}{s_p \sqrt{\frac{1}{n_1} + \frac{1}{n_2}}}

sp=(n11)s12+(n21)s22n1+n22s_p = \sqrt{\frac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1+n_2-2}}

Pooled standard deviation

Paired T-Test

t=dˉsd/nt = \frac{\bar{d}}{s_d / \sqrt{n}}

dˉ\bar{d} = Mean of differences

sds_d = Standard deviation of differences

TL;DR — T-Test Explained

A t-test compares means to determine if differences are statistically significant. Choose one-sample (compare to known value), two-sample (compare two groups), or paired(before/after same subjects). If p-value < 0.05, the difference is significant.

How to Use This Calculator: Step-by-Step
1

Select Test Type

One-sample, two-sample (independent), or paired t-test based on your data.

2

Enter Your Data

Input sample values separated by commas. For two-sample, enter both groups.

3

Configure Test

Set confidence level (95% typical) and hypothesis direction (two-tailed recommended).

4

Interpret Results

Check p-value, t-statistic, confidence interval, and Cohen's d effect size.

📊 Example: Drug Trial Two-Sample T-Test

Control group (n=20): Mean = 4.2 | Treatment group (n=20): Mean = 5.8

t-statistic

2.84

p-value

0.007

Cohen's d

0.90 (large)

Result

Significant

Interpretation: Treatment group shows significantly higher scores (p = 0.007 < 0.05) with a large effect size.

⚠️ Assumptions & Limitations

Key Assumptions:

  • • Continuous data (interval/ratio scale)
  • • Independent observations
  • • Approximately normal distribution (or n > 30)
  • • Equal variances for two-sample (or use Welch's)

When to Use Alternatives:

  • • Non-normal data: Mann-Whitney U test
  • • >2 groups: ANOVA instead
  • • Known population σ: Z-test
  • • Very small n: Consider bootstrapping
Frequently Asked Questions

What's the difference between a t-test and z-test?

Use a t-test when the population standard deviation is unknown (most real-world cases). Use a z-test when population σ is known and n > 30.

What does the p-value actually mean?

The p-value is the probability of observing results as extreme as yours if the null hypothesis were true. It is NOT the probability that the null hypothesis is true.

How many samples do I need?

A minimum of 15-30 observations per group is recommended. Larger samples provide more statistical power to detect real differences.

Should I use one-tailed or two-tailed?

Use two-tailed unless you have a specific directional hypothesis stated before data collection. Two-tailed is more conservative.

What is Cohen's d and why does it matter?

Cohen's d measures effect size: Small ≈ 0.2, Medium ≈ 0.5, Large ≈ 0.8. A significant p-value with tiny effect size may not be practically important.

Curated video guide
Selected YouTube lessons that add context after the calculator, formulas, examples, assumptions, and limitations.

Two-sample t test for difference of means

Source: Khan Academy on YouTube

Why this video: Selected because it explains a common t-test workflow from an educational source and avoids overstating p-values.

What it adds: It supplements the calculator's two-sample mode by connecting means, variability, and the test statistic.

Use with this calculator: Use the calculator to compute the test, then use the video to review what the difference of means test is asking.

Limits: The lesson covers one design and does not replace checking assumptions, study design, multiple testing, or practical effect size.

How this calculator works
Method, formula, examples, assumptions, and review notes for this calculator.

How this calculator works

  • The calculator computes the selected t statistic and compares it with a t distribution using the relevant degrees of freedom.
  • One-sample, independent two-sample, and paired designs answer different questions and should not be interchanged.
  • P-values are interpreted against a chosen significance level, while confidence intervals show a range of plausible effect sizes.

Formula

One-sample t statistic

t=xˉμ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}

Plain text formula: t = observed sample mean minus hypothesized mean, divided by standard error.

\bar{x} = sample mean
\mu_0 = hypothesized population mean
s = sample standard deviation
n = sample size

Worked examples

One-sample test

Inputs

  • Sample mean: 52
  • Hypothesized mean: 50
  • Sample SD: 4
  • n: 16

Calculation

  • Standard error = 4 / sqrt(16) = 1.
  • t = (52 - 50) / 1 = 2.

A t statistic of 2 suggests the sample mean is two standard errors above the hypothesized mean; significance depends on degrees of freedom and alpha.

Curated video guide
Selected YouTube lessons that add context after the calculator, formulas, examples, assumptions, and limitations.

Two-sample t test for difference of means

Source: Khan Academy on YouTube

Why this video: Selected because it explains a common t-test workflow from an educational source and avoids overstating p-values.

What it adds: It supplements the calculator's two-sample mode by connecting means, variability, and the test statistic.

Use with this calculator: Use the calculator to compute the test, then use the video to review what the difference of means test is asking.

Limits: The lesson covers one design and does not replace checking assumptions, study design, multiple testing, or practical effect size.

How to interpret your result

  • A small p-value suggests the observed difference would be unusual under the null model, but it does not measure practical importance.
  • Effect size and confidence interval should be reviewed with the p-value.

Assumptions

  • Observations are independent within the design.
  • The outcome is numeric and the sampling distribution of the mean is reasonably modeled by a t distribution.
  • Independent two-sample tests require an appropriate variance assumption or Welch adjustment.

Limitations

  • A t-test does not prove causation.
  • Very small samples are sensitive to non-normality and outliers.
  • Multiple testing increases false-positive risk if not controlled.

Common mistakes

  • Using an independent t-test for paired before-and-after data.
  • Treating p < 0.05 as proof that an effect is large or important.
  • Ignoring outliers and distribution shape.

Sources

Disclaimer

Last updated and reviewed by

Updated 2026-06-06Calculator Suite editorial review