Degrees of Freedom Calculator

Select a test type1-Sample t-test, 2-Sample t-test (equal variances), 2-Sample t-test (unequal variances), Chi-Square, or ANOVA — then enter your sample sizes and relevant parameters. The Degrees of Freedom Calculator returns the correct df value for your chosen test, along with supporting statistics like between-group and within-group df for ANOVA.

Select the statistical test you are performing.

Total number of observations in the sample.

Number of groups being compared in ANOVA.

Number of observations in the first sample.

Number of observations in the second sample.

Variance of the first sample (used for Welch's t-test).

Variance of the second sample (used for Welch's t-test).

Number of rows in the contingency table.

Number of columns in the contingency table.

Results

Degrees of Freedom (df)

--

df Between Groups (ANOVA)

--

df Within Groups (ANOVA)

--

Formula Applied

--

Degrees of Freedom Breakdown

Frequently Asked Questions

What are degrees of freedom in statistics?

Degrees of freedom (df) represent the number of independent pieces of information available to estimate a statistical parameter. Conceptually, they indicate how many values in your dataset are free to vary once certain constraints (like knowing the mean) are applied. A larger df generally leads to more reliable statistical estimates.

How do you calculate degrees of freedom for a 1-sample t-test?

For a 1-sample t-test, the formula is df = N − 1, where N is the sample size. For example, if you have 20 observations, your degrees of freedom would be 19. This single constraint comes from estimating the population mean from the sample mean.

How do you calculate degrees of freedom for a 2-sample t-test with equal variances?

When variances are assumed equal (pooled t-test), df = N₁ + N₂ − 2. You lose one degree of freedom for each sample mean estimated, so with two samples the total reduction is 2.

How is the Welch–Satterthwaite formula used for unequal variances?

When the two samples have unequal variances, the Welch–Satterthwaite approximation is used: df = (S₁²/N₁ + S₂²/N₂)² / [(S₁²/N₁)²/(N₁−1) + (S₂²/N₂)²/(N₂−1)]. This yields a non-integer result that is typically rounded down to be conservative.

How do you find degrees of freedom for a chi-square test?

For a chi-square test of independence using a contingency table, the formula is df = (r − 1) × (c − 1), where r is the number of rows and c is the number of columns. For example, a 3×4 table gives df = (3−1)(4−1) = 6.

How do you calculate degrees of freedom for ANOVA?

ANOVA produces two df values: df between groups = k − 1 (where k is the number of groups) and df within groups = N − k (where N is the total sample size). The total df is N − 1, which equals the sum of the two. Both are needed to look up the critical F-value.

Can degrees of freedom be zero or negative?

Degrees of freedom should always be a positive number greater than zero for a valid statistical test. A df of zero occurs when your sample size equals the number of constraints, leaving no information to estimate variability. Negative df is mathematically impossible and indicates an error in your inputs.

Why do degrees of freedom matter when interpreting statistical tests?

Degrees of freedom determine the shape of the sampling distribution (t-distribution, chi-square distribution, F-distribution) used to compute p-values. With more df the distribution approaches a normal shape, making tests more powerful. Always report df alongside your test statistic and p-value so others can verify your results.

More Statistics Tools