One-Sample T-Test Calculator

t statistic1.250
Standard error1.6000
Degrees of freedom24
Critical value2.064
VerdictFail to reject H0 at alpha = 0.05 (two-tailed)
How this was calculated
  1. Standard error: 8.00 / sqrt(25) = 1.6000.
  2. t = (52.00 - 50.00) / 1.6000 = 1.250, with df = 24.
  3. Critical value from the t table at this alpha and tail setting: 2.064 (the largest table df not exceeding 24 is used).
  4. Since |1.250| is not greater than 2.064, the verdict is: Fail to reject H0 at alpha = 0.05 (two-tailed).

This one-sample t-test calculator determines whether a sample mean differs significantly from a hypothesised mean. Enter your sample mean, hypothesised mean, sample standard deviation, and sample size, and the calculator returns the t statistic, degrees of freedom, standard error, and a decision on the null hypothesis at your chosen significance level. For example, with a mean of 52 versus a hypothesised mean of 50, s of 8, and n of 25, the standard error is 1.6000, t equals 1.250, degrees of freedom equal 24, and because the two-tailed critical value at alpha 0.05 is 2.064, the null hypothesis is not rejected.

The method follows the standard formula t equals the sample mean minus the hypothesised mean, divided by the standard error of the mean, where the standard error equals s divided by the square root of n and degrees of freedom equal n minus 1. Critical values come from Student's t distribution table; for sample sizes between table rows, using the largest table df not exceeding the actual df is the conservative standard practice. The test assumes the data are roughly normally distributed or the sample size is large and that observations are independent; it tests the mean only, not the whole distribution. This page shows the formula, step-by-step workings, worked examples, and sources.

Worked examples

A difference inside the noise

Primary result: 1.250 — the critical value at df 24 is 2.064, so the null hypothesis stands. (52 · 50 · 8 · 25 · 0.05 · Two-tailed)

t statistic1.250
Standard error1.6000
Degrees of freedom24
Critical value2.064
VerdictFail to reject H0 at alpha = 0.05 (two-tailed)

A clear rejection

Primary result: 2.500 — beyond the critical value 2.042 (df 35 uses the df 30 table row), so H0 is rejected. (105 · 100 · 12 · 36 · 0.05 · Two-tailed)

t statistic2.500
Standard error2.0000
Degrees of freedom35
Critical value2.042
VerdictReject H0 at alpha = 0.05 (two-tailed)

One-tailed, strict alpha

Primary result: -1.600 — at alpha 0.01 one-tailed the bar is 2.602, far above this statistic. (78 · 80 · 5 · 16 · 0.01 · One-tailed)

t statistic-1.600
Standard error1.2500
Degrees of freedom15
Critical value2.602
VerdictFail to reject H0 at alpha = 0.01 (one-tailed)

When a one-sample t-test is the right tool

A one-sample t-test is the right tool when you have one group of observations and one hypothesised value for the population mean. It answers a focused question: does the sample mean differ from that reference value? The test uses the formula t = (sample mean − hypothesised mean) / (s / sqrt(n)), where the denominator s / sqrt(n) is the standard error of the mean and the degrees of freedom equal n − 1. Because the formula relies on the sample standard deviation s, the test is designed for situations where the population standard deviation is unknown — which covers most real-world data analysis.

If you already know the population standard deviation, a z-test is the more appropriate choice. The z-test uses the known population value in its denominator rather than estimating spread from the sample, and it draws critical values from the normal distribution rather than Student's t distribution. In practice, however, the population standard deviation is rarely available, so the one-sample t-test calculator is the standard default for single-sample mean comparisons.

The test assumes the data are roughly normally distributed (or the sample size n is large) and that observations are independent. It also tests the mean only, not the whole distribution. When those assumptions fail — for example, with heavily skewed data, extreme outliers, or very small samples that cannot be normalized — a non-parametric alternative such as the Wilcoxon signed-rank test is preferable, because it does not rely on the normality assumption.

Critical values come from Student's t distribution table. For sample sizes that fall between table rows, using the largest table df not exceeding the actual df is the conservative standard practice. In the first verified example, a sample mean of 52 against a hypothesised mean of 50 with s = 8 and n = 25 gives a standard error of 1.6000, t = 1.250, and df = 24; the two-tailed critical value at alpha 0.05 is 2.064, so the null hypothesis is not rejected. A second example with a mean of 105 against 100, s = 12, and n = 36 gives t = 2.500 with df = 35; the table uses the df 30 row with a critical value of 2.042, so H0 is rejected at 0.05. A third example with a mean of 78 against 80, s = 5, and n = 16 at one-tailed alpha 0.01 gives t = −1.600 against a critical value of 2.602 — not rejected.

Worked examples

The table below shows three verified worked examples that illustrate how a one-sample t-test calculator translates raw inputs into a decision. Each row applies the formula t = (sample mean − hypothesised mean) / (s / sqrt(n)), where the denominator s / sqrt(n) is the standard error of the mean and degrees of freedom equal n − 1. The examples span two-tailed and one-tailed tests so you can see how the directionality and significance level change the comparison against the critical value.

Critical values come from Student's t distribution table. For sample sizes between table rows, using the largest table df not exceeding the actual df is the conservative standard practice. That convention explains why the second example, with df = 35, uses the df 30 row and its critical value of 2.042 rather than a value interpolated for 35. This approach slightly widens the rejection threshold, which protects against false positives when the exact degrees of freedom are not available in the table.

Across all three cases the verdict follows the same logic: if the absolute value of t is less than the critical value, the null hypothesis is not rejected. The first example produces t = 1.250 against a critical value of 2.064, so the difference between the sample mean of 52 and the hypothesised mean of 50 is not statistically significant. The second example yields t = 2.500, which exceeds 2.042, so H0 is rejected at the 0.05 level. The third example, a one-tailed test at alpha 0.01, gives t = −1.600 against a critical value of 2.602, again not rejected.

These results depend on the test's underlying assumptions. The test assumes the data are roughly normally distributed (or n is large) and observations are independent. It tests the mean only, not the whole distribution, so a non-significant result does not imply that the sample and hypothesised distributions match in shape, variance, or any other respect.

InputsStandard errortdfCritical valueVerdict
mean 52 vs mu0 50, s = 8, n = 25, two-tailed alpha 0.051.60001.250242.064H0 not rejected
mean 105 vs 100, s = 12, n = 36, two-tailed alpha 0.052.00002.50035 (table uses df 30 row)2.042H0 rejected
mean 78 vs 80, s = 5, n = 16, one-tailed alpha 0.011.2500−1.600152.602H0 not rejected

Reading the verdict

When you run a one-sample t-test calculator, the final step is deciding whether the evidence is strong enough to reject the null hypothesis. That decision hinges on comparing your computed t statistic against a critical value drawn from Student's t distribution table. If the absolute value of t meets or exceeds the critical value, you reject the null hypothesis. If it falls short, you fail to reject it. The critical value itself is set by alpha, the significance level you choose before running the test. Alpha controls the probability of a false positive — rejecting a true null hypothesis. Set alpha at 0.05, and you are accepting a 5 percent chance of that error.

The verified case with a sample mean of 52 against a hypothesised mean of 50 illustrates this cleanly. With s equal to 8 and n equal to 25, the standard error of the mean is 1.6000, giving t equal to 1.250 with 24 degrees of freedom. At alpha 0.05, the two-tailed critical value is 2.064. Because 1.250 does not reach 2.064, the null hypothesis is not rejected. But this outcome does not prove the null hypothesis is true. It means the data did not provide enough evidence to reject it. The true population mean could still differ from 50 — the test simply lacked the sensitivity to detect it at this sample size and significance level.

Contrast that with the verified case where the sample mean is 105 against a hypothesised mean of 100, with s equal to 12 and n equal to 36. Here t equals 2.500 with 35 degrees of freedom. The table uses the df 30 row, giving a critical value of 2.042 at alpha 0.05. Because 2.500 exceeds 2.042, the null hypothesis is rejected. For sample sizes between table rows, using the largest table df not exceeding the actual df is the conservative standard practice, and that is what happened here: 30 is the largest table row value below 35.

A third verified case shows the same logic under a one-tailed test at a stricter threshold. With a sample mean of 78 against a hypothesised mean of 80, s equal to 5, and n equal to 16, t equals negative 1.600. The one-tailed critical value at alpha 0.01 is 2.602. The absolute value of t does not reach 2.602, so the null hypothesis is not rejected. Again, failing to reject is not the same as confirming the null. The test assumes the data are roughly normally distributed or the sample size is large, and that observations are independent. It evaluates the mean only, not the entire distribution.

One-tailed vs two-tailed

A one-sample t-test calculator will ask whether you want a one-tailed or two-tailed test, and that decision matters. A two-tailed test checks for a difference in either direction, while a one-tailed test checks for a difference in one specific direction. A one-tailed test is legitimate only when you can justify, before collecting or examining the data, that only one direction of change is meaningful or possible. If you are testing whether a new teaching method raises test scores, for example, a one-tailed test may be appropriate because a decrease would simply mean the method does not help.

The requirement to choose the direction before seeing the data is not a formality. If you peek at the results and then decide to use a one-tailed test in the direction the data already favor, you are effectively running a two-tailed test while pretending to use a one-tailed test. That practice inflates the true Type I error rate and undermines the validity of the conclusion. The direction must be part of the hypothesis you specify in advance, not a reaction to the numbers.

Choosing a one-tailed test changes the critical value because it places all of the alpha probability in one tail rather than splitting it across both. Consider the verified example where the sample mean is 78, the hypothesized mean is 80, s is 5, and n is 16. The standard error of the mean is s / sqrt(n), which equals 1.25, so t = (78 − 80) / 1.25 = −1.600 with df = 15. At a one-tailed alpha of 0.01, the critical value is 2.602. Because the test statistic does not exceed this critical value, the null hypothesis is not rejected. The same alpha level in a two-tailed test would split the 0.01 across both tails, producing a larger critical value and making rejection even harder.

Critical values come from Student's t distribution table, and for sample sizes between table rows the conservative standard practice is to use the largest table df not exceeding the actual df. This approach keeps the test slightly more cautious rather than risking an anti-conservative conclusion. Whether you use a one-sample t-test calculator for a one-tailed or two-tailed test, the underlying assumptions remain the same: the data should be roughly normally distributed or the sample size should be large, observations must be independent, and the test evaluates the mean only, not the entire distribution.

FAQs

How is a one-sample t-test calculated?

The formula is t = (x-bar − mu0) / (s / sqrt(n)). For example, with x-bar 52, mu0 50, s 8, and n 25, the standard error is 1.6 and t = 1.250. This compares your sample mean against the hypothesized population mean, adjusted for sample size and variability.

What are the degrees of freedom?

Degrees of freedom equal n − 1. A sample of 25 has 24 degrees of freedom, which selects the row of the t table. This value determines the critical value you compare against your calculated t statistic.

When do I reject the null hypothesis?

Reject when |t| exceeds the critical value for your alpha and tail choice. For example, 2.500 > 2.042 rejects the null, while 1.250 < 2.064 does not. Compare your calculated t against the critical value from the t table.

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

A two-tailed test splits alpha between both tails, testing for difference in either direction. A one-tailed test puts all alpha in one direction and uses a smaller critical value in that direction, but must be justified in advance based on your research question.

Why not just use a z-test?

A z-test needs the population standard deviation. With only the sample s available, the t distribution's heavier tails give the correct, wider critical values. Using a z-test when you only have sample data would produce inaccurate results.

Does a bigger sample make t bigger?

Usually. The standard error shrinks with sqrt(n), so the same mean difference produces a larger t. For example, the verified n = 36 case rejects where n = 25 does not, because the larger sample reduces the standard error and increases t.

Sources

Related calculators

Confidence Interval Calculator
The range around a sample mean or a sample proportion at 90%, 95% or 99% confidence, with the standard error and margin of error shown step by step.
Standard Deviation Calculator
Mean, sample and population standard deviation and variance for up to eight numbers — with the n versus n−1 difference explained.
Sample Size Calculator (Surveys & Proportions)
How many responses a survey or A/B readout needs for a target margin of error — with the finite population correction when the audience is small.
Z-Score Calculator
The z-score of any value in a normal distribution, its percentile, and the share of values above and below it — the standardisation behind test scores and quality control.