Calculators
Home › Calculators › Degrees of Freedom

Degrees of Freedom Calculator

How many values are free to vary? The number every table lookup depends on.

Calculate degrees of freedom

Pick a scenario and enter the sizes; the formula is shown with the result.

Quick answer: One sample: df = n − 1. Two samples: n₁ + n₂ − 2. Chi-square table: (rows − 1)(columns − 1). Correlation: n − 2.

How to use this degrees of freedom calculator

Choose your scenario above (one sample, two samples, a chi-square table, or a correlation), enter the sample sizes (or table dimensions), and press Calculate. The degrees of freedom appear with the formula that produced them.

What "degrees of freedom" actually means

Degrees of freedom counts how many values in a calculation are free to vary once the summary statistics are fixed. Suppose three numbers must average 10. Pick the first two freely, say 8 and 12, and the third is forced: it must be 10 for the mean to hold. Three values, one constraint, two degrees of freedom. That is the whole idea; every formula in this calculator is bookkeeping of the same kind.

Worked example

A one-sample t-test on 25 students has df = 25 − 1 = 24. A chi-square test on a 3×4 contingency table has df = (3−1)(4−1) = 6. Those single numbers select the row of the t-table or chi-square table you read your critical value from: get the df wrong and every conclusion downstream is wrong with it.

The patterns worth remembering

Common mistake: using n instead of n − 1 for a sample variance or one-sample t-test. The missing degree is the price of estimating the mean from the same data: Bessel's correction and df are the same idea wearing different clothes.

Frequently asked questions

Why do we lose a degree of freedom when estimating the mean?

Because the deviations from a sample mean must sum to zero: knowing n − 1 of them determines the last one. That single constraint is the lost degree of freedom.

Where do I use degrees of freedom?

To pick the correct row of a t, chi-square or F table, and inside the formulas for sample variance, ANOVA and regression. Every inferential tool on this site asks for it.

Can degrees of freedom be zero or negative?

Only if the sample is too small for the analysis: n = 1 gives df = 0 for a t-test, which is statistics' way of saying the test is impossible.