Pearson Correlation Calculator — r, r² and Significance
Enter two equal-length lists of numbers to compute Pearson's r, the coefficient of determination r², and a t-test for significance. The step-by-step solution shows every intermediate quantity — means, covariance numerator, variance terms — so you can follow the maths.
very strong positive correlation — r ranges from −1 to +1
n (pairs)
Mean of X
Mean of Y
Σ(xᵢ − x̄)(yᵢ − ȳ) [covariance numerator]
Σ(xᵢ − x̄)² [variance of X]
Σ(yᵢ − ȳ)² [variance of Y]
r = Sxy / √(Sxx × Syy)
r² (coefficient of determination)
t-statistic (df = 3)
- 1
Mean of X (x̄)
5 - 2
Mean of Y (ȳ)
6.2 - 3
Sxy = Σ(xᵢ − x̄)(yᵢ − ȳ)
38 - 4
Denominator = √(Sxx × Syy)
√(40 × 36.8) = 38.3667 - 5
Pearson r = Sxy ÷ denominator
38 ÷ 38.3667 = 0.9904
How does this calculator work?
r = Σ(xᵢ−x̄)(yᵢ−ȳ) / √[Σ(xᵢ−x̄)² · Σ(yᵢ−ȳ)²]. It ranges from −1 to +1; r² gives shared variance. The t-statistic t = r√(n−2)/√(1−r²) tests whether ρ = 0 at α = 0.05. Needs at least 3 pairs. Pearson r detects only linear relationships and is sensitive to outliers.
Formula
How this is calculated
Pearson's r measures the strength and direction of the linear relationship between two continuous variables. It is computed from paired observations (x₁,y₁), …, (xₙ,yₙ): subtract the mean from each value to get deviations, multiply paired deviations and sum them (the covariance numerator Sxy), then divide by the geometric mean of the two variance sums √(Sxx · Syy). The result is dimensionless and lies in [−1, +1]: +1 is a perfect positive line, −1 is a perfect negative line, 0 means no linear trend. r² (the coefficient of determination) gives the proportion of variance in Y that is linearly explained by X.
To test whether the correlation is statistically significant, r is converted to a t-statistic: t = r × √(n − 2) / √(1 − r²), which follows a t-distribution with n − 2 degrees of freedom under the null hypothesis that the true population correlation ρ = 0. This calculator reports the t-statistic and whether |t| exceeds the two-tailed critical value at α = 0.05 (the precise critical value depends on df: 12.706 for df = 1, 2.571 for df = 5, 2.042 for df = 30+).
Pearson's r captures only monotone linear patterns and is sensitive to outliers. It assumes the variables are measured on a continuous scale, the observations are independent, and ideally that the data are bivariate-normal for the significance test to be exact. At least 3 pairs are needed (the t-distribution has df = n − 2 ≥ 1). Correlation does not imply causation.
Frequently asked questions
An r of 0.8 indicates a strong positive linear relationship: as X increases, Y tends to increase proportionally. r² = 0.64 means that 64% of the variation in Y can be statistically explained by a linear function of X. The remaining 36% is unexplained by this linear model.
At minimum you need n ≥ 3 to compute a t-statistic. In practice, small samples produce unreliable estimates of ρ — with n = 5 even an r of 0.88 is needed to reach p < 0.05. For a stable estimate of a moderate correlation (|r| ≈ 0.3–0.5) aim for at least n = 30–50 pairs.
Use Spearman's rank correlation when the data contain severe outliers, when the relationship is monotone but not linear, or when the variables are ordinal rather than continuous. Spearman is computed by replacing each value with its rank and then applying the Pearson formula to the ranks.
Also known as
TG we-Calculate Editorial Team. (2026). Pearson Correlation Calculator — r, r² and Significance [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/pearson-correlation-calculator
TG we-Calculate Editorial Team. "Pearson Correlation Calculator — r, r² and Significance." TG we-Calculate. 2026. https://we-calculate.com/calculator/pearson-correlation-calculator.
TG we-Calculate Editorial Team, "Pearson Correlation Calculator — r, r² and Significance," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/pearson-correlation-calculator
@misc{wecalculate_pearson_correlation_calculator, title = {Pearson Correlation Calculator — r, r² and Significance}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/pearson-correlation-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
