Covariance Calculator
With the correlation that makes it interpretable.
Work out Covariance. With the correlation that makes it interpretable. Names the misconception directly.
Sample covariance
16
Positive — they tend to rise together · correlation 0.9897
Covariance measures whether two variables move together, but its size depends entirely on the units. Measure heights in centimetres instead of metres and the covariance grows a hundredfold while the relationship is unchanged — which is why the number on its own is almost impossible to interpret. Correlation is covariance divided by the two standard deviations, which strips the units out and lands the result between −1 and 1. That is why correlation is nearly always the figure quoted, and it is shown here alongside for exactly that reason. The n−1 version estimates the covariance of the population the sample came from; the n version describes the sample itself. Unless you hold the entire population, the first is the one you want.
How the Covariance Calculator works
Sample and population covariance from paired data, with the correlation alongside. Covariance depends entirely on the units — switch centimetres to metres and it changes hundredfold — which is why the correlation is the figure usually quoted.
Also known as: covariance from two lists · covariance vs correlation · sample covariance calculator · do these move together
Frequently asked questions
What is covariance?
A measure of whether two variables move together. Positive means they tend to rise together, negative means one rises as the other falls, and zero means no linear relationship.
Why is covariance hard to interpret?
Because its size depends on the units of both variables. Measure heights in centimetres instead of metres and the covariance grows a hundredfold while the underlying relationship is unchanged.
What is the difference between covariance and correlation?
Correlation is covariance divided by the two standard deviations. That strips the units out and confines the result to between −1 and 1, which is why correlation is nearly always what gets reported.
When do I use n versus n−1?
Use n−1 unless you hold the entire population. The n−1 version estimates the covariance of the population the sample came from; dividing by n describes only the sample in hand and is biased.
Where is covariance used directly?
Portfolio theory, where the covariance matrix of asset returns drives diversification, and principal component analysis, which works by finding the eigenvectors of exactly that matrix.
Put this calculator on your own site
Free to use, on any site, commercial or not. Paste this where you want it to appear. It is a plain iframe, so it works in WordPress, Squarespace, Wix, Webflow, Ghost and anything else that accepts HTML.
<iframe src="https://www.thecalclibrary.com/embed/covariance-calculator" width="100%" height="640" style="border:1px solid #e2e8f0;border-radius:12px" loading="lazy" title="Covariance Calculator"></iframe>
<p style="font:13px/1.5 system-ui,sans-serif;margin:6px 0 0;color:#64748b">Powered by <a href="https://www.thecalclibrary.com/covariance-calculator" style="color:#64748b">Covariance Calculator</a> from The Calc Library</p>The only condition is that the credit line below the frame stays in place. That one line is what pays for the tool being free — it is how anyone else finds it.