# Pearson Correlation Calculator

URL: https://speedycalculator.com/calculators/statistics/pearson-correlation/
Last updated: 2026-10-30

> 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.

## Inputs

- X values
- Y values (same order as X)
- Confidence level

## Results

- Pearson correlation coefficient r
- Strength and direction
- Scatter plot with regression line
- Coefficient of determination R²
- t statistic
- Degrees of freedom
- p-value (two-tailed)
- Significant at 5%?
- Confidence interval for r
- Regression line
- Slope b
- Intercept a
- Sample covariance
- Standard deviation of X
- Standard deviation of Y
- Number of pairs
- Step-by-step table

## 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))
```

## Explanation

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

- **X values**
- **Y values (same order as X)**
- **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.19Very weak0.20 – 0.39Weak0.40 – 0.59Moderate0.60 – 0.79Strong0.80 – 1.00Very strong

## 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.

## FAQ

**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

- [Wikipedia – Pearson correlation coefficient](https://en.wikipedia.org/wiki/Pearson_correlation_coefficient)
- [Penn State STAT 462 – Applied Regression Analysis](https://online.stat.psu.edu/stat462/)
- [OpenStax – Introductory Statistics 2e](https://openstax.org/details/books/introductory-statistics-2e)
