Median Calculator Mean Calculator Mode Calculator First Quartile Calculator Relative Standard Deviation Calculator Anova Calculator Covariance Calculator Gamma Function Calculator Average Calculator Descriptive Statistics Calculator

Covariance Calculator

You can use this excellent and easy to operate Covariance Calculator to find the sample and population covariance for the given numbers and get the result in no time. Just provide input numbers in the x and y samples and click on the calculate button to find the covariance as output in fraction of seconds.

Covariance Calculator
Enter Sample Data 1
Enter Sample Data 2

Covariance Calculator: Want to become a professional in solving the sample and population covariance problems? Then stick to this page. Here we are giving the simple and manual lengthy procedure to solve your questions in a short span of time. Check it out from the following sections and get the result. You can also get the solved examples which are helpful to understand the concept easily.

How to Find Sample Covariance & Population Covariance?

Covariance is a statistics concept which measures how much two random variables are varied together. Below provided are the easy steps to find the covariance of given sample.

  • Take any two samples having numbers separated by comma.
  • Find the mean of x and y samples.
  • Also compute (xi - x̄), (yi - x̄) values.
  • Substitute the values in the sample covariance and population covariance formulas.
  • Do further math operations to get the answer.

Covariance Formulas

Covariance is a measure of the joint variability of two random variables. In simple words, covariance is defined as the expected value of the product of their deviations from their individual expected values.

Cov (X, Y) = E[(X – E[X])*(Y – E[Y])]

It can further be simplified as

Cov(X, Y) = E[X*Y] – E[X]*E[Y]


X, Y are random variables

E[X] is the expected value of X.

E[Y] is the expected value of Y.

Sample Covariance: It is computed from the collection of data on one or more random variables. Sample covariance is the estimator of the population covariance. Its formula is given below

Cov (x, y) = [∑i = 0i = N (xi - x̄) * (yi - ȳ)] / (N-1)

Where N is the number of data values.

xi is data value of x

yi is data value of y

x̄ is mean of x

ȳ is mean of y

Population Covariance: The formula to compute the population covariance is provided here:

Cov (x, y) = [∑i = 0i = N (xi - x̄) * (yi - ȳ)] / N


xi = data value of x

yi = data value of y

x̄ = mean of x

ȳ = mean of y

N = number of data values.


Question: Solve x = 2.1, 2.5, 4.0, and 3.6 (economic growth), y = 8, 12, 14, and 10 (S&P 500 returns) using the covariance formula. Determine whether economic growth and S&P 500 returns have a positive or inverse relationship. Before you compute the covariance, calculate the mean of x and y?


Given data samples are,

x = 2.1, 2.5, 4.0, and 3.6 (economic growth)

y = 8, 12, 14, and 10 (S&P 500 returns)

x̄ = ∑(xi) / n

= (2.1+2.5+4+3.6) / 4

= 12.2 / 4

x̄ = 3.1

ȳ = ∑(yi) / n

= (8+12+14+10) / 4

= 44 / 4

ȳ = 11

xi yi xi – x̄ yi – ȳ
2.1 8 -1 -3
2.5 12 -0.6 1
4.0 14 0.9 3
3.6 10 0.5 -1

Substitute these values in the covariance formula.

Sample covariance = Cov (x, y) = [∑i = 0i = N (xi - x̄) * (yi - ȳ)] / (N-1)

= [(−1)(−3)+(−0.6)1+(0.9)3+(0.5)(−1)] / (4-1)

= (3−0.6+2.7−0.5) / 3

= 4.6 / 3 = 1.533

Population Covariance = Cov (x, y) = [∑i = 0i = N (xi - x̄) * (yi - ȳ)] / N

= [(−1)(−3)+(−0.6)1+(0.9)3+(0.5)(−1)] / 4

= 4.6 / 4

= 1.15

Hence, Sample covariance = 1.533, Population Covariance = 1.15.

Clear your doubts on various math concepts by taking the help of our free tools available at

Covariance Calculator

Frequently Asked Questions on Covariance Calculator

1. What is difference between covariance and correlation?

Simply, both will measure the relationship and dependency between two variables. Covariance indicates the direction of the linear relationship between variables. Correlation measures strength and direction of the linear relationship between variables.

2. How do you find the covariance between two variables?

Read this entire page to get the step by step process to get both population and sample covariance between two variables.

3. How do you calculate Covariance from correlation coefficient?

Correlation coefficient formula is r = Cov (x, y) / (Sx Sy). So, it says that we must compute covariance to get the correlation value.

4. What are types of covariance?

The two types of covariances are positive covariance and negative covariance. Positive covariance means as one value increases other value is also increases automatically. Negative covariance means as one increases other decreases.