T-Test Calculator

Perform one-sample and two-sample t-tests with t-statistic and p-value.

By Konstantin Iakovlev · Updated April 2026 · Source: Khan Academy

t-Statistic

3.0945

Significant?

Yes (p<0.05)

T-Test Results

t-Statistic3.0945
Degrees of Freedom58
p-value (approx)0.0119
Mean Difference3.2000

Use the T-Test Calculator above to calculate your results. Enter your values and see instant results — all calculations run in your browser.

Disclaimer: This calculator is for informational purposes only and does not constitute tax, financial, or legal advice. Results are estimates based on the information you provide and current rates. Always consult a qualified tax professional or financial advisor for advice specific to your situation.

How It Works

At its core, a t-test asks whether the average outcomes of two groups differ by more than chance would explain. Researchers and analysts rely on it to test hypotheses, from comparing two treatments head to head to checking whether a revised process actually improves results.

Which version applies depends on how your data is structured: an independent samples t-test for two unrelated groups, or a paired samples t-test when the same subjects are measured twice. Either way, the t-statistic comes from dividing the difference between the means by the standard error of that difference, and the resulting p-value tells you how surprising the observed gap would be if no real difference existed.

Valid results depend on the test's assumptions holding, including roughly normal data and, for independent samples, comparable variances between groups. Statistical significance also is not the same as importance: a tiny but real difference can produce a small p-value, so read the effect size next to it to judge whether the finding matters in practice.

Example: Comparing Test Scores After Two Teaching Methods

  1. 1 A teacher wants to see if a new teaching method improves student scores. Group A (control) used the old method, and Group B (experimental) used the new method. Input the test scores for each group into the calculator.
  2. 2 The calculator processes the scores for Group A and Group B, calculating their respective means, standard deviations, and the t-statistic. It then determines the p-value associated with this t-statistic.
  3. 3 The calculator outputs a t-statistic of, say, 2.5 and a p-value of 0.015. This p-value is below the common significance level of 0.05.
  4. 4 Since the p-value (0.015) is less than 0.05, we reject the null hypothesis. This suggests there is a statistically significant difference in test scores between the two teaching methods, indicating the new method likely had an effect.

Source: Khan Academy · Last updated: April 2026

Frequently Asked Questions

When should I use a t-test instead of a z-test?
Use a t-test when the sample size is small (typically under 30) or the population standard deviation is unknown (which is most real-world situations). The t-distribution accounts for the extra uncertainty from estimating the standard deviation from the sample.
What is the difference between a one-sample and two-sample t-test?
A one-sample t-test compares a sample mean to a known or hypothesized value (is this group different from 100?). A two-sample t-test compares the means of two independent groups (is group A different from group B?).
What does degrees of freedom mean in a t-test?
Degrees of freedom (df) represent the number of independent values that can vary. For a one-sample t-test, df = n - 1. For a two-sample t-test, df depends on whether you assume equal variances. More degrees of freedom make the t-distribution closer to a normal distribution.