T-Test Calculator

Use this free online t-test calculator to run a one-sample t-test from your sample data. Enter the sample mean, standard deviation, sample size, and hypothesized mean to get the t-statistic, p-value, degrees of freedom, and a clear accept or reject decision.

Enter Values

The average of your sample data

The standard deviation calculated from your sample

The number of observations in your sample

The population mean you are testing against (null hypothesis value)

Common values: 0.05 (95% confidence), 0.01 (99% confidence)

Result

Enter values above and click Calculate to see your result.

AI Assistant

Ask about this calculator

I can help you understand the t-test calculator formula, interpret your results, and answer follow-up questions.

Try asking

Formula

#
Core Formula
t=xˉμ0snt = \frac{\bar{x} - \mu_0}{\frac{s}{\sqrt{n}}}

How it works: Subtract the hypothesized mean from the sample mean, then divide by the standard error (sample standard deviation divided by the square root of the sample size). The result tells you how many standard errors the sample mean is from the hypothesized value.

Review and Methodology

Updated Mar 26, 2026

This calculator runs locally in your browser. Inputs are converted into the units required by the formula, and the result is paired with supporting references so you can verify the method before using it for planning or estimates.

Worked Example

Sample mean = 52, Std dev = 10, n = 25, Hypothesized mean = 50, alpha = 0.05
1Step 1: Standard error = 10 / sqrt(25) = 10 / 5 = 2
2Step 2: t = (52 - 50) / 2 = 1.00
3Step 3: Degrees of freedom = 25 - 1 = 24
4Step 4: For a two-tailed test with df = 24, p-value is approximately 0.327
5Step 5: Since p = 0.327 > 0.05, fail to reject the null hypothesis
Result: t = 1.00, p = 0.327. Insufficient evidence that the population mean differs from 50.

What Is a T-Test and When Should You Use It?

The t-test is one of the most widely used statistical hypothesis tests. It was developed by William Sealy Gosset (publishing under the pseudonym "Student") in 1908. The one-sample t-test compares a sample mean to a known or hypothesized population mean when the population standard deviation is unknown.

  • Use a t-test when the population standard deviation is unknown and must be estimated from the sample
  • The t-distribution has heavier tails than the normal distribution, accounting for extra uncertainty from estimating the standard deviation
  • As sample size increases, the t-distribution approaches the normal (z) distribution
  • Assumptions: the data should be approximately normally distributed or the sample size should be large enough (n > 30) for the Central Limit Theorem
  • The one-sample t-test is used in quality control, clinical trials, A/B testing, and academic research

The t-test balances simplicity with statistical rigor, making it suitable for small samples where the z-test would be inappropriate.

You can also calculate changes using our Z-Test Calculator, Degrees of Freedom Calculator, Test Statistic Calculator or Standard Deviation Calculator.

Frequently Asked Questions

When should I use a t-test instead of a z-test?

Use a t-test when the population standard deviation is unknown and you must estimate it from the sample. Use a z-test when the population standard deviation is known. In practice, t-tests are far more common because population standard deviations are rarely known.

What does a small p-value mean?

A p-value below your significance level (alpha) means the observed difference is statistically significant. For example, p = 0.03 with alpha = 0.05 means you reject the null hypothesis. The smaller the p-value, the stronger the evidence against the null.

What are the assumptions of a one-sample t-test?

The data should be continuous, approximately normally distributed (or n > 30 for the Central Limit Theorem), and observations should be independent. The t-test is fairly robust to mild violations of normality, especially with larger samples.

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

A two-tailed test checks whether the mean is different from mu0 in either direction. A one-tailed test checks only whether the mean is greater than (or less than) mu0. Two-tailed tests are more conservative and more commonly used.

How do I interpret degrees of freedom?

Degrees of freedom (df = n - 1) reflect the amount of independent information in the sample. More degrees of freedom means the t-distribution is closer to the normal distribution.

Can I use the t-test for proportions?

No. The t-test is for continuous data (means). For proportions, use a z-test for proportions or a chi-square test.

How do I add this T-Test Calculator to my site?

Absolutely. Use the "Embed" option above to tailor the dimensions, color scheme, and styling to match your site. Copy the generated iframe snippet and drop it into your HTML, WordPress editor, or any CMS. There is no cost and no account required. See calculory.com/services/embed-calculators for a step-by-step walkthrough.

Accurate and Reliable

All calculations run locally. Trusted statistical analysis with step-by-step breakdowns.

Verified Precision

Precise Statistical Calculations Powered by Calculory AI