Whether two variables move together — and why “by how much” has no answer.
Do they move together — and by how much is unanswerable
Change x’s units:
Sample covariance over 7 pairs
20.757143
Positive — above-average x tends to come with above-average y. The size of the number is not interpretable; only the sign is.
Covariance
20.757143
in x-units × y-units
Correlation r
0.997402
the same thing, standardised
SD of x
1.319993
SD of y
15.766148
The same data with x on four different unit scales:×1 covariance 20.75714 · ×10 covariance 207.57143 · ×1000 covariance 20,757.14286 · ×0.001 covariance 0.02076. The covariance moves by a factor of 1,000,000.00000 across them. The correlation does not move at all — it is 0.997402 on every one of them. Nothing about the relationship changed; only the units did. That is why a covariance’s magnitude cannot be compared with any other covariance, and why the correlation coefficient exists.
What the covariance is actually for. Divide it by the variance of x and you get the regression slope, 11.913091. Divide it by both standard deviations and you get the correlation, 0.997402. Both of those are interpretable; the covariance on its own is the unstandardised ingredient they are built from. Its one genuinely standalone use is portfolio variance, where the covariances between assets are summed in their own units and never compared with each other.
What this tool shows
A covariance’s size means nothing on its own. It is measured in x-units × y-units, so switching x from metres to millimetres multiplies it by a thousand while the relationship is untouched — and the correlation does not move at all. Only the sign is readable. The tool lets you watch that happen.
Sample covariance (÷ n − 1) and population (÷ n)
The correlation alongside, for comparison
A unit multiplier that rescales x
The regression slope the covariance produces
Scatter plot with the least-squares line
Where a raw covariance is genuinely used
Unit trap shown Sample or population Correlation alongside Centred computation
A covariance of 4,800 is not “stronger” than one of 0.3.
Updated 8 September 2026 · Works in any browser, no installation
Covariance measures whether two variables move together. Positive means above-average x tends to arrive with above-average y; negative means the opposite. The number’s magnitude depends entirely on the units, so it cannot be compared with any other covariance — which is what the correlation coefficient was invented to fix.
At a glance
Formula shown
Sample covariance = Σ(x − x̄)(y − ȳ) ÷ (n − 1); population divides by n instead. Its units are x-units × y-units. Dividing by both standard deviations gives the correlation; dividing by the variance of x gives the regression slope. The covariance of a variable with itself is its variance.
Scenario support
Portfolio risk, where covariances between assets are summed; the ingredient behind a correlation or a regression slope; checking the direction of a relationship; building a covariance matrix for multivariate analysis.
Educational estimate
Planning support from the values you enter — not professional advice.
The magnitude is a fact about your units
“Is a covariance of 4,800 strong?” has no answer, and it is worth understanding why the question is malformed rather than just hard.
A covariance is measured in x-units multiplied by y-units. Height in metres against weight in kilograms gives a covariance in metre-kilograms. Record the same heights in centimetres and the covariance multiplies by 100. Nothing about the relationship changed. The number did.
Use the unit multiplier in the tool to see it directly. The four settings differ by a factor of a million overall, and the covariance tracks them exactly — while the correlation stays fixed to every decimal place shown. One of those two quantities is describing the data and the other is describing your choice of ruler.
So the only thing readable from a covariance in isolation is its sign. Positive, negative, or approximately zero. That is genuinely useful — it is the direction of the relationship — and it is all there is.
Zero covariance does not mean independence. It means no linear association. Take x values symmetric about zero and set y = x²: y is completely determined by x, and the covariance is exactly zero, because the positive and negative contributions cancel. Perfect dependence, zero covariance. The reverse does hold: independent variables always have zero covariance.
Pearson’s correlation is the covariance divided by both standard deviations, which cancels the units and confines the result to −1 to +1. It is the covariance made comparable, and it is almost always the number you want to report.
Where a raw covariance is the right quantity
Given all of the above, it is fair to ask why the covariance is computed at all rather than going straight to a correlation. There are three real answers.
Portfolio variance. The variance of a weighted sum is the sum of every pairwise covariance, each weighted by both assets’ shares. This is Markowitz’s result and the foundation of diversification: adding an asset with low or negative covariance to the rest reduces total risk even when that asset is individually volatile. Here the covariances are in squared-return units, they are summed rather than compared, and the units are exactly right.
The regression slope. The least-squares slope is the covariance of x and y divided by the variance of x. That division leaves y-units per x-unit — which is what a slope is, and what makes it interpretable where the covariance is not. The regression calculator goes further into what the slope supports.
The covariance matrix. Principal component analysis, the multivariate normal distribution, Kalman filters and Mahalanobis distance all operate on a matrix of covariances rather than correlations, because the matrix has to carry the scale information the analysis needs. Standardising to correlations first is a different analysis, not a tidier version of the same one — PCA on a covariance matrix and PCA on a correlation matrix give different components.
One identity that makes the matrix easier to read: the covariance of a variable with itself is its variance. That is why a covariance matrix has the variances down its diagonal, and why “variance” and “covariance” are the same operation with different arguments.
Sample or population, and why it matters less than you think
The choice between dividing by n and n − 1 is the same choice the variance calculator faces, for the same reason.
Dividing by n − 1 is Bessel’s correction, and it exists because the deviations are measured from the sample mean rather than the true mean. The sample mean is, by construction, the point that minimises those squared deviations — so they come out systematically too small, and dividing by a smaller number compensates. Without it the covariance is biased toward zero.
Use n − 1 when your data is a sample from something larger you want to describe. Use n when your data is the whole population. In practice that is nearly always the first case.
The gap closes quickly. At n = 5 the two differ by 25%; at n = 30 by 3.4%; at n = 100 by 1%. It matters for small samples and is negligible for large ones.
And for the correlation it does not matter at all. Pearson’s r divides a covariance by two standard deviations, and if all three use the same divisor it cancels exactly. That is one of several reasons the correlation is the more robust thing to report — it cannot be wrong because someone picked the other convention.
Reading it without overreaching
Three cautions, beyond the units.
It is a linear measure, and it inherits every limitation of one. A U-shaped relationship, a threshold effect, or a relationship that reverses direction will all show a covariance near zero. Plot the data; the tool draws the scatter above the numbers for exactly this reason.
It is as outlier-sensitive as the mean it is built on. A single extreme pair can set the sign of the whole covariance, because each point contributes the product of two deviations and products grow quickly. If one point is far out on both variables, the covariance is largely reporting that point. The outlier calculator covers how to find out.
Direction is not causation. A positive covariance is consistent with x causing y, y causing x, a common cause, or coincidence. The correlation page sets out the specific mechanisms that produce association without a causal link, and all of them apply here unchanged.
The practical summary: compute the covariance when you need it as an ingredient, report the correlation when you need to communicate, and never compare two covariances’ magnitudes to each other.
Why the variance of a sum is not the sum of the variances
This is the identity that gives the covariance its one genuinely standalone job, and it is worth stating on its own because the intuition it corrects is very strong.
Var(X + Y) = Var(X) + Var(Y) + 2⋅Cov(X, Y). The third term is the whole story. Variances only add when the covariance is zero, and nothing guarantees that.
With a positive covariance the sum is more variable than its parts suggest. Two investments that rise and fall together produce a portfolio riskier than adding their individual risks. Two project tasks that are both delayed by the same missing supplier produce a schedule with a longer tail than either estimate implies.
With a negative covariance it is less variable, and that is diversification stated exactly. Adding an asset that tends to rise when the rest fall lowers total variance even when that asset is individually volatile — the reduction comes from the cross term, not from the asset’s own behaviour.
Subtraction does not help. Var(X − Y) = Var(X) + Var(Y) − 2⋅Cov(X, Y), so the variances still add while the covariance flips sign. A difference between two positively correlated measurements is less variable than either; a difference between two independent ones is more variable than both. This is why paired designs are more sensitive, and it is the same fact seen from the other side.
Independence is sufficient but not necessary. Variances add whenever the covariance is zero, and zero covariance is weaker than independence — which makes this one of the few places where the weaker condition is genuinely all you need.
Sources and methodology
References for the definition and its portfolio use.
Method. The covariance is computed from centred sums rather than the algebraically identical (nΣxy − ΣxΣy)/(n(n − 1)) form, which subtracts two large nearly-equal numbers and loses most of its significant digits on data far from the origin. The unit multiplier rescales the original values and recomputes, rather than scaling the covariance — the point is that the recomputation genuinely lands somewhere else. The suite asserts that scaling x by k multiplies the covariance by exactly k while leaving the correlation unchanged to twelve decimals, that the covariance of a variable with itself equals its variance, that y = x² on a symmetric x gives exactly zero covariance despite perfect dependence, and that the sample and population divisors differ by exactly n/(n − 1). That engine is verified on every change against 79 assertions. The count and the per-case breakdown are published on the formula verification page.
Related calculators
Where this goes next:
Correlation CoefficientReports Pearson, Spearman and Kendall together with the scatter plot, and ships Anscombe's quartet built in — four datasets with an identical r of 0.816 that Spearman tells apart.
VarianceSample and population variance from your data, with a live simulation that shows exactly how much the wrong divisor costs — 20% low at n = 5, closing as the sample grows.
Linear RegressionThe least-squares line with r and r² — and the regression of x on y beside it, because those are two different lines rather than one line rearranged.
Standard DeviationSample and population standard deviation, plus variance, mean, median, quartiles, z-scores, outliers, and confidence intervals.
OutlierRuns four outlier rules together and says when each is failing — the 3-sigma rule cannot flag anything below n=11, two outliers hide each other, and the quartile convention alone can decide the answer.
Mean, Median and ModeAll three centres marked on your own data, every mode rather than just the first, and the mean-median gap read as a direct measure of skew.
An educational tool. A covariance measures linear association only — a perfectly determined non-linear relationship can have a covariance of exactly zero — and its magnitude reflects the units of measurement rather than the strength of the relationship.
Published a covariance calculator with a unit multiplier, so the reason its magnitude is unreadable can be operated rather than read: rescaling x by a thousand multiplies the covariance by a thousand while the correlation does not move at all.
Reports the correlation and the regression slope alongside, because those are what a covariance is an ingredient of — and both divide the units back out.
Demonstrates that zero covariance is not independence: with x symmetric about zero and y equal to x squared, y is completely determined by x and the covariance is exactly zero.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.