Degrees of Freedom Calculator
Find the correct degrees of freedom for any hypothesis test - instantly.
📖 What are Degrees of Freedom?
Degrees of freedom (df) is one of the most fundamental - and most confusing - concepts in statistics. At its core, df represents the number of independent pieces of information available to estimate a parameter. Every time you estimate something from your data (a mean, a variance, a regression coefficient), you use up one degree of freedom.
The simplest example: if you have n observations and compute the sample mean x̄, you have used 1 degree of freedom. The deviations (x₁ − x̄), (x₂ − x̄), ..., (xₙ − x̄) must sum to zero - so knowing n − 1 of them determines the last. Only n − 1 deviations are free to vary. This is why sample variance divides by n − 1, not n.
Degrees of freedom matter in practice because they determine which probability distribution to use for computing p-values and critical values. The t-distribution with 5 df has much heavier tails than the t-distribution with 50 df - reflecting that small samples have much more uncertainty. A t-statistic of 2.0 has p ≈ 0.10 with 5 df, but p ≈ 0.05 with 50 df.
This calculator handles the most common df formulas: t-tests (one-sample, two-sample, Welch's, paired), chi-square (goodness-of-fit and independence), one-way ANOVA, and multiple regression.
📐 Formulas
Two-sample (equal variance): df = n₁ + n₂ − 2
Welch's (Satterthwaite): df = (s₁²/n₁ + s₂²/n₂)² / [(s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1)]
Chi-square goodness-of-fit: df = k − 1 (k = number of categories)
Chi-square independence (r×c table): df = (r − 1)(c − 1)
One-way ANOVA: df_between = k − 1, df_within = N − k, df_total = N − 1
Multiple regression: df_model = k, df_residual = n − k − 1, df_total = n − 1
📖 How to Use This Calculator
📝 Example Calculations
Example 1 - One-Sample t-Test
n = 25 observations. df = 25 − 1 = 24. Critical value at α = 0.05, two-tailed: t₀.₀₂₅,₂₄ = 2.064.
Example 2 - Two-Sample t-Test
Group 1: n₁ = 20. Group 2: n₂ = 18. df = 20 + 18 − 2 = 36. Critical value at α = 0.05, two-tailed: t₀.₀₂₅,₃₆ ≈ 2.028.
Example 3 - Welch's t-Test
Group 1: s₁=10, n₁=20. Group 2: s₂=25, n₂=12. Numerator = (100/20+625/12)² = (5+52.08)² = 3258. Denominator = 25/19 + 2702/11 = 1.316 + 245.6 = 246.9. df = 3258/246.9 = 13.2 → floor to 13.
Example 4 - Chi-Square Independence (3×4 Table)
r = 3 rows, c = 4 columns. df = (3−1)(4−1) = 2×3 = 6. Use chi-square distribution with 6 df to find the critical value.
Example 5 - One-Way ANOVA
k = 4 groups, N = 40 total observations. df_between = 3, df_within = 36. F ~ F(3, 36). Critical F at α = 0.05: F_crit ≈ 2.866.