Correlation Calculator
Pearson correlation coefficient r with scatter plot, regression line, and interpretation guide.
Fitted line: ŷ = 1.1333 + 0.9758 · x
Scatter plot with best-fit line
Pearson's r measures the strength and direction of a LINEAR relationship between two continuous variables. r runs from −1 (perfect negative line) through 0 (no linear association) to +1 (perfect positive line). This tool reports r, r², the OLS best-fit line, and a t-test for whether r differs from zero.
Reading r
|r| ≈ 0.1 — weak. |r| ≈ 0.3 — moderate. |r| ≈ 0.5 — strong. |r| ≥ 0.7 — very strong. These thresholds vary by field; physics expects much higher than social science.
Sign matters: positive r means as x grows, y tends to grow; negative r means y tends to fall.
r² (coefficient of determination) is the share of variance in y explained by a linear model on x. r = 0.7 → r² = 0.49: about half of y's variation is linearly explained by x.
Significance test
Even with no underlying relationship (ρ = 0), small samples produce nonzero r by chance.
Test statistic: t = r · √(n − 2) / √(1 − r²), with df = n − 2.
Two-tailed p-value tells you the probability of seeing |r| this large or larger under H₀: ρ = 0. Significant at α = 0.05 if p < 0.05.
For n = 30 with r = 0.4, t = 2.31 → p ≈ 0.028 (significant). For n = 10 with the same r, t = 1.23 → p ≈ 0.25 (not significant). Sample size matters enormously.
Worked example
x = (1,2,3,4,5,6,7,8,9,10), y = (2,4,5,4,5,7,8,8,10,12).
mean(x) = 5.5, mean(y) = 6.5. Σ(xi−x̄)(yi−ȳ) = 73.5. Σ(xi−x̄)² = 82.5. Σ(yi−ȳ)² = 75.
r = 73.5 / √(82.5·75) ≈ 0.934. r² ≈ 0.873 — about 87% of y's variance is explained by a linear fit on x.
OLS slope = 73.5/82.5 ≈ 0.891; intercept = 6.5 − 0.891·5.5 ≈ 1.6. Fitted line: ŷ = 1.6 + 0.89·x.
Correlation is not causation
Ice-cream sales correlate with drownings; both spike in summer (the lurking variable). r doesn't tell you which way the arrow points or whether one even exists.
Reverse causation: faster typing correlates with more typos — typing speed could cause typos, typos (frustration) could slow typing, or both depend on fatigue.
Confounders: school years and salary correlate; ability, family background, and field all confound.
Restriction of range — if you only sample the top 10% of x, r drops sharply even if the true relationship is strong.
Common pitfalls
r only catches LINEAR relationships. A perfect parabola y = x² with x spanning negative and positive gives r ≈ 0.
Outliers swing r dramatically — one extreme point can flip a weak negative to a strong positive. Always plot the scatter.
Treating r as a probability or percentage. r = 0.5 doesn't mean '50% related'; r² is the variance-explained percentage.
Computing r across heterogeneous subgroups can hide or invert the true within-group relationships (Simpson's paradox).
Frequently asked questions
Pearson vs Spearman?
Pearson assumes linearity and approximately normal residuals. Spearman uses ranks instead and captures any monotonic relationship — use it for ordinal data or when outliers dominate.
Can r be exactly 1 or −1?
Only when every data point sits exactly on a single line. In real data, expect to never see exact ±1.
How large a sample do I need?
To detect r = 0.3 at α = 0.05 with 80% power, you need about n = 84. To detect r = 0.5, about n = 30.
What if my two variables aren't both continuous?
For one continuous + one binary, use point-biserial (mathematically equivalent to two-sample t). For two binary, use the phi coefficient (mathematically equivalent to chi-square).
More in Statistics & Probability
From z-scores and confidence intervals to t-tests, chi-square, correlation, regression, and the binomial/Poisson distributions — textbook-grade tools with worked examples.
- Z-Score Calculator
Convert a value to a z-score, percentile, and tail probabilities using the standard normal distribution.
- Normal Distribution Calculator
Find P(X<x), P(X>x), and between-range probabilities for any normal distribution with mean μ and SD σ.
- Binomial Distribution Calculator
Compute P(X=k), cumulative probabilities, mean, and variance for n trials with success probability p.
- Poisson Distribution Calculator
Model rare events with rate λ — get P(X=k), cumulative probability, mean, and variance.
- Permutations & Combinations Calculator
Compute nPr (order matters) and nCr (order doesn't) with full counting-principle explanation.
- Bayes' Theorem Calculator
Update prior beliefs with new evidence using Bayes' rule — posterior probability with tree diagram.
Related calculators
Browse all Education →Linear Regression Calculator
Least-squares slope, intercept, R², and predictions for any paired (x, y) data.
Fraction Calculator
Add, subtract, multiply, and divide fractions and mixed numbers — results returned simplified, as a mixed number, and as a decimal.
Standard Deviation Calculator
Mean, median, mode, range, sample/population standard deviation, variance, quartiles, IQR, and SEM for any list of numbers.
Course Grade Calculator
Weighted course grade from assignments, quizzes, and exams. Shows current grade plus the score needed on remaining work.
Scientific Calculator
Free online scientific calculator with trig, logs, exponents, square roots, parentheses, and constants pi and e.
Area of a Circle Calculator
Find the area of a circle from its radius, diameter, or circumference with the exact formula A = π × r².
Circumference Calculator
Find the circumference of a circle from its radius, diameter, or area using C = 2 × π × r.
Cylinder Volume Calculator
Volume and surface area of any cylinder from its radius and height using V = π × r² × h.