Skip to content
ENExplore Calculators

Covariance Calculator

Calculate sample or population covariance between two paired datasets.

About Covariance Calculator

Covariance measures how two variables change together. Positive covariance indicates they tend to increase together; negative means one tends to decrease when the other increases. Unlike correlation, covariance is not bounded to [−1, 1].

Formula

Cov(X,Y) = Σ(xᵢ−x̄)(yᵢ−ȳ) / (n−1)

xᵢ,yᵢ
Paired data points
x̄,ȳ
Means
n
Sample size

Worked example

With the default values below, Covariance Calculator returns Covariance of 6.666667. Change any input above and every figure here is recalculated in your browser.

Inputs used

X values (comma separated)
2, 4, 6, 8
Y values (comma separated)
1, 3, 5, 7
Typeone of Sample (n−1), Population (n)
Sample (n−1)

Results

Covariance
6.666667
Mean of X
5.0000
Mean of Y
4.0000

Step by step

  1. 1Values used
  2. 2Formula applied
  3. 3Covariance= 6.666667
  4. 4Mean of X= 5.0000
  5. 5Mean of Y= 4.0000

Assumptions and limits

  • The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How does covariance relate to correlation?

Correlation is the standardized form of covariance: r = Cov(X,Y) / (σₓ × σᵧ). This removes the effect of scale.

Can covariance be greater than 1?

Yes, covariance is unbounded. Its magnitude depends on the scales of X and Y. That's why correlation (bounded −1 to 1) is often preferred.

Covariance Calculator (Math) | Calcrivo