Covariance Calculator
Calculate sample and population covariance between two variables.
What the Covariance Calculator does
Covariance measures whether two variables vary together. Its sign is meaningful — positive means they rise together — but its size depends entirely on the units involved, which is why correlation is usually reported instead.
Formula
Sample: cov = Σ((x − x̄)(y − ȳ)) ÷ (n − 1)Population: cov = Σ((x − x̄)(y − ȳ)) ÷ nCorrelation r = cov ÷ (σx × σy)
Inputs explained
| Input | Unit | Required | Notes |
|---|---|---|---|
| X values | text | Yes | Separate values with commas, spaces or new lines. |
| Y values | text | Yes | Separate values with commas, spaces or new lines. |
| Data set type | one of 2 options | Yes | — |
How to use it
- Choose Data set type.
- Enter X values and Y values.
- Select Calculate.
Worked example
X values 2, 4, 6, 8 against Y values 3, 7, 8, 12.
- X
- 2, 4, 6, 8
- Y
- 3, 7, 8, 12
- Type
- Sample
Sample covariance ≈ 9.33, correlation ≈ 0.968.
Frequently asked questions
Why is covariance hard to interpret?
Because it carries the units of both variables multiplied together. A covariance of 500 could be strong or trivial depending on the scales involved.