AP Stats Degrees of Freedom Calculator

Degrees of freedom (df) tell a t-distribution or chi-square distribution how spread out to be. Pick the test, enter the sample sizes or table size, and this calculator gives the df — and explains what that df is used for.

Degrees of Freedom Calculator

Choose a test type, enter the sizes, and press Calculate.

Interactive visual: Live preview

Press Show live preview to redraw this chart from your calculator inputs.

What Are Degrees of Freedom?

Degrees of freedom is the number of values in a calculation that are free to vary. For a one-sample t-test it is n - 1, because once you know the sample mean, only n - 1 of the values can change freely. The t-distribution and chi-square distribution both change shape with their degrees of freedom.

Interactive visual: See the idea

Example: one-sample t with n = 25 gives df = 25 - 1 = 24.

How to Use This Calculator

Interactive visual: Walk through it

Step 1: Open the AP Stats Degrees of Freedom Calculator calculator at the top and enter the values it asks for.

1. Choose the test you are doing. 2. Only the inputs for that test appear. 3. Enter the sample size, or the number of categories, rows, and columns. 4. Press Calculate. The result shows the formula, the df, and what the df is used for in that test.

How to Calculate Degrees of Freedom

Interactive visual: See it on a chart

Press Update visual to redraw this chart from your calculator inputs.

TestFormula
One-sample tdf = n − 1
Two-sample t (conservative)df = smaller of (n1 − 1) and (n2 − 1)
Chi-square goodness of fitdf = number of categories − 1
Chi-square independence / homogeneitydf = (rows − 1) × (columns − 1)
Linear regression slope testdf = n − 2

Worked examples: One-sample t with n = 25 gives df = 25 − 1 = 24. A chi-square test on a 3 × 2 table gives df = (3 − 1) × (2 − 1) = 2. A regression with n = 20 points gives df = 20 − 2 = 18, because two values (slope and intercept) are estimated from the data.

Tips and Common Mistakes

Interactive visual: Mistake vs correct

Mistake: Using n instead of n - 1 for a one-sample test.

Frequently Asked Questions

Interactive visual: FAQ

Tap any question below to show or hide its answer.

What are degrees of freedom, in plain language?

They are the number of values that are free to vary after estimates are made. If you estimate a mean from n values, one value is fixed by that mean, so df = n − 1.

Why does df change the t-distribution?

With small df, the t-distribution has heavier tails than the normal distribution, because the standard deviation is estimated. As df grows, the t-distribution gets closer to normal.

Why is two-sample df conservative here?

Exact two-sample df uses a complicated formula. AP Statistics accepts the conservative choice, the smaller of n1 − 1 and n2 − 1, which gives a slightly larger p-value and is safe for the exam.

Does a z-test have degrees of freedom?

No. A z-test uses the normal distribution and a known population standard deviation, so there is no df to look up.

Why does chi-square goodness of fit use categories − 1?

Once the total count is fixed, the last category count is determined by the others, so one degree of freedom is lost.

What df do I use for a paired t-test?

Use the one-sample option with n = number of pairs, so df = number of pairs − 1. A paired test is a one-sample test on the differences.

AP is a trademark of the College Board, which was not involved in this site.

Related Calculators and Guides

Keep exploring AP Statistics with calculators and guides related to this tool.

Related Calculators

Interactive visual: Tool path

Start with this tool, then follow the path through the related calculators.

Degrees of Freedom Calculator → T-Test Calculator → Chi-Square Calculator

Related Guides

All AP Statistics Calculators

Use any of the 25 free calculators below, no login needed. Each calculator opens on its own page with its own formula, worked example, tips, and FAQs.

AP Statistics Score Calculator Z-Score Calculator P-Value Calculator T-Test Calculator Confidence Interval Calculator Margin of Error Calculator Standard Deviation Calculator Chi-Square Calculator Binomial Distribution Calculator Normal Distribution Calculator Expected Value Calculator Hypothesis Testing Calculator Sample Size Calculator Correlation Coefficient Calculator Residual Calculator Linear Regression Calculator Two-Sample T-Test Calculator Proportion Confidence Interval Calculator Variance Calculator Geometric Distribution Calculator Percentile Calculator Degrees of Freedom Calculator Outlier Calculator R-Squared Calculator Poisson Distribution Calculator

Read the AP Statistics guides for worked examples, TI-84 steps, and exam strategy.