Skip to main content
Calcimator

T-Test Calculator

Calculate the t-statistic, degrees of freedom, and approximate p-value for a one-sample t-test.

About this calculator

This calculator runs a one-sample t-test: T-Statistic is (sampleMean − populationMean) / standardError (line 10), where Standard Error is Sample Standard Deviation divided by the square root of Sample Size (line 9). Sample Mean and Population Mean pull on T-Statistic with the same underlying sensitivity (1/standardError in each direction), but Sample Mean's default of 105 is 5% larger than Population Mean's default of 100, so a proportional nudge to Sample Mean produces a slightly larger absolute swing — not because the formula weighs it more, but because its starting value is bigger. Degrees of Freedom is just Sample Size − 1 (line 11) and, at the default Sample Size of 30, works out to 29 — one short of the engine's own df ≥ 30 threshold for switching to the large-sample normal approximation (line 16).

That means the default calculation actually runs through the small-sample branch (adjustedZ = absT × √(df/(df+1)), line 21), not the "large df" approximation, despite n = 30 being the textbook rule of thumb for when a normal approximation is considered safe. The 95% Margin of Error is always built from a fixed z = 1.96 (line 27) regardless of anything else on the page — this calculator has no confidence-level input to change that.

Inputs

Results

T-Statistic

1.83

P-Value (two-tailed, approx)

0.07

Degrees of Freedom29
Standard Error2.74
Significant at α=0.05 (1=Yes)0
95% Margin of Error (z-approx)5.37
How to Use This Calculator
  1. Enter Sample Mean (x̄), Population Mean (μ), and Sample Standard Deviation (s).
  2. Set Sample Size (n).
  3. Review T-Statistic and P-Value (two-tailed, approx).
  4. Use Degrees of Freedom and Standard Error to inform your decision.
  5. Use the chart to visualize the results and explore different scenarios by adjusting inputs.

How the result changes with Sample Mean (x̄)

Sample Mean (x̄)T-StatisticP-Value (two-tailed, approx)
53-17.160
79-7.670
15821.180
26359.520

What each input means

Sample Mean (x̄)
The mean of your sample data.
Population Mean (μ)
The hypothesized population mean under the null hypothesis.
Sample Standard Deviation (s)
The standard deviation of your sample data.
Sample Size (n)
The number of observations in your sample. Must be at least 2.

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    Sample Mean (x̄) = 105, Population Mean (μ) = 100, Sample Standard Deviation (s) = 15, Sample Size (n) = 30 = 4 input(s) provided
  2. Calculate T-Statistic
    T-Statistic
    1.8257 = 1.8257
  3. Calculate P-Value
    P-Value
    0.0726 = 0.0726
  4. Calculate Degrees of Freedom
    Degrees of Freedom = df
    29 = 29
  5. Calculate Standard Error
    Standard Error
    2.7386 = 2.7386

Engine last updated . Checked against 2 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Does Sample Mean or Population Mean move the T-Statistic more?

Sample Mean does, at the calculator's default values — but only because its default (105) is larger than Population Mean's default (100). T-Statistic is (sampleMean − populationMean) / standardError (line 10), so both inputs have the identical underlying sensitivity; the difference here comes purely from their different starting values.

At the default sample size of 30, does the calculator use the large-sample approximation?

No, even though 30 is the usual textbook cutoff. Degrees of Freedom is sampleSize − 1 (line 11), so a Sample Size of 30 gives df = 29, one short of the engine's own df ≥ 30 threshold (line 16). That means the default run actually uses the small-sample adjustment formula, not the normal approximation.

What confidence level does the 95% Margin of Error assume?

It's fixed at 95% no matter what — the engine hardcodes z = 1.96 for this figure (line 27, "z-based approx for 95%") rather than reading a confidence level from an input, since this calculator has no confidence-level field at all; only Significant at α=0.05 uses a fixed 5% threshold elsewhere in the engine.

Does Sample Mean affect the Standard Error shown?

No. Standard Error is Sample Standard Deviation divided by the square root of Sample Size (line 9) and never references Sample Mean or Population Mean at all — those two only feed into the numerator of T-Statistic, not the Standard Error denominator.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Math & Statistics.