# One-Sample t-Test Calculator

URL: https://speedycalculator.com/calculators/statistics/t-test/
Last updated: 2026-10-25

> The one-sample t-test calculator tests whether a sample mean differs from a hypothesised value. It gives the t statistic, degrees of freedom and two-tailed p-value.

## Inputs

- Sample mean
- Hypothesised mean (μ₀)
- Sample standard deviation
- Sample size

## Results

- t statistic
- Degrees of freedom
- Two-tailed p-value

## Formula

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

## Explanation

The t-test is the standard way to compare a mean with a target when the population standard deviation is unknown.

### How to use the One-Sample t-Test Calculator

- **Sample mean**
- **Hypothesised mean (μ₀)**
- **Sample standard deviation**
- **Sample size**

Results update as you type, and every field accepts the units shown in its menu.

### How it works

Divide the difference between the sample mean and the hypothesised mean by the standard error, then use the t distribution.

### Inputs explained

FieldWhat to enterSample meanA numberHypothesised mean (μ₀)A numberSample standard deviationA numberSample sizeA number

### What each result means

- **t statistic** = ([Sample mean] - [Hypothesised mean (μ₀)])÷([Sample standard deviation]÷sqrt([Sample size]))
- **Degrees of freedom** = [Sample size] - 1
- **Two-tailed p-value** = 2×(1 - tcdf(abs([t statistic]), [Degrees of freedom]))

### Example values

How the main result changes when **Sample mean** changes and everything else stays at the example values above:

Sample meanTwo-tailed p-value26.15039.221.3893e-1052.30.047965.382.7978e-1478.450104.60

## Worked example

Inputs — Sample mean: 52.3; Hypothesised mean (μ₀): 50; Sample standard deviation: 6.1; Sample size: 30.

Results — t statistic = 2.0652; Degrees of freedom = 29; **Two-tailed p-value = 0.04795**.

## FAQ

**Does a small p-value prove my hypothesis?**
No; it means the data would be unlikely if the null hypothesis were true.

**What are the assumptions?**
Independent observations and roughly normal data, especially for small samples.

**What formula does the One-Sample t-Test Calculator use?**
t = (x̄ − μ₀) ÷ (s ÷ √n).


## Sources

- [NIST/SEMATECH e-Handbook of Statistical Methods](https://www.itl.nist.gov/div898/handbook/)
