Covariance Calculator

Calculate population and sample covariance, Pearson correlation coefficient, and means for two datasets.

Share this calculator

Enter numbers separated by commas, spaces, or newlines. Both datasets must have the same number of values.

Covariance

1.5

With 5 data points, the datasets show strong a positive linear relationship (r = 0.7746).

Sample Covariance
1.5
Population Covariance
1.2
Correlation (r)
0.774597
Count
5
Mean X
3
Mean Y
4

Interpreting covariance

Positive covariance indicates X and Y tend to increase together. Negative covariance indicates they move in opposite directions. The correlation coefficient (Pearson r) normalizes covariance to a -1 to 1 scale for easier interpretation.

Also in Statistics

Descriptive Statistics

Covariance calculator: measure how two variables change together

A covariance calculator measures the direction of the linear relationship between two variables. Enter paired X and Y data to compute population covariance, sample covariance, the Pearson correlation coefficient, and summary statistics for both datasets.

Covariance and correlation

Covariance quantifies how two variables move together. Positive covariance means they tend to increase together; negative covariance means one tends to decrease as the other increases. However, the magnitude of covariance depends on the scale of the variables, making it hard to compare across datasets.

The Pearson correlation coefficient normalizes covariance to a range of -1 to 1, making it scale-independent. A value near 1 indicates strong positive linear association, near -1 indicates strong negative linear association, and near 0 indicates no linear association.

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

Sample covariance using Bessel's correction.

r = Cov(X,Y) / (sₓ × sᵧ)

Pearson correlation: covariance divided by the product of standard deviations.

Frequently asked questions

When should I use population vs. sample covariance?

Use population covariance when your data includes every member of the group. Use sample covariance (divides by n-1) when your data is a subset of a larger population, which is the more common case in practice.

Does covariance imply causation?

No. Covariance and correlation measure association, not causation. Two variables can covary because of a common cause, coincidence, or confounding variables without one causing the other.

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.