Mihsaba›Statistics & Probability›Correlation Coefficient Calculator – Pearson r & r²

Correlation Coefficient Calculator – Pearson r & r²

Calculate Pearson’s r, r² and the simple regression line from paired data, with a reminder that correlation does not prove causation.

Share this free calculator

Send this tool to someone who needs the calculation.

How to use

Pearson’s r measures the direction and strength of a linear relationship between paired numeric series. The tool returns r, r², a simple regression line and basic statistics, but does not interpret correlation as causation. For X=[1,2,3] and Y=[1,3,2], both means are 2, the cross-deviation sum is 1 and each squared-deviation sum is 2. Thus r=0.5 and r²=0.25. In simple linear regression with an intercept, r² here corresponds to 25% of the observed Y variation explained by the fitted model; it is not a 25% prediction accuracy or a causal claim.

  1. Enter X values separated by spaces or commas.
  2. Enter Y values with the same count and pairing order.
  3. Calculate.
  4. Review r, r², regression line and pair count.

How it is calculated

r=Σ[(x−x̄)(y−ȳ)]÷√[Σ(x−x̄)²Σ(y−ȳ)²]

Example

For X=[1,2,3,4] and Y=[2,4,6,8], r=1, a perfect positive linear relationship, and the regression line is y=2x.

Important notes

Pearson measures linear association and is sensitive to outliers. r near zero does not rule out a nonlinear relationship, and correlation does not prove causation.

Worked examples and interpreting results

If the first list is 1, 2, 3 and the second is 2, 4, 6, their relationship is perfectly positive and linear. Replacing the second list with 6, 4, 2 makes it perfectly negative and linear.

Worked examples and interpreting results
CaseCalculationResult
Both lists increase togetherX = [1,2,3]; Y = [2,4,6] → r1
One decreases while the other increasesX = [1,2,3]; Y = [6,4,2] → r-1
Pearson r: X=[1,2,3], Y=[1,3,2]1 ÷ √(2 × 2)0.5
Squared correlation for the same data0.5²0.25

How to check the result

Matching positions must represent the same observation. Never reorder just one list. Pearson correlation is undefined if either list is constant, and a strong correlation does not establish causation.

Pearson correlation coefficient

Pearson's r describes the strength and direction of a linear relationship in paired observations. It ranges from minus one to plus one, with zero indicating no linear correlation.

  • Perfect positive correlation: r([1,2,3],[2,4,6]) = +1
  • Perfect negative correlation: r([1,2,3],[6,4,2]) = −1
  • Zero linear correlation: r([1,2,3],[1,0,1]) = 0

Important note

Correlation does not establish causation. Pearson's r is undefined when either series is constant.

Related calculators

Frequently asked questions

What is the range of r?

From -1 to +1.

What does r² mean?

The squared correlation; in simple linear regression it is the coefficient of determination.

Does strong correlation prove causation?

No. Correlation measures the strength and direction of a linear association, but it does not prove that one variable causes the other. A third variable, bias or chance may explain the pattern.

Can correlation be negative while r² is positive?

Yes. If r=−0.5, r²=0.25. The sign of r gives the direction of the linear association; squaring removes that direction.

Why is r undefined for a constant data series?

Its squared-deviation sum is zero, making the Pearson denominator zero. Both series need nonzero variation.