Degrees of freedom (df) describe how many values in a statistical calculation are free to vary once certain totals or estimated parameters are fixed. Every common hypothesis test β t-tests, chi-square tests, and ANOVA β relies on df to pick the exact shape of the distribution used to judge significance. This calculator covers the formulas for the five most common test setups so you can move straight to a critical-value or p-value lookup.
How degrees of freedom work
Degrees of freedom count the number of independent pieces of information available to estimate a parameter, after accounting for constraints already imposed on the data. In a one-sample t-test, once the sample mean is computed from n observations, only n β 1 of those observations are still free to vary β the last one is determined by the requirement that they average to the sample mean. The same logic scales up: a two-sample t-test loses one degree of freedom per group (nβ + nβ β 2), and a chi-square table loses one degree of freedom per row and column margin that's held fixed.
Inputs and what they mean
For t-tests, enter the sample size (n) for a one-sample or paired test, or the two group sizes (nβ, nβ) for an independent two-sample test β each must be a whole number of at least 2. For chi-square goodness-of-fit, enter the number of categories (k) being compared to an expected distribution. For chi-square independence, enter the number of rows (r) and columns (c) in your contingency table. For ANOVA, enter the number of groups (k) and the total number of observations across all groups (N) β the calculator returns between-groups, within-groups, and total degrees of freedom.
Limits and edge cases
This calculator assumes the standard, most common df formulas: pooled two-sample t-tests rather than Welch's unequal-variance adjustment (which uses a fractional Satterthwaite approximation instead of a clean integer), and one-way (not repeated-measures or factorial) ANOVA. If your two-sample t-test uses Welch's correction, the exact df will differ slightly from nβ + nβ β 2 β use the dedicated T-Test Calculator for that case. Degrees of freedom alone don't tell you whether a result is statistically significant; pair the df with your test statistic and significance level using a critical-value table or p-value calculator.