Degrees of freedom counts how many values in a calculation are free to vary once the constraints are honoured. Know the mean of three numbers and two of the numbers, and the third is forced: it must make the sum come out right. So three numbers carry only two degrees of freedom about their mean. That is the whole idea, and everything else is bookkeeping. Each estimated quantity used inside a calculation spends one degree of freedom, because it imposes one constraint. The sample variance divides by n minus 1 precisely because the deviations are measured from an estimated mean, and only n minus 1 of them are free; the last is determined by the others.
The t and chi-square distributions are indexed by degrees of freedom because the freedom count sets how much estimation noise is in play. With few degrees of freedom, the sample standard deviation is itself a wobbly estimate, so the t distribution grows heavy tails to price that wobble; with many, the estimate steadies and the curve relaxes into the normal. Degrees of freedom also police regression: fitting 10 parameters to 12 points leaves 2 degrees of freedom for error, and the model can contort through nearly every point while explaining nothing. The residual degrees of freedom, n minus the number of fitted parameters, is the honest denominator in every error estimate, and software reports it for those who read the small print.
Whenever degrees of freedom appear, count what was estimated. A chi-square goodness-of-fit test on 6 categories has 5 degrees of freedom, minus more if parameters were estimated from the same data. A two-way table with r rows and c columns has (r minus 1)(c minus 1), because the row and column totals are the constraints. ANOVA splits degrees of freedom between groups and within groups exactly as it splits the variance. Treating the count as a budget, information earned by data and spent by estimation, turns a foggy phrase into arithmetic you can audit. When a reported degree of freedom looks wrong, something upstream is wrong too, and it is worth finding. The budget metaphor extends to whole studies. A data set of one hundred observations that is used to estimate fifty quantities has spent half its information before any testing begins, and the remaining fifty degrees of freedom must carry all the conclusions. This is why parsimony is a statistical virtue rather than an aesthetic one: every parameter must earn its degree of freedom by explaining more than it costs. Model selection criteria formalise the accounting, penalising complexity in exactly this currency. When a model's degrees of freedom run low, its apparent precision is borrowed money, and the interest arrives as soon as new data shows up to collect.
The free calculators that go with this guide:
See degrees of freedom in a t-test