Degrees of freedom, explained
Degrees of freedom is the parameter everyone types in and almost nobody can define. It has a concrete meaning, a different formula for each test, and a real effect on the p-value you get.
7 min read · Last reviewed 7 August 2026
What it actually counts
Degrees of freedom is the number of values in a calculation that are free to vary. Every quantity you estimate from the data before computing your statistic uses one up.
The standard example: suppose five numbers have a mean of 10. You can choose the first four
freely — say 8, 12, 9 and 14. The fifth is now forced to be 7, because nothing else produces
a mean of 10. Four values were free; one was determined. That is why estimating a single
mean costs one degree of freedom and leaves you with n − 1.
The formula for every common test
| Test | Degrees of freedom |
|---|---|
| One-sample t | n − 1 |
| Paired t | n − 1, where n is the number of pairs |
| Two-sample t (pooled) | n₁ + n₂ − 2 |
| Two-sample t (Welch) | Welch–Satterthwaite, usually fractional |
| Pearson correlation | n − 2 |
| Chi-square, independence | (rows − 1) × (columns − 1) |
| Chi-square, goodness of fit | categories − 1 |
| One-way ANOVA | k − 1 and N − k |
| Linear regression | n − predictors − 1 |
The pattern holds throughout: start with the number of independent observations, subtract one for each parameter you had to estimate on the way.
Why F has two
An F-statistic is a ratio of two variances, and each carries its own degrees of freedom. In a
one-way ANOVA with k groups and N observations, the numerator has
k − 1 and the denominator has N − k. Both are needed to identify
the distribution, which is why the F converter asks for
two numbers where the t converter asks for one.
Why Welch's df is a decimal
Welch's t-test does not assume the two groups share a variance, so it cannot simply add the sample sizes and subtract two. Instead it estimates an effective degrees of freedom from the two observed variances using the Welch–Satterthwaite equation, and the result is almost never a whole number.
With n₁ = 15, s₁ = 4.2, n₂ = 18 and s₂ = 7.9, the pooled formula would give 31. Welch gives 26.751. Seeing a fractional df in R or SPSS output is not a bug — it is the signature of a Welch test, and it is the default here for the reasons the t-test calculator sets out.
What df does to your p-value
Small degrees of freedom mean heavier tails, because the variance was estimated from little
data and could easily be wrong. Heavier tails mean the same statistic buys you a larger
p-value. The identical t = 2.31 gives:
| df | Two-tailed p |
|---|---|
| 5 | 0.06891 |
| 10 | 0.04351 |
| 27 | 0.02877 |
| 60 | 0.02434 |
| 200 | 0.02191 |
The same evidence is significant at df = 10 and not at df = 5. This is not a quirk — it is the test correctly being more sceptical when you have less information about the spread.
As df grows the t-distribution converges on the normal. The two-tailed 5% critical value falls from 12.7062 at df = 1, to 2.2281 at df = 10, to 2.0423 at df = 30, to 1.9840 at df = 100, approaching the normal's 1.96 and never quite reaching it. By df = 100 the difference is too small to matter for most purposes, which is the origin of the rule of thumb that large samples can use z.
Two common mistakes
Entering n instead of df. With n = 30 a correlation has 28 degrees of freedom, not 30. Entering the sample size makes your p-value slightly too small. The converters here ask for whichever quantity is less ambiguous and say which one they want.
Counting pairs twice. A paired t-test on 20 people measured before and after has 19 degrees of freedom, not 39. There are 20 differences, not 40 independent observations — the pairing is the whole point of the design.