Degrees of Freedom Calculator
Choose your statistical test, enter values, and get the correct degrees of freedom (df) instantly.
What is a degree of freedom?
If you searched for a degree freedom calculator, you are really asking one core question: how many values in my analysis are free to vary after I apply constraints? In statistics, that number is called degrees of freedom (df).
A quick intuition: if you know the average of 5 numbers and you already picked 4 of them, the last one is forced.
So only 4 were truly free. That is why many common formulas include terms like n - 1, n - 2, or
(r - 1)(c - 1).
Why degrees of freedom matter
- They determine the correct reference distribution (t, chi-square, F).
- They affect p-values and confidence intervals.
- Using the wrong df can make results look stronger or weaker than they should be.
- They are essential in transparent reporting for research, business, and academic work.
Common df formulas (quick reference)
- One-sample t-test: df = n - 1
- Two-sample t-test (equal variances): df = n₁ + n₂ - 2
- Welch's t-test: Satterthwaite approximation (usually non-integer df)
- Chi-square goodness-of-fit: df = k - 1 - m
- Chi-square contingency: df = (r - 1)(c - 1)
- One-way ANOVA: dfbetween = g - 1, dfwithin = N - g, dftotal = N - 1
- Simple regression/correlation test: df = n - 2
How to use this calculator
Step 1: Choose your test type
Select the exact method that matches your analysis. This is the most important step.
Step 2: Enter sample design values
Provide sample sizes, table dimensions, or model setup values. For Welch's test, include standard deviations, because df depends on both variance and sample size.
Step 3: Click Calculate
The result box returns the df value and formula context so you can report it correctly in your write-up or software output check.
Worked examples
Example 1: One-sample t-test
If n = 18, then df = 18 - 1 = 17.
Example 2: Two-sample pooled t-test
If n₁ = 25 and n₂ = 19, then df = 25 + 19 - 2 = 42.
Example 3: Contingency table
For a 3 × 4 table, df = (3 - 1)(4 - 1) = 6.
Example 4: One-way ANOVA
Suppose g = 4 groups and total N = 52 observations: dfbetween = 3, dfwithin = 48, dftotal = 51.
Common mistakes to avoid
- Using pooled t-test df when variances are clearly unequal (should use Welch).
- Forgetting to subtract estimated parameters in chi-square goodness-of-fit.
- Confusing total sample size with per-group sample size in ANOVA.
- Rounding Welch df too early before looking up p-values.
Final note
Degrees of freedom are small numbers with big consequences. This calculator helps you get df right fast, but always pair the value with the correct test assumptions and data quality checks.