Pearson Correlation Calculator

Quick answer

The Pearson correlation calculator computes Pearson's r for paired data, labels its strength, tests it with a t statistic and p-value, gives a Fisher-z confidence interval and R², and draws the scatter plot with the least-squares regression line.

Pearson correlation coefficient r
0.9779
Strength and direction
Very strong positive correlation
Scatter plot with regression line
Coefficient of determination R²
0.9563
t statistic
9.3547
Degrees of freedom
4
p-value (two-tailed)
0.0007
Significant at 5%?
Yes – significant at the 5% level (p < 0.05)
Confidence interval for r
95% CI: 0.806 to 0.9977
Regression line
ŷ = 3.6429x + 45.9762
Slope b
3.64286
Intercept a
45.97619
Sample covariance
30.6
Standard deviation of X
2.89828
Standard deviation of Y
10.7966
Number of pairs
6
Step-by-step table
# x y x − x̄ y − ȳ (x − x̄)(y − ȳ) ────────────────────────────────────────────────────────────────── 1 2 55 −4 −12.8333 51.3333 2 4 62 −2 −5.8333 11.6667 3 5 60 −1 −7.8333 7.8333 4 7 71 1 3.1667 3.1667 5 8 75 2 7.1667 14.3333 6 10 84 4 16.1667 64.6667 Σ Σ(x−x̄)² = 42 Σ(y−ȳ)² = 582.8333 153

Pearson’s product-moment correlation coefficient r measures how closely paired data follow a straight line. It is the covariance of X and Y divided by the product of their standard deviations, which removes the units and pins the value between −1 and +1. r = +1 means every point lies exactly on a rising line, r = −1 on a falling line, and r = 0 means no linear trend.

Pearson’s r is symmetric (the correlation of X with Y equals that of Y with X) and unaffected by changing units or adding constants, so correlating temperatures in °C or °F gives the same answer. It is, however, sensitive to outliers and blind to curved patterns, which is why the scatter plot is shown next to the number.

A sample correlation is only an estimate. The calculator therefore tests the null hypothesis that the true correlation is zero with a t test on n − 2 degrees of freedom, and gives a confidence interval based on Fisher’s z transformation. Squaring r gives R², the share of the variance in Y explained by the regression line ŷ = a + bx, where the slope is b = r · sy ÷ sx.

How to use the Pearson Correlation Calculator

  1. X values
  2. Y values (same order as X)
  3. Confidence level

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

Enter the paired X and Y values. The calculator centres both variables on their means, adds the cross-products and divides by the square root of the product of the sums of squares. It then computes t, the two-tailed p-value, the confidence interval for the chosen level and the least-squares line.

Worked example

Six students studied 2, 4, 5, 7, 8 and 10 hours and scored 55, 62, 60, 71, 75 and 84. The means are 6 hours and 67.83 points. Σ(x − x̄)(y − ȳ) = 153, Σ(x − x̄)² = 42 and Σ(y − ȳ)² = 582.83, so r = 153 ÷ √(42 × 582.83) = 0.978 and R² = 0.956. t = 0.978 × √4 ÷ √(1 − 0.956) = 9.35 with 4 degrees of freedom, p ≈ 0.0007. The 95% confidence interval is 0.806 to 0.998, and the regression line is ŷ = 3.643x + 45.98 – each extra hour adds about 3.6 points.

How strong is r?

|r| (absolute value) Strength (Evans, 1996)
0.00 – 0.19 Very weak
0.20 – 0.39 Weak
0.40 – 0.59 Moderate
0.60 – 0.79 Strong
0.80 – 1.00 Very strong

Formula

r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² · Σ(y − ȳ)²) = cov(X, Y) ÷ (sx · sy) · t = r√(n − 2) ÷ √(1 − r²), df = n − 2 · CI: tanh(atanh r ± z* ÷ √(n − 3))

Worked example

Inputs — X values: 2, 4, 5, 7, 8, 10; Y values (same order as X): 55, 62, 60, 71, 75, 84; Confidence level: 95%.
Results — Pearson correlation coefficient r = 0.9779; Strength and direction = Very strong positive correlation; Coefficient of determination R² = 0.9563; t statistic = 9.3547; Degrees of freedom = 4; p-value (two-tailed) = 0.0007.

Key terms

Product-moment correlation
Another name for Pearson's r, the average product of standardized scores.
Fisher z transformation
z = atanh(r), which makes the sampling distribution of r approximately normal.
Bivariate normal
A joint distribution in which X and Y are each normal and linked linearly.

Frequently asked questions

How do I calculate Pearson's r by hand?

Subtract the mean from every x and every y, multiply the paired deviations and add them; divide that sum by √(Σ(x − x̄)² × Σ(y − ȳ)²). The step table below the result shows each of these columns.

How many data points do I need?

At least 3 for r and 4 for a confidence interval, but with fewer than about 10 pairs only very large correlations are statistically significant.

What does the p-value tell me?

The probability of a sample correlation at least this far from 0 if the true correlation were 0. With 6 pairs, r = 0.978 gives t = 9.35 and p ≈ 0.0007.

What are the assumptions of Pearson's correlation?

Paired, independent observations, a roughly linear relationship, no extreme outliers and, for the test and interval, approximately bivariate normal data.

How is r related to the regression slope?

Slope = r × sy ÷ sx. If X and Y have the same standard deviation, the slope equals r.

Does r = 0 mean the variables are independent?

Not necessarily. r = 0 rules out a linear relationship, but a curve can still link them. For normally distributed data zero correlation does imply independence.

What is a strong Pearson correlation?

On Evans' scale |r| from 0.6 to 0.79 is strong and 0.8 or more very strong, but importance depends on the field.

Sources

  1. Wikipedia – Pearson correlation coefficient
  2. Penn State STAT 462 – Applied Regression Analysis
  3. OpenStax – Introductory Statistics 2e

Cite this calculator

Speedy Calculator. (2026). Pearson Correlation Calculator. Speedy Calculator. https://speedycalculator.com/calculators/statistics/pearson-correlation/