Skip to content
CalculatorZilo Logo
  • Home
  • CalculatorsExpand
    • Browse all calculators
    • Education
    • Real Estate
    • Chemistry
  • Finance
  • Math
  • Health & Fitness
  • Science
  • About
  • Contact
CalculatorZilo Logo
Home / Statistics Calculators / Degrees of Freedom Calculator
Statistics Calculators

Degrees of Freedom Calculator

Published onOctober 2, 2025 Updated onOctober 21, 2026 5:39 am

A degrees of freedom calculator finds the df for t-tests, chi-square tests, ANOVA, F-tests, correlation and regression. Pick your test, enter the sample sizes, and get the degrees of freedom with the formula and the working shown for that exact test.

Every mode here is pre-filled with a worked example, so the first click shows a complete result, steps included, for the test you selected. Switch tests and the fields, the defaults, and the formula all change to match.

Degrees of Freedom Calculator
df for 10 statistical tests, with the formula and working for each one

Degrees of freedom count how many values are free to vary after estimating parameters from the same data. They set the shape of the t, chi-square and F distributions you compare your test statistic against.

Quick Answer

Quick answer: For the pre-filled one-sample t-test with n = 25, the degrees of freedom are df = 24: 25 minus 1 for the sample mean estimated from the same data. The rule behind every mode in this calculator is the same: start with the observations, subtract one degree for each parameter estimated from those observations, and use the matching formula for the test. Change the test in the dropdown and the calculator applies that test's formula with its own worked example loaded.

Key takeaways

  • df = n - 1 is only the one-sample case. Two samples cost 2, a chi-square table ignores n entirely, and regression costs one degree per coefficient plus one for the intercept.
  • Welch df is a decimal by design: 42.5256 on the pre-filled example, against a pooled df of 43. Software uses the decimal as-is; only a printed table forces a lookup, and then the convention is to round down.
  • ANOVA and F-tests return more than one df. ANOVA splits into between, within, and total, which must add up; an F-test returns an ordered pair, numerator first.
  • The chi-square goodness of fit mode subtracts parameters estimated from the data, a step most formula tables skip: 6 categories with 1 fitted parameter give df = 4, not 5.
On this page
  • Quick Answer
  • How to use this degrees of freedom calculator
  • What degrees of freedom actually count
  • Every formula in one table, with the pre-filled examples
  • Worked example: one-sample t-test with n = 25
  • The Welch case: a decimal df is the correct answer
  • ANOVA and F-tests: df that arrive in sets
  • Mistakes that produce the wrong df
  • What competing calculators miss
  • Frequently Asked Questions

How to use this degrees of freedom calculator

Select the test first, because the test decides which numbers the formula needs. The fields rebuild themselves for each test.

1

Pick the statistical test. Ten are covered: one-sample, paired, and two-sample t-tests (pooled and Welch), both chi-square tests, one-way ANOVA, the F-test, correlation, and regression.

2

Enter the counts the formula asks for. Sample sizes for t-tests, rows and columns for a chi-square table, groups and total observations for ANOVA, predictors for regression. Counts must be whole numbers, and the calculator says exactly which rule a bad entry breaks.

3

Click Calculate and read the steps, not just the headline. Every result shows the formula for that test, your numbers substituted in, and one line on why the subtraction takes the shape it does.

4

Carry the df into the right distribution. The df selects the t, chi-square, or F curve your statistic is compared against, which is what sets the critical value and the p-value. For a t-test, the next step is usually a critical t score lookup at that exact df.

What degrees of freedom actually count

Degrees of freedom count how many values in a calculation are free to vary once the parameters estimated from the same data are pinned down. Estimate a mean from 25 values and the deviations from that mean must sum to zero, so the last deviation is forced by the other 24: only 24 values carry independent information about spread. That single constraint is the whole idea, and every formula in the table below is that idea applied to a different test design.

The practical consequence is distributional. The t, chi-square, and F families are not single curves but families indexed by df: low df means heavy tails and wide critical values, high df pulls the t curve toward the normal curve. This is also why sample variance divides by n - 1, the Bessel correction: the n - 1 in the denominator is exactly the one-sample df doing its work. Readers coming from the normal distribution can see the contrast on the area to z-score calculator: the z distribution has no df at all, because it assumes the population spread is known rather than estimated.

The general rule: df = number of observations minus number of parameters estimated from those observations. Each test below is this rule with its own bookkeeping: means estimated, table totals fixed, or coefficients fitted.

Every formula in one table, with the pre-filled examples

Each row is one mode of the calculator, loaded with the values the mode opens with. Select the test, leave the fields as they are, and Calculate returns the result in the last column.

TestFormulaPre-filled exampleResult
One-sample t-testdf = n - 1n = 25df = 24
Paired t-testdf = n - 1 (n = pairs)20 pairsdf = 19
Two-sample t-test (equal variances)df = n1 + n2 - 2n1 = 20, n2 = 25df = 43
Two-sample t-test (Welch)Welch-Satterthwaite equations1 = 5, n1 = 20, s2 = 7, n2 = 25df = 42.5256
Chi-square goodness of fitdf = k - 1 - estimated parametersk = 6, parameters = 0df = 5
Chi-square test of independencedf = (r - 1) x (c - 1)r = 3, c = 4df = 6
One-way ANOVAk - 1, N - k, N - 1k = 4, N = 60df between = 3, df within = 56, df total = 59
F-test (two variances)df1 = n1 - 1, df2 = n2 - 1n1 = 15, n2 = 18df1 = 14, df2 = 17
Correlation testdf = n - 2n = 30df = 28
Regression (residual df)df = n - p - 1n = 50, p = 4df (residual) = 45

The correlation row deserves one extra note, because the -2 surprises people: a significance test for a correlation coefficient uses df = n - 2, since two means, one for each variable, sit behind the calculation. If you have the coefficient itself and need it first, the correlation coefficient calculator computes r from paired data, and this page then supplies the df its significance test needs.

Worked example: one-sample t-test with n = 25

The calculator opens on this mode. A researcher measures one sample of 25 observations, estimates the sample mean from those same 25 values, and runs a one-sample t-test.

25
Observations (n)
1
Mean estimated from the data
df = 24
Degrees of freedom

The tool's steps say it plainly: df = 25 - 1 = 24, and one degree is lost because the sample mean is estimated from the same 25 values. That df then follows the t statistic everywhere it goes: the critical value is read from the t distribution with 24 df, and any confidence interval built on the same sample uses that same row of the t table. Change the sample to 10 and the cost of the estimated mean is proportionally much heavier, df = 9 with visibly wider critical values, which is why small samples are where df mistakes hurt most.

The Welch case: a decimal df is the correct answer

When two groups have clearly different spreads, the pooled formula n1 + n2 - 2 overstates the df, because it pretends both samples estimate one shared variance. The Welch-Satterthwaite equation weights each sample's variance contribution instead, and the NIST/SEMATECH e-Handbook presents the same equation as the standard way to approximate df for combined uncertainty estimates.

Welch-Satterthwaite: df = (s1²/n1 + s2²/n2)² / [ (s1²/n1)²/(n1 - 1) + (s2²/n2)²/(n2 - 1) ], where s is each sample's standard deviation and n its size. Enter standard deviations: the tool squares them itself.

On the pre-filled example, s1 = 5 with n1 = 20 and s2 = 7 with n2 = 25, the tool computes s1²/n1 = 1.25 and s2²/n2 = 1.96, and returns df = 42.5256, with the pooled figure of 43 shown beside it for comparison. The two sit close here because the sample sizes and spreads are similar; push the spreads apart and the Welch value drops well below the pooled one, widening the t curve and making the test more conservative, which is the point of the correction.

Welch df (unequal variances)42.5256
Pooled df (equal variances)43

On rounding, the honest position needs both halves. Statistical software carries the decimal into the p-value calculation, and this tool reports the decimal for that use. If you are forced onto a printed t table, which only lists whole df rows, the classroom convention is to round down to the next whole row, never up, because the lower df gives the larger, more conservative critical value.

ANOVA and F-tests: df that arrive in sets

Two modes return more than one number, and both sets carry a built-in check. For one-way ANOVA with k = 4 groups and N = 60 total observations, the tool returns df between = 3 (groups varying around the grand mean), df within = 56 (observations varying around their group means), and df total = 59. The check is arithmetic: 3 + 56 = 59. If a hand calculation or a software table fails that sum, one of the three was computed from the wrong count, most often by entering one group's size where the total N belongs.

The F-test returns an ordered pair instead: df1 = 14 and df2 = 17 for samples of 15 and 18. Order matters because the F distribution is not symmetric in its two df parameters. df1 belongs to the sample whose variance sits in the numerator of the F ratio, df2 to the denominator sample, and swapping them changes the critical value. The ANOVA F statistic uses the same pairing idea, with df between as the numerator df and df within as the denominator df, which is why the two modes keep the same order convention.

Mistakes that produce the wrong df

MistakeWhat goes wrongCorrect handling
Using n - 1 for every testTwo-sample, table, and model based tests all get understated or overstated dfMatch the formula to the test: the subtraction counts parameters estimated, not a fixed 1
Counting paired measurements twice20 pairs entered as n = 40 gives df = 39 instead of 19A paired test runs on the differences, so n is the number of pairs
Rounding Welch df upThe t curve gets thinner tails than the data support, shrinking the p-valueUse the decimal in software; round down only for a printed table
Basing chi-square independence df on nSample size never enters the formula, so big samples get absurd dfdf = (rows - 1) x (columns - 1), from the table's shape alone
Forgetting fitted parameters in goodness of fitEach parameter fitted from the data inflates df by 1 if ignoredSubtract them: k - 1 - estimated parameters, the adjustment the NIST handbook's goodness-of-fit treatment also applies
Skipping the intercept in regressiondf comes out 1 too highResidual df = n - p - 1: one per slope, plus one for the intercept

What competing calculators miss

The strongest ranking pages for this term publish good formula tables, and several run a multi-test tool. Working through them against this calculator's ten modes surfaced consistent gaps.

Miss 1: fewer tests in the tool itself. Brave Calculator's version covers four formulas: one-sample, two-sample, chi-square, and ANOVA. There is no paired t-test, no F-test pair, no correlation df, and no regression residual df, so a reader running any of those tests is sent back to hand arithmetic. All ten run here, each with its own fields and steps.

Miss 2: the goodness of fit parameter adjustment. The formula tables at CalculatorsHub and StandardDeviationCalculator give goodness of fit as df = k - 1, full stop. That is right only when no parameters were estimated from the data. Fit a distribution's mean from the same counts and the correct df drops by one per parameter, which is why this tool asks for the estimated parameter count explicitly and refuses a result when the subtraction would go below 1.

Miss 3: Welch inputs described loosely enough to break the result. AllMath's Welch formula labels the squared term with sigma and then defines sigma as the variance, leaving a reader unsure whether to enter a standard deviation, a variance, or a population value. This tool's fields ask for the sample standard deviations s1 and s2 by name, square them inside the formula, and print the intermediate s²/n values in the steps so the arithmetic can be audited.

Miss 4: a number with no working. A bare df cannot be checked. Every result here expands into the formula, the substituted values, and the reason for the subtraction, and the ANOVA result even carries its own addition check (between + within = total) inside the steps.

Disclaimer: this calculator is an educational tool that computes degrees of freedom for the ten test designs listed. It does not compute test statistics or p-values, and it does not judge whether a test's assumptions fit your data. For graded or published work, confirm the df against your course or journal's conventions, especially the Welch rounding convention.

Frequently Asked Questions

Because the sample mean is estimated from the same n values. Once you know the mean and n - 1 of the values, the last value is fixed, so only n - 1 are free to vary.

Yes, for the Welch t-test. The Satterthwaite approximation produces fractional df that should be used as-is in p-value calculations.

Every parameter you estimate from the data (like a mean for a Poisson fit) adds a constraint, costing one more degree of freedom. The default of zero estimated parameters covers the common textbook case.

Df between (k - 1) reflects the group means varying around the grand mean. Df within (N - k) reflects individual observations varying around their group means. They sum to the total df (N - 1).

No. The z-test uses the standard normal distribution, which has no degrees-of-freedom parameter. Df only matters when you use the t, chi-square or F distributions.

It is n - p - 1, where p is the number of predictors. Each estimated coefficient (the slopes plus the intercept) consumes one degree of freedom, and the rest are left for the residuals.

Enter the number of pairs. A paired test first collapses each pair into a single difference, so 20 pairs measured twice are 20 differences, not 40 observations, and df = 20 - 1 = 19. Entering the total measurement count is the most common paired-test error and roughly doubles the df.

The df selects which t, chi-square, or F distribution your statistic is judged against, so a wrong df shifts the critical value and the p-value even when the test statistic itself is correct. The damage is largest at small sample sizes, where the distributions change shape fastest: at df = 9 the two-sided 5% t critical value is about 2.26, against about 2.06 at df = 24 and 1.96 in the normal limit.

Add This Calculator to Your Website

Embed the Degrees of Freedom Calculator on your own site. Pick a size to preview it live, then copy the code.

Powered by Calculator Zilo

References

  1. NIST/SEMATECH e-Handbook of Statistical Methods, "Degrees of Freedom" (Measurement Process Characterization, 2.5.7.1): degrees of freedom for uncertainty components and the Welch-Satterthwaite formula for combined degrees of freedom. NIST e-Handbook: Degrees of Freedom and the Welch-Satterthwaite Formula. Accessed October 2026.
  2. NIST/SEMATECH e-Handbook of Statistical Methods, "Chi-Square Goodness-of-Fit Test" (Exploratory Data Analysis, 1.3.5.15): the test statistic follows a chi-square distribution with k - c degrees of freedom, where c counts the estimated parameters plus one. NIST e-Handbook: Chi-Square Goodness-of-Fit Test. Accessed October 2026.
  3. NIST/SEMATECH e-Handbook of Statistical Methods, "Chi-Square Test for the Variance" (Exploratory Data Analysis, 1.3.5.8): critical values taken from the chi-square distribution with N - 1 degrees of freedom. NIST e-Handbook: Chi-Square Test for the Variance. Accessed October 2026.
  4. NIST/SEMATECH e-Handbook of Statistical Methods, "Are the Data Consistent with the Assumed Process Mean?" (Process or Product Monitoring and Control): a worked t-test example evaluated at degrees of freedom = N - 1 = 9 against the t-table critical value. NIST e-Handbook: t-test example with N - 1 degrees of freedom. Accessed October 2026.
  5. Ryan Tibshirani, Carnegie Mellon University, "Degrees of Freedom" (Advanced Methods for Data Analysis lecture notes): the rigorous definition of degrees of freedom for fitting procedures and its covariance form. Carnegie Mellon: Degrees of Freedom lecture notes (PDF). Accessed October 2026.

Related calculators

Statistics CalculatorsSample Mean Calculator: Free Stats Tool OnlineThe sample mean is the average of a subset: add the values, divide by how many there are.Statistics CalculatorsStandard Deviation Probability CalculatorGiven a normal distribution's mean and standard deviation, this calculator finds the probability of falling...Statistics CalculatorsLinear Regression CalculatorLinear regression finds the straight line that fits your paired data best: the line whose squared misses, added up, are smaller than any other line's.Statistics CalculatorsStatistics CalculatorPaste a dataset and this calculator returns the full descriptive picture: count, sum, mean, median, mode,...Statistics CalculatorsMean Median Mode Calculator Give this calculator any list of numbers and it returns the mean, median and mode together, with every step...Statistics CalculatorsCorrelation Coefficient Calculator Paste two columns of numbers into a spreadsheet and you can see they move together, but your eye cannot tell you how strongly, whether the pattern could be luck, or what line best fits it.

We use cookies to analyze traffic and to serve ads that keep our calculators free. You can accept or decline cookies below. Learn more

calculatorzilo

CalculatorZilo

Free calculators for everyday life. No signup, no cost, just answers.

Categories

Finance Math Health & Fitness Education Science Real Estate Chemistry Browse all calculators

Popular tools

Mortgage Payment Calculator BMI Walking Calculator Salary Per Minute Calculator Percentage Off Calculator

Company

About Us Contact Us Privacy Policy Terms and Conditions
Disclaimer Cookie Policy DMCA Policy FAQ Accessibility Statement

© 2026 CalculatorZilo • Free calculators for everyone

  • Home
  • Calculators
    • Browse all calculators
    • Education
    • Real Estate
    • Chemistry
  • Finance
  • Math
  • Health & Fitness
  • Science
  • About
  • Contact
Search