ASSOCIATION BETWEEN TWO VARIABLES
Pearson Correlation Calculator
Calculate Pearson’s r from paired observations and inspect the scatter plot. This calculator reports linear association only; it does not claim that one variable causes the other.
YOUR DATA
Enter paired observations
Paste or upload numeric X and Y columns. Use a period as the decimal mark. Up to 5 MB and 5,000 observations are accepted.
The file is read locally in your browser.
YOUR RESULTS
Pearson correlation
Scatter plot
Each point is one paired observation.
How to use this calculator
- Paste paired X and Y values, or load the sample data.
- Choose which columns represent the two variables.
- Review Pearson’s r, r² and the scatter plot.
- Download a JSON summary for your notes.
Formula and calculation method
Pearson’s r is computed as r = Sxy / √(Sxx·Syy), where Sxy = Σ((x − x̄)(y − ȳ)), Sxx = Σ((x − x̄)²) and Syy = Σ((y − ȳ)²). The calculator uses centered sums for numerical stability.
Worked example: X = [1, 2, 3], Y = [2, 3, 5]. x̄ = 2, ȳ = 10/3, Sxx = 2, Syy = 14/3, Sxy = 3. Therefore r = 3 / √(2 · 14/3) = 3 / √(28/3) ≈ 0.98198, and r² = 27/28 ≈ 0.96429.
Interpretation and limitations
- Pearson’s r measures the strength and direction of a linear association. A value near zero does not rule out a strong nonlinear relationship.
- Correlation is not causation. A high r does not show that X causes Y, that Y causes X, or that no third variable is involved.
- r is undefined when either variable is constant, because the denominator is zero. The calculator reports this explicitly.
- Outliers can strongly influence r. Inspect the scatter plot before interpreting the number.
- The current input limit is 5,000 observations and 5 MB per file.
Related calculators
Linear regression · R-squared calculator · Compare regression models