Covariance Calculator
Enter paired X and Y values to get their covariance.
Your numbers
Your results
Covariance Calculator by TheCalcTools
How the Covariance Calculator works
Covariance measures whether two variables move together. Positive means they tend to rise together; negative means one tends to fall as the other rises.
Its size depends on the units of the data, so it is hard to judge on its own. Dividing by both standard deviations gives the correlation coefficient, which is always between −1 and 1.
The formula
Worked example
Using the default values shown in the calculator:
| X values | 2, 4, 6, 8 |
|---|---|
| Y values (same order) | 3, 7, 5, 9 |
- Means: X = 5.0, Y = 6.0.
- Products of deviations: (−3)(−3) + (−1)(1) + (1)(−1) + (3)(3) = 16.
- Sample covariance = 16 ÷ 3 = 5.3333; population = 16 ÷ 4 = 4.
Result:
| Sample covariance | 5.3333 |
|---|---|
| Population covariance | 4.0000 |
| Mean of X | 5.0000 |
| Mean of Y | 6.0000 |
| Correlation r | 0.8000 |
Frequently asked questions
Covariance or correlation?
Use correlation to compare strength across different data sets. Covariance is used inside other formulas, such as portfolio risk and regression slopes.
Sources and further reading
Related calculators
More in Statistics & Probability · All calculators
This calculator gives estimates for information only. Check important results independently before you rely on them. See our disclaimer.
