Correlation coefficient from covariance:
formula and worked example
Covariance has awkward units; dividing by both spreads gives a clean number between -1 and 1.
Calcylator Editorial Team
Updated · 4 min read
Why covariance is rescaled into a correlation
Covariance tells you whether two variables tend to rise and fall together, but its size is hard to interpret. It carries the units of both variables multiplied together, such as rupees times kilograms, and it grows if you simply measure in a different unit. A covariance of 15 might be strong in one data set and trivial in another.
The correlation coefficient fixes this by dividing out the spread of each variable. The result is unit-free and capped at -1 and 1, which lets you compare the strength of association between completely different pairs of variables.
It is used in finance to compare how assets move together, in science to relate measurements, and in marketing to link spending with sales. In all cases it reports linear association, not cause.
The formula and its inputs
Divide the covariance by the product of the two standard deviations.
- covariance:
- Covariance
- std_x:
- Std x
- std_y:
- Std y
- Covariance: the covariance between x and y, 15 in the example.
- Std x: the standard deviation of x, 5 in the example.
- Std y: the standard deviation of y, 6 in the example.
The ordering of the calculation does not matter, since multiplication and division commute. All three must be computed under the same convention, either sample-based or population-based. Mixing them, for instance a sample covariance with population standard deviations, biases the answer by a factor that depends on the sample size.
Worked example: covariance 15, spreads 5 and 6
Two variables have a covariance of 15, and their standard deviations are 5 and 6.
Covariance
15
Std x
5
Std y
6
Correlation coefficient from covariance
0.5 r
A covariance of 15 divided by the product 5 × 6 = 30 gives exactly one half, a moderate positive relationship.
- Multiply the standard deviations: 5 × 6 = 30.
- Divide the covariance by that product: 15 ÷ 30 = 0.5.
The correlation is 0.5. Before accepting it, check that the answer lies between -1 and 1, and that 15 is smaller in size than 30, which is the largest covariance these spreads could produce.
What a correlation of 0.5 does and does not say
A value near 1 means the two variables move almost in lockstep along a straight line, a value near -1 means they move in opposite directions, and a value near 0 means no linear pattern. At 0.5, there is a moderate positive tendency: higher x values go with higher y values more often than not, but with plenty of scatter.
Squaring r gives the share of variation in one variable that a straight-line relationship with the other accounts for. Here 0.5² = 0.25, or a quarter. That is a sobering way to read a figure that sounds moderately strong.
Descriptive labels for ranges, such as weak, moderate or strong, are conventions that vary between fields. A correlation of 0.5 is considered useful in some social sciences and disappointing in a laboratory measurement comparison.
How the covariance moves the correlation
Holding both spreads fixed, the correlation is directly proportional to the covariance. A 10% rise in covariance gives a 10% rise in r, from 0.5 to 0.55.
| Scenario | Covariance | Calculated result |
|---|---|---|
| Original assumptions | 15 | 0.5 r |
| Covariance increased by 10% | 16.5 | 0.55 r |
This proportionality holds only inside the valid range. A covariance of 30 would give a perfect correlation of 1, and any figure above that is impossible with these standard deviations. Change either standard deviation and r moves in the opposite direction.
Errors that distort a correlation
- Using variances in place of standard deviations. Variances are the squares, so the denominator becomes far too large and r far too small.
- Mixing sample and population conventions between the covariance and the standard deviations.
- Reading a high correlation as proof of cause. Two things can move together because of a third factor, or by coincidence.
- Ignoring outliers and non-linear patterns. A curved relationship can have a correlation near zero even though the variables are tightly linked.
A check on a reported figure
A report states a covariance of 40 between two series with standard deviations of 4 and 5. Is the implied correlation believable?
- Multiply the standard deviations: 4 × 5 = 20.
- Divide: 40 ÷ 20 = 2.
- The result exceeds 1, which is impossible, so something in the report is wrong.
Likely culprits are a variance quoted as a standard deviation, a unit mismatch, or a covariance computed on different data from the spreads.
Common questions
How do you convert covariance to correlation?
Divide the covariance by the product of the standard deviation of x and the standard deviation of y. The result is the correlation coefficient, a unit-free value between -1 and 1 describing linear association.
Why is correlation easier to interpret than covariance?
Because it has no units and is capped between -1 and 1. Covariance depends on the scale of each variable, so a value of 15 means nothing until you know the spreads. Correlation strips that scale away.
Can a correlation be greater than 1?
No. If you compute a value above 1 or below -1, an input is wrong: perhaps a variance was used as a standard deviation, or the covariance and spreads come from different datasets or conventions.
What does a correlation of 0.5 mean?
A moderate positive linear association: higher x values tend to come with higher y values. About a quarter of the variation in one is linearly accounted for by the other, since 0.5 squared is 0.25.
Does the formula change for sample and population data?
The formula is the same, but all three inputs must follow the same convention. Using a sample covariance with population standard deviations, or the reverse, shifts the result by a factor that depends on n.
Was this guide helpful?
Continue reading
View all blogsCovariance from correlation: formula and worked example
Recover a covariance from a correlation and two standard deviations, with a 0.6, 4, 3 example, a sensitivity table and a check against the valid range.
4 min read
Percentile rank estimate: formula and worked example
Estimate a percentile rank as the share of a group scoring below a value, with a 37-of-50 example, a sensitivity table and how ties are handled.
4 min read
Relative risk: formula, example and practical interpretation
Relative risk compares the chance of an outcome in an exposed group with an unexposed group. See the formula, a 1.5x example and how to read it.
4 min read




