Lelifi·tools

Pooled Variance Calculator

Pooled variance weights each sample variance by its degrees of freedom, not by sample size. For n1 = 12 with s1 = 5 and n2 = 10 with s2 = 7, that is (11 x 25 + 9 x 49) / 20 = 35.8, so the pooled standard deviation is 5.98.

Enter the size and standard deviation of each sample. The means are optional: fill both to get the standard error, the t statistic and Cohen's d. Samples need at least 2 observations each.

Enter the size and standard deviation of two samples to get the pooled variance, pooled standard deviation, degrees of freedom, standard error of the difference and Cohen's d.

By the Lelifi editors ·

Key takeaways

Numerator of the pooled variance, by group11 x 25 plus 9 x 49 adds up to 716 over 20 degrees of freedomGroup 1: 11 df x 25275Group 2: 9 df x 49441
The numerator 716 splits into 275 from the 12-point sample and 441 from the 10-point sample, divided by 20 degrees of freedom.
Unequal samples: plain average against pooledn1 = 40 with s1 = 5 and n2 = 5 with s2 = 12Degrees-of-freedom weighted36.1Plain average of variances84.5
With samples of 40 and 5, the degrees-of-freedom weighted estimate is 36.1 while a plain average of the variances gives 84.5.
On this page
  1. What pooled variance combines
  2. The formula and how the weighting works
  3. Why the plain average is not the answer
  4. A worked example: 12 and 10 samples, step by step
  5. Equal sample sizes: the shortcut and when it holds
  6. When pooling is the right assumption
  7. From pooled variance to the t test and Cohen's d
  8. Units, mistakes and sanity checks

What pooled variance combines

Two samples rarely land on the same standard deviation, even when they come from populations that share one true spread. A lab measures a reference solution on 12 days and gets a standard deviation of 5 units. A second analyst runs 10 measurements of the same solution and gets 7. If both are estimating the same underlying variability, neither number alone uses all the evidence. The pooled variance is the single variance estimate built from both samples at once, and it is the variance that sits inside the classic two-sample t test.

The idea is a weighted average. Each sample contributes its variance, and the weight is its degrees of freedom, which is the sample size minus 1. A sample of 12 carries 11 degrees of freedom; a sample of 10 carries 9. The larger sample speaks with more weight because it had more chances to pin down the spread, and the weights add up to the total degrees of freedom.

Pooled variance is not the same as lumping the raw numbers together. Merging all 22 values and computing one variance around the grand mean would pull the gap between the group means into the spread. Pooling uses each sample's own mean for its own data, so the estimate covers the spread within the groups and nothing else, which is what the t test needs.

The formula and how the weighting works

The pooled variance sp^2 weights each sample variance by its degrees of freedom and divides by the total:

sp^2 = ((n1 - 1) x s1^2 + (n2 - 1) x s2^2) / (n1 + n2 - 2)

SymbolMeaningIn the example below
n1, n2Sample sizes12 and 10
s1, s2Sample standard deviations5 and 7
s1^2, s2^2Sample variances25 and 49
n1 - 1, n2 - 1Degrees of freedom per sample11 and 9
n1 + n2 - 2Total degrees of freedom20

Two properties are worth checking whenever you compute one. First, the weights (n1 - 1) and (n2 - 1) are positive and add up to the denominator, so the pooled variance is a proper weighted average. That means the answer always falls between s1^2 and s2^2, never outside them. In the example, 35.8 sits between 25 and 49, which is a one-line sanity check that catches typos fast.

Second, the pattern extends to any number of groups: add every (ni - 1) x si^2 and divide by the sum of all (ni - 1), which is N minus the number of groups. In an analysis of variance that quantity is the mean square within groups, so pooled variance is the same object ANOVA reports under another name. The NIST/SEMATECH e-Handbook shows the pooled standard deviation used this way on measurement data.

Why the plain average is not the answer

The most common shortcut is to average the two variances: (s1^2 + s2^2) / 2. When the sample sizes are close, that is nearly right. When they are far apart, it can be badly wrong, because a plain average gives the small sample half the vote no matter how little data it holds.

Take a sample of 40 with s1 = 5 and a sample of 5 with s2 = 12. The variances are 25 and 144. The plain average is (25 + 144) / 2 = 84.5. The pooled formula weights the big sample by 39 degrees of freedom and the small one by 4: (39 x 25 + 4 x 144) / 43 = 1,551 / 43 = 36.1. Same two inputs, and the answers differ by more than double.

QuantityPlain averageDegrees-of-freedom weighted
Weight on each variance1/2 and 1/239/43 and 4/43
Calculation(25 + 144) / 2 = 84.5(39 x 25 + 4 x 144) / 43 = 1,551 / 43 = 36.1
Which sample dominatesneitherthe 40-point sample

The weighted value of 36.1 sits close to 25 because 39 of the 43 degrees of freedom come from the large sample, and that is the honest reading of the evidence. Four observations do not know as much about a population as forty do. The plain average lets five loose points drag the combined estimate toward 144 as if they carried equal authority.

There is one case where the shortcut is exact: when the sample sizes are equal, (n - 1) x s1^2 + (n - 1) x s2^2 over 2(n - 1) cancels down to (s1^2 + s2^2) / 2. That is why textbooks sometimes say the pooled variance is the average of the variances and why the claim is only true under that condition.

A worked example: 12 and 10 samples, step by step

Here is the example the calculator opens with. Group 1 has n1 = 12 and s1 = 5; group 2 has n2 = 10 and s2 = 7. The variances are 25 and 49.

StepCalculationResult
Variance of group 15^225
Variance of group 27^249
Weighted term, group 111 x 25275
Weighted term, group 29 x 49441
Numerator275 + 441716
Degrees of freedom12 + 10 - 220
Pooled variance716 / 2035.8
Pooled standard deviationsqrt(35.8)5.98

Every line is checkable by hand, and the last line is where most errors happen: the pooled variance is 35.8, but the number that goes into the standard error is its square root, 5.98. Dividing 20 into 716 gives 35.8, and taking the square root gives 5.9833, which rounds to 5.98.

Now give the groups means of 50 and 46 so the output connects to a test. The gap between means is 4. The standard error of that gap is sp x sqrt(1/12 + 1/10), which comes to 2.56. The t statistic is 4 / 2.56 = 1.56 on 20 degrees of freedom, short of the 2.086 needed for a two-sided test at the 0.05 level, so the gap is not statistically significant in this sample. Cohen's d, the gap measured in pooled standard deviations, is 4 / 5.98 = 0.67, a medium size effect by the usual conventions of 0.2 small, 0.5 medium and 0.8 large.

A medium effect that fails a significance test is not a contradiction: 22 observations spread over two groups leave the estimate loose. Enter the same numbers into the calculator and it returns all of these values at once.

Equal sample sizes: the shortcut and when it holds

When n1 = n2 = n, the pooled formula collapses to (s1^2 + s2^2) / 2, the plain average of the two variances. Every other case needs the weighting, and the size of the gap between the two answers grows with the imbalance in sample sizes.

Sample sizesPooled variancePlain averageGap
12 and 1035.8371.2
40 and 536.184.548.43
n and n(s1^2 + s2^2) / 2the same value0

For the 12 and 10 example the two methods differ by 1.2, about three percent, because the degrees of freedom split 11 to 9. For 40 and 5 they differ by 48.43, and the plain average is not a rounding of the pooled value but a different number altogether. A practical habit: whenever the sample sizes differ by more than about two to one, drop the shortcut and weight properly.

The gap grows fastest when the small sample is the noisy one. A small, scattered sample pulls a plain average upward, the standard error inherits the inflation, and a real difference between means can hide behind spread that only four observations vouched for.

When pooling is the right assumption

The pooled estimate answers a specific question: what is the variance, assuming both populations have the same one? That assumption does the work, and it is worth a moment before you compute. If the two populations genuinely share a spread, pooling buys you a better estimate than either sample offers alone, with 20 degrees of freedom instead of 11 or 9 in the running example. If they do not, the pooled number describes a mixture that matches neither population.

A quick screen is the ratio of the two sample variances. In the example, 49 / 25 = 1.96, a ratio of about 2, which is unremarkable for samples this size. Ratios in that range usually leave the conclusion unchanged either way. When the larger variance is several times the smaller and the sample sizes are unequal, switch to the Welch version of the t test, which uses each sample's own variance and a corrected degrees-of-freedom formula. Many statistics packages report both by default for exactly this reason.

Sample size balance softens the stakes. With n1 = n2 the t statistic happens to be tolerant of moderate variance differences, because the two variance estimates enter the standard error with equal weight. The combination that hurts is unequal variances plus unequal sample sizes, especially when the smaller sample is the noisier one. That is the setting where the pooled and Welch tests can disagree enough to change the verdict.

From pooled variance to the t test and Cohen's d

Three quantities hang directly off the pooled standard deviation, and the calculator reports all of them when you enter the two means.

QuantityFormulaExample value
Standard error of the differencesp x sqrt(1/n1 + 1/n2)2.56
t statistic(mean1 - mean2) / SE1.56
Cohen's d(mean1 - mean2) / sp0.67
95% margin of error2.086 x SE5.34

The margin of error row uses the t critical value for 20 degrees of freedom at the 95% level, 2.086. The confidence interval for the mean difference is 4 plus or minus 5.34, which stretches from -1.34 to 9.34 and covers zero, the interval version of the same verdict the t statistic gave. The George Mason statistics notes lay out this chain from pooled variance to t in the same order.

Cohen's d divides by the pooled standard deviation, a pure measure of the effect in spread units, so it does not depend on sample size. The t statistic divides by the standard error, which shrinks as the samples grow, so the same d of 0.67 would reach significance in a bigger study. Reporting both answers how big the difference is and how sure we are it is not zero.

Formal verification of the pooled standard deviation follows the same algebra. The NIST IR 8211 report defines sp as the square root of the degrees-of-freedom weighted sum of squared deviations, which is algebraically identical to the formula on this page, just written from the raw residuals rather than the two sample variances.

Units, mistakes and sanity checks

Variance lives in squared units. If the measurements are points on an exam, the pooled variance is in points squared and the pooled standard deviation is back in points. Most wrong-looking outputs come from reading one where the other was expected: 35.8 is a variance, 5.98 is the standard deviation, and only one of them belongs in a sentence about points.

Never average the standard deviations. The correct operation weights variances and then takes the square root. Averaging the standard deviations directly gives (5 + 7) / 2 = 6 in the balanced example, close enough to hide the error, but for the 40 and 5 case it gives 8.5 against a correct 6.01, a forty percent overstatement. The mistake is easy to make because the formula looks symmetric; it is not.

Use each sample's own mean. If you have raw data, compute each group's variance around its own group mean before pooling. Computing deviations from the grand mean injects the between-group gap into the spread, and the result stops being a pooled variance.

Degrees of freedom, not sample sizes, are the weights. Using n1 and n2 as weights instead of n1 - 1 and n2 - 1 shifts the answer toward the larger sample. The shift is small when samples are large and can matter when they are small.

CheckExpected behavior
Pooled variance vs the two inputsAlways between 25 and 49 in the example
Both standard deviations equalPooled variance equals the shared variance exactly
Sample sizes equalPooled variance equals the plain average of the variances
One sample grows without boundPooled variance converges to that sample's variance

The last check is the quickest to run: hold the small sample fixed and let the large one grow, and watch the pooled estimate slide toward the large sample's variance.

Frequently asked questions

What is the pooled variance formula?

sp^2 = ((n1 - 1) x s1^2 + (n2 - 1) x s2^2) / (n1 + n2 - 2). It is a weighted average of the two sample variances, weighted by degrees of freedom.

What is the pooled variance for n1 = 12, s1 = 5, n2 = 10 and s2 = 7?

(11 x 25 + 9 x 49) / 20 = 716 / 20 = 35.8. The pooled standard deviation is sqrt(35.8) = 5.98.

Is pooled variance just the average of the two variances?

Only when the sample sizes are equal. With n1 = n2 the formula reduces to (s1^2 + s2^2) / 2. Otherwise the larger sample carries more weight: for 40 and 5 observations the weighted answer is 36.1 while the plain average is 84.5.

Why does the formula use n minus 1?

Each sample variance carries n - 1 degrees of freedom, and those degrees of freedom are the evidence behind each estimate. Weighting by them makes the total degrees of freedom n1 + n2 - 2, which is also the degrees of freedom of the pooled t test.

What is the pooled standard deviation in the example?

sqrt(35.8) = 5.98. It returns the estimate to the original units after the squaring, and it is the number used in the standard error and in Cohen's d.

When is pooling the right choice?

When you can treat the two population variances as equal. A ratio of the two sample variances near 1 supports that; in the example 49 / 25 = 1.96, which is unremarkable at these sample sizes.

What if the two variances disagree sharply?

Then the equal-variance assumption is doubtful and the Welch t test, which keeps the variances separate, is the safer tool. The risk is highest when sample sizes are unequal and the smaller sample is the noisier one.

How does pooled variance feed the t test?

The standard error of the difference is sp x sqrt(1/n1 + 1/n2), which is 2.56 in the example. The t statistic is the mean difference divided by that, 4 / 2.56 = 1.56, on 20 degrees of freedom.

Can the pooled variance fall outside the two sample variances?

No. The weights are positive and sum to 1, so the result is always between s1^2 and s2^2. In the example 35.8 lies between 25 and 49.

What are the units of pooled variance?

The square of whatever the measurements are in: points squared, dollars squared, milligrams squared. Take the square root to get back to the original units.

How do I compute Cohen's d from pooled variance?

Divide the mean difference by the pooled standard deviation: d = (mean1 - mean2) / sp. In the example, 4 / 5.98 = 0.67, a medium effect under the 0.2, 0.5 and 0.8 conventions.

Can I pool more than two samples?

Yes. Sum (ni - 1) x si^2 over all groups and divide by the total degrees of freedom, N minus the number of groups. In an ANOVA with k groups this same quantity is the mean square within groups.

What changes if I weight by n instead of n minus 1?

The estimate shifts toward the larger sample and the result is no longer the textbook pooled variance. The bias is small for large samples and noticeable when one sample has fewer than about 10 observations.

I have raw data instead of standard deviations. How do I pool?

Compute each group's variance around its own group mean, then apply the same formula. Equivalently, sum the squared deviations from each group mean and divide the total by n1 + n2 - 2.

Spotted a wrong number or a broken result?

More Math tools

See all Math tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.