Skip to content
CalculatorAtlas

One-Sample T-Test Calculator

Tested

One-sample t-test from summary statistics.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

A one-sample t-test uses t = (x̄ − μ₀) ÷ (s ÷ √n) with df = n − 1. A mean of 52 against 50 with s = 2 and n = 2 gives t = 1.414, df = 1 and p = 0.3918.

Enter the sample mean, hypothesised mean, SD, sample size and test type. The calculator returns t, degrees of freedom, p-value and standard error.

Related tools: One-Sample Z-Test Calculator: Z-test for a mean with known population standard deviation. One-Way ANOVA Calculator: One-way analysis of variance across groups. P-Value Calculator: P-value from a z, t, chi-square or F statistic.

How to use the One-Sample T-Test Calculator

  1. Enter sample mean.
  2. Enter hypothesised mean.
  3. Enter sample standard deviation (s) (above 0).
  4. Enter sample size (a whole number, 2 or more).
  5. Choose test type: Two-tailed, Left-tailed and Right-tailed.
  6. Press Calculate to see the result, and use Reset to start again.
Inputs of the One-Sample T-Test Calculator
InputWhat to enterAllowed values
Sample meanA number—
Hypothesised meanA number—
Sample standard deviation (s)A number> 0
Sample sizeA whole number≥ 2
Test typeChoose one: Two-tailed; Left-tailed; Right-tailedStarts at Two-tailed

Formula and method

Formula

t = (x̄ − μ₀) ÷ (s ÷ √n), df = n − 1

IEEE-754 double precision; shown to at most 6 decimal places.

p-value from Student's t distribution (regularized incomplete beta).

Worked examples

These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Sample mean = 52; Hypothesised mean = 50; Sample standard deviation (s) = 2; Sample size = 2; Test type = Two-tailed.

Results of example 1
ResultValue
t statistic1.414214
Degrees of freedom1
p-value0.391827
Standard error1.414214

Example 2

Inputs: Sample mean = 52; Hypothesised mean = 50; Sample standard deviation (s) = 10; Sample size = 25; Test type = Two-tailed.

Results of example 2
ResultValue
t statistic1
Degrees of freedom24
p-value0.327287
Standard error2

The first line is the headline result (t statistic). Below it the one-Sample T-Test Calculator lists degrees of freedom, p-value and standard error, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.

Tiny samples

With n = 2 there is only 1 degree of freedom, so the t distribution has very heavy tails and even t = 1.414 is far from significant. It takes |t| > 12.7 to reach 5% significance at df 1.

Interpretation

A large p-value means the data are consistent with the hypothesised mean. The test assumes normality when n is small. n ≥ 2 is required.

How the result changes with sample mean

Holding every other input at the first worked example, this table changes only sample mean. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with sample mean
Sample meant statisticDegrees of freedomp-value
26-16.97056310.03747
521.41421410.391827
10438.18376610.016669
208111.72287110.005698

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Sample size: entering "1" shows "Sample size must be at least 2." beside that field and no result.

Choosing between the One-Sample T-Test Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the One-Sample T-Test Calculator and similar calculators
CalculatorYou enterIt returns
[One-Sample Z-Test Calculator](/statistics/z-test/)sample mean, hypothesised mean and population σz statistic
[One-Way ANOVA Calculator](/statistics/anova-calculator/)groupsF statistic
[P-Value Calculator](/statistics/p-value/)test statistic, statistic value and test typep-value
[T Statistic Calculator](/statistics/t-statistic/)sample mean, hypothesised mean and sample standard deviationt statistic
[Critical Value Calculator](/statistics/critical-value/)distribution, significance level and tailsCritical value

Background: hypothesis testing and inference

A hypothesis test compares a test statistic with what the null hypothesis predicts. The decision rule is to reject the null hypothesis when the p-value is at or below the significance level α, which you should choose before seeing the data (0.05 is conventional, not special). For a two-tailed z test the p-value is 2 × (1 − Φ(|z|)); for a one-sample t test the statistic is (x̄ − μ₀) ÷ (s ÷ √n) with n − 1 degrees of freedom.

Failing to reject the null hypothesis does not prove it true, and a statistically significant result can still be too small to matter in practice.

Assumptions and limitations

  • n ≥ 2

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for sample size to confirm this.

Frequently asked questions

What is df here?

For a one-sample t-test the degrees of freedom are n − 1; the example with n = 2 has 1.

When use the t-test?

Use a t-test when the population standard deviation is unknown and estimated from the sample, which is the usual case.

What does p = 0.39 mean?

No evidence against the null.

What does the One-Sample T-Test Calculator calculate?

One-sample t-test from summary statistics. It returns t statistic, Degrees of freedom, p-value and Standard error.

What formula does the One-Sample T-Test Calculator use?

t = (x̄ − μ₀) ÷ (s ÷ √n), df = n − 1. p-value from Student's t distribution (regularized incomplete beta).

What do I need to enter in the one-Sample T-Test Calculator?

You enter Sample mean, Hypothesised mean, Sample standard deviation (s), Sample size and Test type.

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. n ≥ 2.

What does the “Test type” option change?

It sets how the one-Sample T-Test is worked out. The choices are Two-tailed, Left-tailed and Right-tailed.

What is an example of a one-Sample T-Test result?

With sample mean 52, hypothesised mean 50, sample standard deviation (s) 2, sample size 2 and test type Two-tailed, the t statistic is 1.414214.

Sources

  • NIST/SEMATECH e-Handbook of Statistical Methods (itl.nist.gov/div898/handbook)
  • Standard textbook definitions (e.g. Moore, McCabe & Craig, Introduction to the Practice of Statistics)

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.