Home · Statistics · Correlation & Regression · Covariance Calculator

Covariance Calculator

The sample covariance between paired x and y values: how the two variables move together, in the product of their units, using the n − 1 (sample) denominator.

Your figures

Example result — edit the figures to make it yours

7.1667

Population covariance (divide by n)6.142857
Correlation r0.946485
Pairs (n)7

What this calculator does

The sample covariance between paired x and y values: how the two variables move together, in the product of their units, using the n − 1 (sample) denominator. Every figure on this page is computed from the standard definition stated below — the same definition used in textbooks and reference tables — with no hidden rounding steps, and the method notes name the exact convention where more than one exists.

The formula and method

cov(x, y) = Σ(x−x̄)(y−ȳ) / (n − 1)

This is the sample covariance, dividing by n − 1 so it is unbiased for the population covariance.

The sign shows the direction of co-movement: positive when above-average x tends to pair with above-average y.

Unlike correlation, covariance keeps its units (x-units × y-units), so its size cannot be compared across datasets — divide by both standard deviations to get r.

Worked example

With the example inputs this page opens with, the result is 7.1667. Change any figure and the result updates with the same formula.

Quick reference

Quick reference — the worked example in full
FigureValue
Result7.1667
Population covariance (divide by n)6.142857
Correlation r0.946485
Pairs (n)7

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

Why divide by n − 1 and not n?

The deviations are measured from the sample means, which are themselves estimated from the same data and sit closer to the points than the true means would. Dividing by n − 1 corrects the resulting underestimate — Bessel's correction.

A covariance of 7.17 — is that large?

There is no absolute scale: it depends on the units and spreads of both variables. Standardise it into the correlation coefficient (here r ≈ 0.95) before judging strength.

How does the Covariance Calculator work?

The sample covariance between paired x and y values: how the two variables move together, in the product of their units, using the n − 1 (sample) denominator. X values · y values → Sample covariance. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the Covariance Calculator need?

X values · y values → Sample covariance. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.