Covariance Calculator screenshot

Covariance Calculator

Sample and population covariance of two comma-separated lists, with the cross-product sum shown.

Privacy First
0 Runs
Updated 2026-11-06
No upload
Runs in this tab
No signup

What this page computes

Type the x values and the y values as two comma-separated lists of equal length. The page forms Σ(x − x̄)(y − ŷ), divides it by n − 1 for the sample covariance and by n for the population covariance, and prints both divisors with the means. Figures print to six significant figures.

Covariance carries the units of both variables and its size depends on their scale, so it says nothing on its own about how strong a relationship is; the page does not print a correlation or a p-value. A single pair is refused because n − 1 would be zero, and mismatched list lengths are refused with both counts.

Nothing is uploaded. The same two lists return the same covariance on every reload.

The page computes the covariance of two paired lists and prints both conventions: the sample covariance with the n − 1 divisor and the population covariance with n. Five pairs give 1.5 and 1.2 from the same sum Σ(x − x̄)(y − ȳ) = 6. It needs at least two pairs, because one pair leaves nothing to divide, and the two lists must be the same length.

Compute sample and population covariance from two comma-separated lists, with both divisors named.

How to use it

Type the x values as a comma-separated list and the y values the same way; each pair needs one of each, and unequal lengths are refused. Both covariances are printed on separate lines, each with the divisor it used, so the two numbers are never confused for one another.

n − 1 or n, and what the sign means

The sum of products Σ(x − x̄)(y − ȳ) is the same for both lines; only the divisor differs, which is why the two answers are close for a large n and visibly different for a small one. A positive covariance means the two lists tend to move in the same direction, a negative one means they move in opposite directions, and the magnitude is in the units of both variables, so it is not comparable across datasets the way a correlation is.

What to Expect

Best for

  • Getting both covariance conventions from one paste

What this tool keeps

  • Nothing leaves this tab: the arithmetic runs in the page you are reading, and a reload discards both the input and the result.

Sample output

sample covariance = 1.5 (divisor n − 1 = 4) population covariance = 1.2 (divisor n = 5) Σ(x − x̄)(y − ȳ) = 6 means: x̄ = 3, ȳ = 4, n = 5

Frequently asked questions

Which covariance is the right one?

Both are printed with the divisor they used: n − 1 is the sample convention and n is the population convention. Which applies depends on whether your pairs are a sample or the whole set, so the choice stays yours.

How do I enter the pairs?

Two comma-separated lists of the same length read position by position. Unequal lengths are refused with both counts printed.

Is anything uploaded?

No. Both sums are computed in this page from the two lists you typed, and nothing is posted or stored.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.