Calculate sample covariance, population covariance, Pearson r, centered-product rows, and paired summary statistics from separate X/Y series or pasted X,Y rows.
Last updated
Compare two paired datasets and see whether they move together, apart,
or barely at all. The calculator reports both sample and population
covariance, then adds Pearson r so you can separate raw scale from
strength of association.
Keep the rows aligned. Pair 1 in X must belong with pair 1 in Y, pair 2
with pair 2, and so on.
Sample datasets
5 paired rows ready to calculate.
Reading tip
Covariance keeps the combined units of X and Y, so its magnitude changes
when the measurement scales change. Use Pearson r when you want a
scale-free reading of linear association.
Sample covariance
1.5
With 5 data points, the datasets show strong positive linear relationship (r = 0.7746).
1.5
Sample covariance
1.2
Population covariance
0.774597
Pearson r
5
Paired values
Dataset summary
Means and spread
Measure
X
Y
Mean
3
4
Sample SD
1.581139
1.224745
Minimum
1
2
Maximum
5
5
Interpretation
Scale check
Covariance keeps the combined units of X and Y, so use Pearson r (0.774597) when you need a scale-free comparison across different datasets.
The centered cross-products sum to 6,
which becomes the sample covariance after dividing by n−1.
If you need a comparison across differently scaled datasets, focus
on Pearson r rather than the raw covariance value.
Covariance calculator: sample covariance, population covariance, and Pearson r
A covariance calculator helps you see whether two paired variables move together, move in opposite directions, or barely show a linear relationship at all. Enter matching X and Y values to compute sample covariance, population covariance, Pearson correlation, and the descriptive statistics that explain where the result came from.
What covariance measures
Covariance quantifies how two variables move together after each value is compared with its own mean. Positive covariance means above-average X values tend to line up with above-average Y values, while negative covariance means above-average values in one series tend to line up with below-average values in the other.
The sign is easy to interpret, but the magnitude is not universal because covariance keeps the combined units of X and Y. A covariance measured in hours × dollars cannot be compared directly with one measured in kilograms × centimetres without thinking about scale.
That is why many workflows pair covariance with Pearson correlation. Correlation keeps the direction information but rescales the result into the familiar range from -1 to 1.
Cov_sample(X,Y) = Σ(xᵢ − x̄)(yᵢ − ȳ) / (n − 1)
Sample covariance using Bessel's correction.
Cov_population(X,Y) = Σ(xᵢ − μₓ)(yᵢ − μᵧ) / n
Population covariance when the full population is observed rather than a sample.
r = Cov_sample(X,Y) / (sₓ × sᵧ)
Pearson correlation: covariance divided by the product of standard deviations.
Sample covariance vs. population covariance
Use sample covariance when your paired data is a subset of a larger process or population. Dividing by n−1 rather than n applies Bessel's correction, which is the standard choice when you are estimating covariance from sample data.
Use population covariance when the data set already includes the whole group you care about. Spreadsheet software mirrors this distinction with separate functions such as COVARIANCE.S and COVARIANCE.P.
Many users search for a sample covariance calculator when they really need both values side by side. Showing both is helpful because it makes the denominator choice explicit instead of hiding it behind one unlabeled statistic.
How to enter paired data without breaking row alignment
Covariance only makes sense for paired observations. If one row is a student's study hours and exam score, or a stock return and benchmark return for the same date, those two values must stay together. Sorting one column, deleting one value, or pasting unmatched X and Y lists changes the statistic even if each individual number is valid.
The calculator now supports two entry patterns because competitor tools and spreadsheet workflows split on this point. You can paste one X,Y pair per row, then import the rows into the separate X and Y series, or you can edit each series directly. The paired-row import is useful when your source is a table or CSV-style list; the separate boxes are useful when you already have two copied columns.
Worked example from paired data
Suppose X = 1, 2, 3, 4, 5 and Y = 2, 4, 5, 4, 5. The means are x̄ = 3 and ȳ = 4. After centering each pair around those means, the cross-products add to 6.
Dividing that centered-product sum by n−1 = 4 gives a sample covariance of 1.5. Dividing by n = 5 gives a population covariance of 1.2. Those two values are close, but not identical, which is exactly why the sample-vs.-population choice matters.
The same data also produces a positive Pearson r, so the sign story and the normalized-strength story agree: the two variables tend to move together in a positive linear direction.
What covariance does not tell you on its own
Covariance does not prove causation. Two variables can move together because one influences the other, because both respond to a third factor, or because the sample is too small or unusual to generalize safely.
Covariance also does not tell you the whole strength story unless the variables share a meaningful common scale. If you rescale one variable from metres to millimetres, the covariance changes even though the underlying linear pattern has not.
That is why this page shows Pearson correlation and descriptive statistics alongside covariance. If you need prediction rather than association, a regression workflow is usually the next step.
Checking the centered-products table
A good covariance calculator should show more than one final number. The centered-products table exposes the calculation row by row: each X value minus the X mean, each Y value minus the Y mean, and the product of those two deviations. Positive products pull covariance upward, while negative products pull it downward.
This step-by-step view is useful when a result looks surprising. One unusually large paired observation can dominate the centered-product sum, and a mismatched row can reverse the sign. Reviewing the contribution table makes those problems easier to spot before you copy the sample covariance, population covariance, or Pearson correlation into a report.
Frequently asked questions
When should I use population vs. sample covariance?
Use population covariance when your data includes every member of the group you care about. Use sample covariance when your paired values are only a sample from a wider population or process, which is the more common real-world case. The sample version divides by n−1, not n, to correct for the fact that the means are estimated from the same sample.
Does covariance imply causation?
No. Covariance and correlation measure association, not causation. Two variables can covary because of a common cause, coincidence, seasonality, or confounding variables without one directly causing the other.
Why can covariance be large even when the relationship is not especially strong?
Because covariance keeps the original units of the two variables multiplied together. If the variables are measured on large scales, the covariance can look numerically large even when the linear association is only moderate. That is why Pearson correlation is useful alongside covariance: it rescales the same linear pattern into a unit-free measure between −1 and 1.
What does a covariance of zero mean?
A covariance of zero means the centered values do not show a consistent linear tendency to move together or apart in the sample. It does not prove the variables are independent, because they could still have a non-linear relationship that covariance and Pearson correlation do not capture well.
Can I paste paired X,Y rows instead of separate columns?
Yes. Paste one pair per row, such as 1, 2 on the first row and 3, 4 on the next row, then import the paired rows. The calculator will split the rows into X and Y series while warning you if any row does not contain exactly two numeric values.
Why does the calculator show a centered-products table?
The centered-products table shows the mechanics behind covariance. It helps you verify that each pair is aligned, see which observations push the covariance positive or negative, and catch unusual rows before relying on the final statistic.
Is covariance the same as correlation?
No. Covariance keeps the original combined units and can be any positive or negative size. Correlation rescales the same linear movement into a unit-free value from −1 to 1, which is easier to compare across datasets.