Covariance Calculator
Covariance shows whether two variables move together: positive when they rise and fall in sync, negative when one rises as the other falls. Enter paired X and Y values to get sample and population covariance plus the correlation coefficient, which scales the relationship to a −1 to 1 range.
Results
Formula
How to use this calculator
- Enter the X values — commas or spaces between them.
- Enter the matching Y values in the same order.
- Press Calculate. Check the correlation to judge the strength, not just the direction.
Worked example
X: 2, 4, 6, 8 and Y: 1, 3, 4, 7.
- Means: x̄ = 5, ȳ = 3.75.
- Products of deviations: 8.25 + 0.75 + 0.25 + 9.75 = 19.
- Sample covariance: 19 ÷ 3 ≈ 6.333.
- Correlation: ≈ 0.981 — a very strong positive relationship.
Result: Sample covariance ≈ 6.333, correlation ≈ 0.981.
Frequently asked questions
What is the difference between covariance and correlation?
Covariance shows direction only, in squared mixed units, so its size is hard to interpret. Correlation divides by the standard deviations, giving a unit-free strength measure from −1 to 1.
Does a strong correlation mean one variable causes the other?
No. Correlation never proves causation — a third factor may drive both, or the pattern may be coincidence.
Why sample vs population covariance?
Sample covariance divides by n − 1 to correct bias when your pairs are a sample of a larger population; population covariance divides by n.
Related calculators
Linear Regression Calculator
Fit a least-squares regression line to paired data.
MathStandard Deviation Calculator
Calculate standard deviation (population and sample), variance and mean for any data set.
MathMean Calculator
Find the mean (average) of any list of numbers, plus the sum, count, minimum, maximum and range.
MathP-Value Calculator
Convert a z-score or t-statistic into a p-value for left, right or two-tailed tests.