Home · Statistics · Inference & Tests · Degrees of Freedom Calculator

Degrees of Freedom Calculator

Degrees of freedom for the common tests: one-sample and two-sample t, the chi-square test of independence, and the between-groups term of a one-way ANOVA.

Your figures

Example result — edit the figures to make it yours

29

Applies toOne-sample t test / interval

What this calculator does

Degrees of freedom for the common tests: one-sample and two-sample t, the chi-square test of independence, and the between-groups term of a one-way ANOVA. Every figure on this page is computed from the standard definition stated below — the same definition used in textbooks and reference tables — with no hidden rounding steps, and the method notes name the exact convention where more than one exists.

The formula and method

t (one sample): n₁ − 1; t (two samples, pooled): n₁ + n₂ − 2; chi-square: (r − 1)(c − 1); ANOVA between groups: groups − 1

Each test spends degrees of freedom on the quantities it estimates from the data: one for a single mean, two for two means in the pooled t-test.

Chi-square on an r × c table: once the row and column totals are fixed, only (r − 1)(c − 1) cells can vary freely.

ANOVA splits its degrees of freedom: groups − 1 between groups (the headline here) and N − groups within groups.

Worked example

With the example inputs this page opens with (sample size 1 30, sample size 2 25, rows r (chi-square) 3, columns c (chi-square) 4), the result is 29. Change any figure and the result updates with the same formula.

Quick reference

Quick reference — varying sample size 1
Sample size 1Result
1514
2423
3029
37.537
4544
6059

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

What are degrees of freedom, intuitively?

The number of values in a calculation that are free to vary once the estimated quantities are fixed. Ten observations with their mean pinned down have nine free deviations — the tenth is forced, because the deviations must sum to zero.

Why does the two-sample t use n₁ + n₂ − 2?

Two means are estimated, one per sample, and each estimation costs one degree of freedom: (n₁ − 1) + (n₂ − 1) = n₁ + n₂ − 2. Welch's unequal-variance version uses a fractional approximation instead.

How does the Degrees of Freedom Calculator work?

Degrees of freedom for the common tests: one-sample and two-sample t, the chi-square test of independence, and the between-groups term of a one-way ANOVA. Test type · n 1 · n 2 · Rows · Columns · Groups → Degrees of freedom. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the Degrees of Freedom Calculator need?

Test type · n 1 · n 2 · Rows · Columns · Groups → Degrees of freedom. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.