🧮
🧮 Math & statistics

Degrees of Freedom Calculator (t-tests, Welch, chi-square, ANOVA, regression)

Results update as you type.

Your numbers

Understanding the degrees of freedom calculator — concept and principle

This calculator gives the degrees of freedom (df) for common statistical tests: one-sample and paired t-tests, two-sample t-tests with equal or unequal variances (Welch), chi-square goodness of fit and independence, one-way ANOVA and linear regression. The df decide which t, χ² or F distribution gives the p-value.

Welch degrees of freedomWelch degrees of freedomGroup 14.2² ÷ 12 = 1.47Group 26.8² ÷ 15 = 3.08(1.47 + 3.08)² ÷ (0.196 + 0.679)df23.68 → use 23equal-variance df would be 12 + 15 − 2 = 25
Unequal spreads cost degrees of freedom: Welch gives 23.68 instead of 25.

How it is calculated

The principle

Every statistic estimated from the data uses up some of its freedom. With n values and a known mean, only n − 1 values can be chosen freely; the last is fixed. Fewer degrees of freedom mean more uncertainty in estimates such as the standard deviation, so test distributions get heavier tails. Welch's formula blends the two samples' information according to how much each contributes to the standard error, which is why it usually gives a fractional df between the smaller sample's n − 1 and n₁ + n₂ − 2.

Worked example

Default inputs: Welch t-test, n₁ = 12, n₂ = 15, s₁ = 4.2, s₂ = 6.8.

  1. s₁²/n₁ = 17.64 ÷ 12 = 1.47; s₂²/n₂ = 46.24 ÷ 15 = 3.0827.
  2. Numerator = (1.47 + 3.0827)² = 4.5527² = 20.727.
  3. Denominator = 1.47² ÷ 11 + 3.0827² ÷ 14 = 0.19645 + 0.67878 = 0.87523.
  4. df = 20.727 ÷ 0.87523 = 23.6818, using inputs n₁, n₂, s₁, s₂.
  5. Rounded down (conservative) = 23; the equal-variance df would be 12 + 15 − 2 = 25.
How Degrees of freedom changes with Sample size n (n₁; total N for ANOVA)How Degrees of freedom changes with Samp…051015202536912151824Example: 23.6818Sample size n (n₁; total N for ANOVA)
Each point is the calculator re-run with only “Sample size n (n₁; total N for ANOVA)” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Sample size n (n₁; total N for ANOVA)Degrees of freedom
34.4712
615.0665
921.9405
1223.6818
1523.3246
1822.448
2420.7538

How to read the result

Software uses the fractional Welch df directly; printed tables need it rounded down, which gives a slightly larger critical value and a more cautious test. Here the Welch df is lower than 25 because the second group is more variable, so its uncertainty dominates. Larger df bring t and χ²-based tests closer to their large-sample forms.

Common mistakes

Keep in mind: The correct df depend on the exact test and design. Check the method section of your course or software before reporting results.

Frequently asked questions

Why is it n − 1 and not n?

One degree of freedom is used up by estimating the mean from the same data.

Why is Welch's df not a whole number?

It is an approximation that weights each sample's variance; software accepts fractional df.

What are the df for a 3 × 4 chi-square table?

(3 − 1)(4 − 1) = 6.

Sources: NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.3 Two-Sample t-Test for Equal Means

Checked 9 Nov 2026. NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.3 Two-Sample t-Test for Equal Means (ν = N₁ + N₂ − 2 for equal variances; Welch–Satterthwaite ν for unequal variances). One-sample, chi-square, ANOVA and regression degrees of freedom: standard formulas.

🧮 All math & statistics tools →🌍 Calculators by country →