Correlation Coefficient Calculator

Compute Pearson's r, coefficient of determination (R²), linear regression equation, and p-value. Visualize data with interactive scatter plot and line of best fit.

Quick examples:
? Strong positive (1,2,3,4,5 / 2,4,6,8,10)
? Moderate positive (1,2,3,4,5 / 2,4,5,4,5)
? Negative correlation (1,2,3,4,5 / 10,8,5,3,1)
⚖️ Weak / noisy (1,2,3,4,5 / 3,1,6,2,5)
? Non-linear (1,2,3,4,5 / 1,4,9,16,25)
Privacy first: All calculations and visualizations happen locally in your browser. No data is sent to any server.

Understanding Pearson Correlation

The Pearson correlation coefficient (r) measures the strength and direction of the linear relationship between two continuous variables. r ranges from -1 to +1: +1 perfect positive, 0 no linear correlation, -1 perfect negative. Formula: covariance divided by product of standard deviations.

$$ r = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum (x_i - \bar{x})^2 \sum (y_i - \bar{y})^2}} $$

This tool also provides (proportion of variance explained), p-value (testing H₀: r=0), and the ordinary least squares regression line. A low p-value (<0.05) indicates a statistically significant linear association.

✨ Why use this interactive tool?

  • ✔️ Instant visualization: detect outliers and see linear trend.
  • ✔️ Perfect for students, researchers, and business analysts.
  • ✔️ Interpret correlation strength with scatter plot and regression.
  • ✔️ No installation, fully client-side.

⚙️ Calculation logic

Algorithm: (1) parse numeric arrays, (2) compute means, sums of squares and cross-products, (3) derive Pearson r, (4) slope = Cov(X,Y)/Var(X) and intercept = ȳ - slope·x̄, (5) p-value using t-distribution with df = n-2: t = r·√((n-2)/(1-r²)). All results rounded to 4 decimals.

Case study: Study hours vs Exam scores

Researcher collects n=10: study hours (X) and final scores (Y). Using this calculator: r = 0.85, R² = 0.72, p = 0.002 → strong positive correlation, 72% variance explained, significant. Scatter plot shows clear upward trend.

Limitations & assumptions
  • ✔ Assumes linearity and approximate normality for inference.
  • ✔ Sensitive to outliers – always check the scatter plot.
  • ✔ Non-linear relationships may give r ≈ 0 even if strong pattern exists.
  • ✔ Correlation does NOT imply causation.
Correlation strength|r| rangeInterpretation
Perfect= 1.0Exact linear relationship
Strong0.7 – 0.9Clear linear trend
Moderate0.4 – 0.69Noticeable association
Weak0.1 – 0.39Slight linear relationship
Negligible0 – 0.1No linear correlation

? Authoritative basis: This tool implements standard formulas (Pearson, 1895; Fisher, 1915) and is validated against R cor.test and SciPy outputs. Reviewed by GetZenQuery tech team — updated June 2026.

References: NIST/SEMATECH e-Handbook, Statistics by Freedman, Pisani, Purves.

❓ Frequently Asked Questions

Depends on the field: social sciences often consider r > 0.6 strong; physical sciences may expect r > 0.9. Always interpret in context.

No. Correlation does not imply causation; lurking variables may explain the relationship.

At least 3 pairs required, but statistical reliability improves with n ≥ 10–20.

Examine the scatter plot; consider robust alternatives like Spearman's rank correlation for skewed data or outliers.