Covariance Calculator
Paste two data sets as x,y pairs to find both the sample and population covariance. Covariance shows whether two variables tend to move in the same direction, the opposite direction, or independently.
How to calculate covariance
- Enter your paired data, one x,y pair per line.
- Read the sample covariance (divides by n minus 1).
- Compare it to the population covariance (divides by n).
Examples
A positive relationship
1,2 2,4 3,5 4,4 5,5
Sample = 1.5, population = 1.2, n = 5
Frequently asked questions
What is covariance?
Covariance measures how two variables change together. A positive value means they tend to rise and fall together; a negative value means one rises as the other falls.
What is the difference between sample and population covariance?
Both add up the same products of deviations. Sample covariance divides by n minus 1 (an unbiased estimate); population covariance divides by n.
Why is the sample covariance larger?
It divides the same sum by a smaller number (n minus 1 instead of n), so its magnitude is always slightly larger than the population covariance.
How is covariance different from correlation?
Correlation is covariance scaled by the two standard deviations, giving a unitless value between -1 and 1. Covariance keeps the original units and is unbounded.
Do both data sets need the same length?
Yes. Each x value pairs with one y value, so the lists must be equal in length, with at least two pairs.
Related tools
Correlation Coefficient Calculator
Calculate the Pearson correlation coefficient r and r squared from two data sets. Paste paired x,y values to measure linear association. Free and private.
Linear Regression Calculator
Fit a least squares line to your x and y data. Get the slope, intercept, equation, r-squared, and correlation, plus a scatter plot, in your browser.
Standard Deviation Calculator
Calculate standard deviation and variance online. Paste a list of numbers to get the mean, count, and both sample and population results instantly.
Descriptive Statistics Calculator
Get a full descriptive statistics summary from a list of numbers: mean, median, mode, variance, standard deviation, quartiles and the interquartile range.
Annulus Area Calculator
Calculate the area of an annulus, the ring between two concentric circles, from its outer and inner radius. Returns both circumferences and width too. Free.
Area Calculator
Find the area of a circle, square, rectangle, triangle, trapezoid, parallelogram, ellipse, sector or rhombus. Free and runs in your browser.