In-depth learning guide

Pearson Correlation and Covariance Guide

Pearson correlation standardizes linear association to −1 through 1, while covariance keeps the original measurement scale. Both start from the same paired cross-deviation sum.

3 min readStep-by-step methodReviewed 19 Oct 2026Published by LynaraOpen Pearson Correlation & Covariance Calculator →

Method

  1. Enter matched X and Y observations in the same order.
  2. Calculate each variable’s mean and paired deviations.
  3. Use the cross-deviation sum for sample or population covariance.
  4. Standardize the same cross-deviation sum by both variables’ spread to obtain Pearson r.

Worked example

X = 1, 2, 3 and Y = 2, 4, 6 gives r = 1, population covariance 4/3 and sample covariance 2.

Notes

Open Pearson Correlation & Covariance Calculator

Worked four-point example with transparent numerator and denominator

Consider four hypothetical paired observations: (1, 2), (2, 4), (3, 3) and (4, 5). The X mean is 2.5 and the Y mean is 3.5. Subtract each mean to obtain X deviations of −1.5, −0.5, 0.5 and 1.5, and Y deviations of −1.5, 0.5, −0.5 and 1.5. The sum of cross-products is 2.25 − 0.25 − 0.25 + 2.25 = 4; the sum of squared deviations is 5 for X and 5 for Y.

Pearson r is the cross-product sum divided by the square root of the product of those squared-deviation sums. Here that means 4 ÷ square root of (5 × 5) = 0.80. A scatterplot would show an upward linear tendency for these four observations, but four points provide little basis for generalizing to a population. The number is an arithmetic description of the sample and does not identify a causal mechanism.

To audit calculator input, first count the pairs rather than counting all eight individual numbers as eight observations. Do not sort X and Y separately, because pairing defines the underlying data. If every X or every Y value is identical, one sum of squared deviations is zero and Pearson r is undefined. An implementation should show this limitation rather than output a seemingly meaningful zero.

Pearson r measures linear association

Pearson correlation standardizes covariance so the result lies between -1 and 1. Positive values indicate that larger X values tend to accompany larger Y values, negative values indicate an inverse linear association, and values near zero indicate little linear association.

A correlation near zero does not rule out a strong curved relationship. Plot the paired data because a scatterplot can reveal nonlinearity, clusters or outliers that one coefficient cannot summarize.

Correlation does not establish causation

A large absolute correlation can arise from confounding variables, common trends, selection effects or other structures without one variable causing the other. Causal conclusions need a design and assumptions that go beyond the coefficient.

Outliers can strongly influence Pearson r. Recalculate or inspect sensitivity only as a diagnostic, and do not remove observations solely because they weaken the desired correlation.

Editorial review and limitations

Review status: reviewed under Lynara's editorial policy on 19 Oct 2026. Institution-specific grading rules, assignment instructions and publisher requirements can override a general example.
Verification: see the methodology and sources & verification pages. To report a reproducible error, use the contact page with the page URL, inputs and expected result.

Continue with the related tools

Use the linked tools for your own inputs and scenarios.

Browse all statistics calculators →

Keep learning

Related guides