Boneyard Tools

Covariance Calculator

Paste two data sets as x,y pairs to find both the sample and population covariance. Covariance shows whether two variables tend to move in the same direction, the opposite direction, or independently.

How to calculate covariance

  1. Enter your paired data, one x,y pair per line.
  2. Read the sample covariance (divides by n minus 1).
  3. Compare it to the population covariance (divides by n).

Examples

A positive relationship

1,2
2,4
3,5
4,4
5,5
Sample = 1.5, population = 1.2, n = 5

Frequently asked questions

What is covariance?

Covariance measures how two variables change together. A positive value means they tend to rise and fall together; a negative value means one rises as the other falls.

What is the difference between sample and population covariance?

Both add up the same products of deviations. Sample covariance divides by n minus 1 (an unbiased estimate); population covariance divides by n.

Why is the sample covariance larger?

It divides the same sum by a smaller number (n minus 1 instead of n), so its magnitude is always slightly larger than the population covariance.

How is covariance different from correlation?

Correlation is covariance scaled by the two standard deviations, giving a unitless value between -1 and 1. Covariance keeps the original units and is unbounded.

Do both data sets need the same length?

Yes. Each x value pairs with one y value, so the lists must be equal in length, with at least two pairs.

Related tools