Statistics
Covariance Calculator
Paste paired x and y values to get the sample covariance (divide by n - 1) and population covariance (divide by n).
The work shows every (x - x̄)(y - ȳ) product so you can check a homework table line by line, and the correlation coefficient tells you the strength of the relationship on a -1 to 1 scale.
Same count as the Y list, in matching order.
Try an example
Result
Covariance
—
- Sample covariance
- —
- Population covariance
- —
- Correlation r
- —
- Σ(x - x̄)(y - ȳ)
- —
- Mean of x
- —
- Mean of y
- —
More details (1 more)
- Pairs (n)
- —
Student quick launch
Grade planning, algebra checks, and formulas students reach for most.
Study path
Use this calculator with
Follow these when you want the formula behind the answer, a short lesson, or nearby tools in the same topic.
What the covariance calculator solves
Paste paired x and y values to get the A smaller group taken from a population, used to estimate facts about the whole group. covariance (divide by n - 1) and Every member of the group you actually care about, not just the ones measured. covariance (divide by n). The work shows every (x - x̄)(y - ȳ) product so you can check a homework table line by line, and the correlation The number multiplying a variable, like the 3 in 3x. tells you the strength of the relationship on a -1 to 1 scale.
Formula
How to use it
- Enter the x values and y values as two lists of the same length, in matching order.
- Choose sample if the pairs are a sample from a larger population (the usual homework case), or population if they are the entire population.
- Read the covariance, then check the table of deviation products in 'Show the work'.
- Use the correlation coefficient to judge strength; covariance alone depends on the units.
How to read the answer
Covariance measures how two variables move together. A positive value means x and y rise together, negative means one rises as the other falls, and zero means no linear tendency. Its size depends on the units of x and y, so it is hard to compare across data sets; divide by both A number saying how far, on average, the data values sit from the mean. to get correlation, which is unit-free and always between -1 and 1.
Common mistakes and edge cases
- Mixing up the order of the y list so pairs no longer match; covariance is about pairs, not sorted lists.
- Dividing by n for a sample; use n - 1 unless the data is the whole population.
- Comparing covariances measured in different units, or reading a big covariance as a strong relationship without checking r.
- Expecting covariance to detect curved relationships; it only captures linear association.
Worked examples
Positive relationship (sample)
Covariance
11.5
Same data as a population
Covariance
9.2
Negative relationship
Covariance
-5
Zero covariance
Covariance
0
Decimal data
Covariance
0.95
Mismatched lengths
Covariance
Error
Frequently asked questions
What is the difference between covariance and correlation?+
Correlation is covariance divided by the product of the two standard deviations. That scaling removes the units and confines the value to -1 to 1, which makes correlation far easier to interpret. See the correlation coefficient calculator for r on its own.
Can covariance be negative?+
Yes. Negative covariance means that when one variable is above its mean the other tends to be below its mean, as with price and quantity demanded.
Why divide by n - 1 for sample covariance?+
Using the sample means in the deviations uses up one degree of freedom, and dividing by n - 1 corrects the resulting bias so the sample covariance estimates the population covariance without systematically undershooting.
What does a covariance of 0 mean?+
No linear relationship. The variables can still be related in a curved way, so zero covariance does not prove independence.
How is covariance used in finance?+
Portfolio variance depends on the covariances between asset returns; assets with low or negative covariance reduce overall volatility when combined. This page is an educational calculator, not investment advice.
About this calculator
- Written by
- mathcheck editorial team
- Last reviewed
- September 4, 2026
Method
- Uses the values entered by the user and stable formulas documented on the page.
Related calculators
Correlation Coefficient Calculator
Calculate Pearson correlation coefficient r from paired x and y data.
Linear Regression Calculator
Calculate least-squares regression line y = mx + b from paired x and y data.
R-Squared Calculator
Find R² (coefficient of determination) from paired data or from a correlation coefficient, plus adjusted R² for any number of predictors. Shows the fitted line, SSR, SSE, SST, and interpretation.
Variance Calculator
Calculate sample or population variance from a data list with mean and squared-deviation steps.
Standard Deviation Calculator
Calculate sample or population standard deviation, variance, mean, and z-score-ready summary statistics from a data list.
Average Calculator
Calculate arithmetic, weighted, geometric, or harmonic averages from a list of numbers with steps and summary statistics.
Last updated: September 4, 2026