Covariance to Correlation Calculator

Covariance tells you the direction in which two variables move together, but its size depends on the units of each variable, so it is hard to interpret on its own. Dividing covariance by the product of the two standard deviations rescales it into the Pearson correlation coefficient, a unitless number between -1 and 1. This calculator takes a covariance and the variances of the two variables, returns each standard deviation, and converts the covariance into a correlation. This is exactly the operation that turns a covariance matrix into a correlation matrix in statistics and portfolio analysis.

0.00
0.00
0.00
0.00

Covariance to correlation formula

sd(X) = sqrt(var(X))
sd(Y) = sqrt(var(Y))
r = cov(X, Y) / (sd(X) * sd(Y))
R-squared = r * r

The correlation coefficient r is dimensionless and lies in the range -1 to 1. R-squared is the share of variance in one variable that a linear fit on the other explains.

Interpreting the result

  • r = 1 is a perfect positive linear relationship; r = -1 is a perfect negative one.
  • r = 0 indicates no linear association (but possibly a non-linear one).
  • Variance must be positive; a zero variance means a constant variable and undefined correlation.
  • Correlation is symmetric: the correlation of X with Y equals that of Y with X.
  • R-squared ranges from 0 to 1 and is the squared correlation.

Covariance and correlation: frequently asked questions

How do you convert covariance to correlation?

Divide the covariance by the product of the two standard deviations: r = cov(X,Y) / (sd(X) * sd(Y)). Since standard deviation is the square root of variance, r = cov / sqrt(var(X) * var(Y)). This normalises covariance to a unitless value between -1 and 1.

Why is correlation bounded between -1 and 1?

Correlation is covariance scaled by the standard deviations of both variables, which removes their units and magnitude. By the Cauchy-Schwarz inequality, the absolute covariance can never exceed the product of the standard deviations, so the ratio always lies in the range -1 to 1 inclusive.

What does the correlation value mean?

A value near 1 means the two variables move up and down together almost perfectly; near -1 means they move in opposite directions; near 0 means little or no linear relationship. Correlation measures only the strength of a linear association, not causation or non-linear patterns.

What inputs does this calculator need?

Enter the covariance between X and Y and the two variances, var(X) and var(Y). The calculator returns the standard deviations and the Pearson correlation coefficient. Both variances must be positive for the correlation to be defined.

Can correlation be computed if a variance is zero?

No. If either variance is zero, that variable is constant and has no variability to correlate with. The denominator becomes zero and the correlation is undefined; the calculator returns n/a in that case.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.