Covariance Calculator
Calculate the sample and population covariance between two variables from paired datasets with a clear step-by-step solution.
Separate values with commas or spaces.
Must have the same number of values as X.
How to Use the Covariance Calculator
Enter your X values and Y values in the corresponding input fields (comma or space separated), then click Calculate. Both datasets must have the same number of values. The calculator returns both the sample and population covariance along with the means and a step-by-step solution.
What is Covariance?
Covariance is a measure of the joint variability of two random variables. It indicates the direction of the linear relationship between two variables:
- Positive covariance — when X increases, Y tends to increase.
- Negative covariance — when X increases, Y tends to decrease.
- Zero covariance — no linear relationship between X and Y.
Unlike correlation, covariance is not standardized and its magnitude depends on the units of the variables.
Covariance Formula
Sample covariance:
Population covariance:
Covariance vs Correlation
Covariance and correlation both measure the relationship between two variables, but correlation is the standardized version. Correlation is bounded between −1 and +1, making it easier to interpret. Covariance has no fixed range — its value depends on the units of the data.
Frequently Asked Questions
What does a positive covariance mean?
A positive covariance means that when X is above its mean, Y also tends to be above its mean, indicating they move in the same direction.
What does a negative covariance mean?
A negative covariance means that when X is above its mean, Y tends to be below its mean — they move in opposite directions.
What is the difference between sample and population covariance?
Sample covariance divides by n−1 (Bessel's correction) to give an unbiased estimate when using sample data. Population covariance divides by N and is used when you have data for the entire population.