Part of the Maths & Statistics suite · 235 calculators

Covariance Calculator

How two variables move together — the sample and population covariance, with the correlation coefficient that puts it on a readable scale.

Covariance is the average product of the two variables' deviations from their means: positive when they rise together, negative when one rises as the other falls.

Comma-separated
Same count as X
Results update as you type
Results
Sample covariance
1.5
Population covariance
Correlation coefficient (r)
Mean of X
Mean of Y
SD of X
SD of Y
Pairs
Reviewed September 2026. Pure mathematics: the result does not depend on where you are. Terminology follows the Australian Curriculum (maths, brackets, decimal point).
No account required · Google Analytics off unless allowedCalculator arithmetic runs in your browserResults update as you type
All calculations run 100% in your browser. The calculator code does not submit your figures to GlobalCalc to obtain a result.
About covariance

How the covariance calculator works

Covariance is the average product of the two variables' deviations from their means: positive when they rise together, negative when one rises as the other falls. Dividing by n − 1 gives the sample version.

On its own the number is hard to read, because it carries the units of both variables multiplied together. Dividing by both standard deviations gives the correlation coefficient, which is bounded to −1…+1 and is what you should usually quote.

Formula: cov = Σ(xᵢ − x̄)(yᵢ − ȳ) / (n − 1); r = cov / (sₓ s_y)

Worked examples

InputsSample covarianceNote
Five pairs1.5covariance 1.5, r = 0.775
Perfectly linear3.333333r = 1
Perfectly inverse-3.333333r = −1

Frequently asked questions

What does covariance tell me?

The direction two variables move together in. Positive means they rise together; negative means one falls as the other rises.

Why is the number so hard to interpret?

Because it carries both variables' units multiplied. Covariance of height and weight is in centimetre-kilograms, which means nothing on its own.

Should I use correlation instead?

Usually yes. It is covariance scaled to −1…+1, so it is comparable across any pair of variables.

What does zero covariance mean?

No *linear* relationship. Variables can be perfectly related in a curved way and still have zero covariance.

Why divide by n − 1?

Bessel's correction — the same reason as for the sample variance. Using the sample means makes the deviations slightly too small.

Where these figures come from

Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.