Beginner

Covariance Calculator

Measure how two paired variables move together by computing their sample or population covariance.
Comma or space separated
Must match the count of X values

Type

Divisor used for covariance
Covariance
1.5000

Sample covariance (divided by n − 1)

Mean of X
3
Mean of Y
4
Pairs (n)
5
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

Covariance measures how two paired variables vary together. Find each mean, sum the products of their deviations Σ(xᵢ − x̄)(yᵢ − ȳ), then divide by n − 1 for a sample or n for a population. Positive values move together, negative values move oppositely, and zero means no linear joint variability.

Formula
cov(x, y) = Σ(xᵢ − x̄)(yᵢ − ȳ) / d, d = n − 1 (sample) or n (population)
How this is calculated

Enter two equal-length lists of numbers — the X values and the Y values — separated by commas or spaces. Each xᵢ is paired with the yᵢ at the same position, so the order matters and both lists must contain the same number of entries n.

The calculator first computes the means x̄ = Σx/n and ȳ = Σy/n. It then sums the products of the paired deviations, Σ(xᵢ − x̄)(yᵢ − ȳ), and divides by the chosen divisor d. For sample covariance d = n − 1 (Bessel’s correction, which gives an unbiased estimate from a sample), and for population covariance d = n (when the data represent the entire population).

A positive covariance means the variables tend to rise and fall together; a negative value means one tends to rise as the other falls; a value near zero indicates little linear joint variability. Covariance is reported in the product of the units of X and Y, so its magnitude depends on scale — use correlation for a unitless measure. Sample covariance requires at least two pairs (n ≥ 2) so that the divisor is positive.

Frequently asked questions

Sample covariance divides by n − 1 to give an unbiased estimate when your data is a sample, while population covariance divides by n when the data covers the whole population.

Yes. Covariance is computed from paired observations, so both lists must have the same length and each xᵢ is matched with the yᵢ in the same position.

A covariance near zero means there is little linear co-movement between the variables, though a nonlinear relationship could still exist.

Also known as

covariance
sample covariance
population covariance
cov calculator
joint variability
covariance formula
covariance between variables

APA

TG we-Calculate Editorial Team. (2026). Covariance Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/covariance-calculator

Chicago

TG we-Calculate Editorial Team. "Covariance Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/covariance-calculator.

IEEE

TG we-Calculate Editorial Team, "Covariance Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/covariance-calculator

BibTeX

@misc{wecalculate_covariance_calculator, title = {Covariance Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/covariance-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?