Degrees of Freedom Calculator

df for one-sample, paired, pooled and Welch t-tests, chi-square tests, ANOVA, regression and correlation.

One-sample or paired t-test: df = n − 1. Two-sample pooled t-test: n₁ + n₂ − 2. Chi-square independence: (rows − 1)(columns − 1). One-way ANOVA: k − 1 and N − k. Welch's t-test uses the Welch-Satterthwaite formula, usually a non-integer.

Free, runs in your browser. Nothing you enter is uploaded.

How to use it

  1. Pick the statistical test.
  2. Enter the sample sizes (and SDs for Welch, or rows and columns for a contingency table).
  3. Read the degrees of freedom and the formula used.

What you enter

What you get

Formula

t: n − 1 | pooled: n₁ + n₂ − 2 | Welch: (s₁²/n₁ + s₂²/n₂)² / [(s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1)] | χ²: (r−1)(c−1) | ANOVA: k − 1, N − k

Worked example: Welch's t-test

Input: n₁ = 15, s₁ = 4.2; n₂ = 12, s₂ = 6.8

Result: df = 17.46

Lower than the pooled 25 because the variances differ.

Questions

What are degrees of freedom?

The number of values that are free to vary once the statistics you estimated are fixed. Estimating a mean uses one up, so a sample of n has n − 1.

How do you find df for a two-sample t-test?

With equal variances assumed, df = n₁ + n₂ − 2. Without that assumption (Welch's test), use the Welch-Satterthwaite formula, which this tool calculates from the SDs.

What are the degrees of freedom for chi-square?

Goodness of fit: categories − 1 (minus one more per estimated parameter). Test of independence: (r − 1)(c − 1); a 2 × 2 table has 1.

Why do degrees of freedom matter?

They pick the right t, chi-square or F distribution to turn a test statistic into a p-value or critical value.

Related reading

More Statistics

All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.