Two-Sample F Test for Variances Calculator

Compare the variability of two independent groups measured in the same units. Enter their sample counts and measures of spread, or paste raw observations. Choose a two-sided or directional alternative to calculate the F statistic, p-value, rejection cutoffs and confidence bounds for the ratio of population variances.

Two sample variances

Compare two population variances

Compare independent samples using the classical F test. Inspect the p-value, rejection cutoffs and confidence bounds for the variance ratio.

Test settings and samples

Use independent groups from approximately normal populations, measured in the same units. Summary fields and observation lists retain separate drafts.

Sample A

Variance 4,296.68 · SD 65.5491 · df 239

Sample B

Variance 3,825.95 · SD 61.8543 · df 239

Variance ratio test results

Observed F ratio (A / B)

1.12304

Numerator df 239 · denominator df 239

p-value

0.370383

A variance differs from B

Fail to reject equal variances

Significance level 5% under the classical F-test assumptions.

95% confidence interval for A / B population variance

0.870987 to 1.44803

Two-sided interval

Null F distribution and rejection region

The horizontal scale is logarithmic. Each bar’s area represents the null probability in its F interval. Hatching marks rejection bins.

Lower cutoff 0.775564. Upper cutoff 1.28938.

F ratio · density per unit log(F)

  • Central bins
  • Rejection bins
  • Observed F

0.6% of null probability lies beyond the plotted limits.

Show tail and distribution data
Lower-tail probability at observed F
0.814808
Upper-tail probability at observed F
0.185192
Null F distribution bins
Lower FUpper FProbabilityDensity per unit log(F)Rejection bin
0.699920.7077688.79946e-40.0789214Yes
0.7077680.7157030.001105130.099118Yes
0.7157030.7237280.001377970.123588Yes
0.7237280.7318420.001705790.152991Yes
0.7318420.7400480.002096380.188022Yes
0.7400480.7483450.002557780.229404Yes
0.7483450.7567360.003098140.277869Yes
0.7567360.765220.003725470.334133Yes
0.765220.77380.004447290.398873Yes
0.77380.7755640.00100610.441823Yes
0.7755640.7824760.004264260.480617No
0.7824760.7912490.00620030.556098No
0.7912490.800120.007241130.649449No
0.800120.8090910.008394950.752933No
0.8090910.8181630.009661480.866527No
0.8181630.8273360.01103770.98996No
0.8273360.8366120.01251761.12269No
0.8366120.8459920.01409181.26388No
0.8459920.8554780.01574751.41238No
0.8554780.8650690.01746851.56673No
0.8650690.8747690.0192351.72516No
0.8747690.8845770.02102421.88564No
0.8845770.8944940.02281072.04586No
0.8944940.9045240.02456652.20334No
0.9045240.9146650.02626242.35544No
0.9146650.924920.02786812.49946No
0.924920.9352910.02935372.6327No
0.9352910.9457770.03069012.75256No
0.9457770.9563810.03185032.85662No
0.9563810.9671040.03281012.9427No
0.9671040.9779470.03354883.00896No
0.9779470.9889120.03405063.05396No
0.98891210.03430433.07672No
11.011210.03430433.07672No
1.011211.022550.03405063.05396No
1.022551.034010.03354883.00896No
1.034011.045610.03281012.9427No
1.045611.057330.03185032.85662No
1.057331.069190.03069012.75256No
1.069191.081170.02935372.6327No
1.081171.09330.02786812.49946No
1.09331.105550.02626242.35544No
1.105551.117950.02456652.20334No
1.117951.130480.02281072.04586No
1.130481.143160.02102421.88564No
1.143161.155980.0192351.72516No
1.155981.168940.01746851.56673No
1.168941.182040.01574751.41238No
1.182041.19530.01409181.26388No
1.19531.20870.01251761.12269No
1.20871.222250.01103770.98996No
1.222251.235950.009661480.866527No
1.235951.249810.008394950.752933No
1.249811.263820.007241130.649449No
1.263821.277990.00620030.556098No
1.277991.289380.004264260.480617No
1.289381.292320.00100610.441823Yes
1.292321.306810.004447290.398873Yes
1.306811.321470.003725470.334133Yes
1.321471.336280.003098140.277869Yes
1.336281.351260.002557780.229404Yes
1.351261.366410.002096380.188022Yes
1.366411.381740.001705790.152991Yes
1.381741.397230.001377970.123588Yes
1.397231.412890.001105130.099118Yes
1.412891.428738.79946e-40.0789214Yes

Export the test

Save the sample summaries, test choices, tail probabilities, confidence limits and null distribution bins.

Download F test CSV
Show selectable CSV

How to use this calculator

  1. Start with NIST ceramic batches or Two observation lists. Select Sample input method for standard deviation, variance or observations.
  2. Enter each Sample count and its spread. In observation mode, paste only the numerical measurements in each sample, separated by spaces, commas or new lines.
  3. Choose the Alternative hypothesis and enter Significance level as a percent. Sample A remains the numerator and B the denominator.
  4. Read Variance ratio test results for F, degrees of freedom, the chosen p-value and variance-ratio confidence bounds. Inspect the Null F distribution and rejection region.
  5. Open Show tail and distribution data or Download F test CSV to save the sample summaries, assumptions, p-values, bounds and plotted interval values.

The Formula

The mathematical logic powering this calculation is:

For independent samples A and B, use their unbiased sample variances s²ₐ and s²ᵦ. For raw observations, calculate s² = Σ(x − x̄)²/(n − 1). The statistic is F = s²ₐ/s²ᵦ, preserving the selected numerator and denominator, with d₁ = nₐ − 1 and d₂ = nᵦ − 1. Under the equal-variance null and normal population assumptions, F follows the F distribution with degrees of freedom d₁ and d₂.
The upper-tail p-value is P(F_null ≥ F_observed). The lower-tail p-value is P(F_null ≤ F_observed), calculated using the upper tail of the reciprocal statistic with swapped degrees of freedom. The two-sided p-value is twice the smaller of those tails, capped at 1. Reject equal variances when p < α.
Let q(p) be the lower-tail quantile of F(d₁,d₂). In the two-sided test, critical cutoffs are q(α/2) and q(1 − α/2); the matching confidence interval for the population variance ratio is [F/q(1 − α/2), F/q(α/2)]. For A variance greater than B, compare F with q(1 − α) and use lower confidence bound F/q(1 − α). For A variance less than B, compare F with q(α) and use upper confidence bound F/q(α). Confidence level is 1 − α. The unbounded end of a one-sided interval follows the domain of positive ratios.
The F tail uses a regularized incomplete beta function. Quantiles are solved by bracketing in log(F). Very small p-values retain a base-10 logarithm for display and export. The chart divides the shown log(F) range into bins and inserts the active critical values as boundaries. The area of a bin equals its null probability. The caption reports the probability outside the visible range.
Use sample counts from 2 to 10,000 in summary mode, sample SDs from 0.000001 to 1,000,000, or variances from 0.000000000001 to 1,000,000,000,000. Raw mode accepts 2 to 250 observations per group between −1,000,000 and 1,000,000 and applies the same variance bounds. Enter significance from 0.01% to 25%. Decimal fields support up to 12 fractional digits. Raw observations are accumulated in exact decimal ticks before division.
The classical F test assumes independent observations, independent groups and normal populations. Skew, outliers and dependence can change the actual rejection rate. Compare equality of variances using this test and equality of means using a separate procedure.

Worked Example

If you input:

  • Sample input method: Sample count and standard deviation
  • Sample A: 240 observations, sample SD 65.54909
  • Sample B: 240 observations, sample SD 61.85425
  • Alternative hypothesis: A variance differs from B
  • Significance level: 5%

Result:

The NIST ceramic batches give F ≈ 1.12304 with 239 and 239 degrees of freedom. The two-sided p-value is about 0.370383. The 5% critical cutoffs are close to 0.775564 and 1.28938, and the 95% confidence interval for A divided by B population variance is about 0.870987 to 1.44803. The test fails to reject equal variances.

Frequently Asked Questions

When should I use the two-sample F test for variances?

Use it to compare the variance of two independent groups when a normal population model is appropriate. It asks whether the spreads differ or whether one spread is larger in a specified direction.

Which sample goes in the numerator?

Sample A always goes in the numerator. For a directional test, choose the alternative to match the question you specified before comparing the data. Swapping samples inverts F and reverses the direction of the one-sided alternative.

How is the two-sided p-value calculated?

The tool doubles the smaller probability from the two tails at the observed F. With different degrees of freedom, the F distribution is asymmetric, so taking the larger sample variance first and always doubling the upper tail can give a different answer.

What does a confidence interval containing one mean?

A ratio of one represents equal variances. When one is inside the matching interval, the modeled test fails to reject equal population variances at the selected significance level. The interval also shows other variance ratios compatible with the data under the same assumptions.

Can I use variance zero or a constant sample?

The test needs positive variance in each sample. Constant observations or a zero entered spread trigger an input error. Use the distribution assumptions and measurement resolution to decide whether the samples support this comparison.

How does this differ from one-way ANOVA?

Both procedures use the F distribution. This test compares the variances of two populations directly. One-way ANOVA compares group means using a ratio of between-group and within-group variation.

Similar Calculators