Pearson Correlation Coefficient Calculator
The Pearson correlation coefficient (r) measures the strength and direction of the *linear* relationship between two continuous variables X and Y. Paste paired data and the tool computes r, the coefficient of determination r², the least-squares fit Y = a·X + b, sample means and standard deviations, covariance, and the t-statistic and two-sided p-value for H₀: ρ = 0.
Separate values with commas, spaces or newlines; both lists must have the same length.
Enter at least two valid (X, Y) pairs and make sure both X and Y have non-zero variance.
Pearson correlation r
—
r ranges from −1 to +1; the closer to ±1, the stronger the linear relationship.
—
Coefficient of determination r²
—
Share of variance in Y explained by the linear fit on X.
Least-squares fit: Y = a·X + b
—
- Slope a
- —
- Intercept b
- —
Descriptive statistics
- Mean of X (x̄)
- —
- Mean of Y (ȳ)
- —
- Sample SD of X (sₓ)
- —
- Sample SD of Y (sᵧ)
- —
- Sample covariance cov(X, Y)
- —
Significance test (H₀: ρ = 0)
- t statistic
- —
- Degrees of freedom df = n − 2
- —
- Two-sided p-value
- —
Uses t = r · √((n − 2)/(1 − r²)). A small p-value rejects the null hypothesis that the true correlation is zero.
—
| # | X | Y |
|---|
Pearson r measures *linear* association only — a clear non-linear pattern (e.g. a U-shape) can give r ≈ 0 even when X and Y are strongly related. Correlation does not imply causation.
Formula
r = Σ(xᵢ − x̄)(yᵢ − ȳ) / √(Σ(xᵢ − x̄)² · Σ(yᵢ − ȳ)²) Regression: a = Σ(xᵢ − x̄)(yᵢ − ȳ) / Σ(xᵢ − x̄)²; b = ȳ − a·x̄ Significance test: t = r · √((n − 2) / (1 − r²)), df = n − 2
- · r is constrained to [−1, +1]: +1 indicates a perfect positive linear relationship, −1 a perfect negative one and 0 no linear relationship (which does not imply independence).
- · r² represents the fraction of variance in Y explained by the linear fit on X — e.g. r = 0.8 → r² = 0.64, so 64 % of the variation in Y is accounted for.
- · Conventional social-science strength bands: |r| ≥ 0.7 strong, 0.4–0.7 moderate, < 0.2 very weak. Engineering and lab data typically demand higher thresholds.
- · The p-value comes from t = r · √((n − 2)/(1 − r²)) with df = n − 2 (two-sided). A common cutoff is p < 0.05 — but with very large n, statistically significant correlations may still be practically tiny.
- · Pearson r only captures *linear* association. Non-linear patterns (U-shape, circular, exponential) can give r ≈ 0 even when X and Y are strongly related. Always inspect the scatter plot.
- · Pearson r is sensitive to outliers because deviations are squared; one or two extreme points can dominate the result. Consider rank-based alternatives like Spearman ρ if outliers are present.
Frequently asked
How large does r need to be before the correlation is considered "strong"?
There is no single rulebook — it depends on the field. In social science and psychology a common scheme is |r| < 0.2 very weak, 0.2–0.4 weak, 0.4–0.7 moderate, 0.7–0.9 strong and ≥ 0.9 very strong. Physical-science or engineering work often expects much higher values (e.g. r > 0.95 for a "good" fit). Always check the sample size and p-value alongside r — with large n, even tiny correlations can look "significant" but mean little in practice.
Does a high correlation mean there is a causal relationship?
No — "correlation does not imply causation" is the classic statistics caveat. A high r can arise from a common cause (a lurking confounder), coincidence, selection bias, or reverse causation (Y influences X). Establishing causality usually requires a controlled experiment (RCT) or a causal-inference design such as instrumental variables, natural experiments or difference-in-differences. Correlation alone is not enough.
When should I use Spearman's rank correlation instead of Pearson?
Spearman's ρ is usually a better fit when the data has clear outliers, when one of the variables is ordinal rather than interval (e.g. a 1–5 rating), or when you expect a monotonic but not strictly linear relationship (e.g. exponential or logarithmic growth). Spearman ranks the values first and then applies Pearson to those ranks, which makes it robust to outliers and non-linear monotonic patterns — at the cost of no direct slope/intercept interpretation and loss of the original scale.
What is the minimum sample size for a meaningful correlation?
Mathematically you can compute r from just n = 2 (it will always be ±1) but it carries no statistical meaning. A practical rule of thumb is n ≥ 10 for an initial look, n ≥ 30 for a formal test, and n ≥ 100 if you want to reliably detect a small effect such as r ≈ 0.2. The larger the sample, the more easily a small r will become "significant" — but significance is not the same as practical importance: with very large n you can have r = 0.05 and p < 0.001 yet effectively no real-world relationship.
Related tools
Percentage Calculator
Percent of, percent change, and percent add/subtract in one.
GCD & LCM Calculator
Enter 2–6 positive integers to get the greatest common divisor (HCF / GCD) and least common multiple (LCM), with the Euclidean step chain shown.
Average Calculator (Mean / Median / Mode)
Enter a list of numbers to get the mean, median, mode, range plus standard deviation, variance and total.
Quadratic Equation Solver
Enter the coefficients of ax² + bx + c = 0 to find the real or complex roots, discriminant and vertex.
Password Strength (Entropy) Calculator
Estimate a password's bit entropy, brute-force time and strength tier. All computation happens in your browser.
Scientific Notation Converter
Convert between standard decimal numbers and scientific notation, with significant figures and order of magnitude.
Permutations & Combinations (nPr / nCr) Calculator
Compute permutations P(n,r), combinations C(n,r) and factorial n! — useful for probability problems, lottery odds and combinatorics homework.
Standard Deviation Calculator
Paste a list of numbers to compute mean, median, sample and population variance and standard deviation — with the working shown.
Triangle Calculator (SSS / SAS / ASA)
Solve a triangle from 3 sides, 2 sides + 1 angle, or 2 angles + 1 side — area, perimeter and remaining parts via the law of sines / cosines.
Pythagorean Theorem Calculator
Given any two sides of a right triangle (two legs, or one leg plus the hypotenuse), instantly find the third side, area, perimeter and the two non-right angles.
Circle Calculator (radius / diameter / circumference / area)
Enter any one of radius, diameter, circumference or area to get the other three — useful for design, engineering and DIY.
Roman Numeral Converter
Two-way conversion between Arabic numbers (1–3999) and Roman numerals (I, V, X, L, C, D, M) — handy for typesetting, chapter titles and homework.
Slope & Line Equation Calculator (y = mx + b from Two Points)
Enter two points (x₁, y₁) and (x₂, y₂) to instantly get the slope, y-intercept, line equation y = mx + b, distance, and midpoint — a classroom staple for algebra and coordinate geometry.
Birthday Paradox Calculator
Enter group size n to see the probability that at least two people share a birthday — the classic birthday problem.
Logarithm Calculator (log / ln / log₂ / any base)
Compute logₐ(x) for any base — natural log (ln), common log (log₁₀), binary log (log₂) and a custom base, with the change-of-base steps shown.
Z-Score (Standard Score) Calculator
Enter a value, the mean and the standard deviation to compute the z-score and the corresponding normal-distribution percentile and probabilities.
Screen Pixel Density (PPI) Calculator
Enter the screen resolution and diagonal size to get pixel density (PPI), real width/height, dot pitch and total pixel count.
Hong Kong Mark Six Odds Calculator
Enter the number of tickets / selections and see the actual probability of hitting first, second … prizes in a Mark Six (6-of-49) draw.
Decimal to Fraction Converter
Convert any decimal (including repeating decimals) to a simplified fraction and a mixed number.
Sphere Volume & Surface Area Calculator
Give a sphere any one of radius, diameter, surface area or volume and instantly get the other three — plus the great-circle circumference and area.
Cylinder Volume & Surface Area Calculator
Enter the radius and height of a cylinder to get volume (π r²h), lateral surface, base area and total surface area.
Permutations (nPr) Calculator
Compute nPr — the number of ordered arrangements of r items chosen from n — alongside n!, r! and the related combination nCr.
Prime Factorization Calculator
Factor any integer from 2 up to 10¹² into primes, see the canonical exponent form, count and list all divisors.
Geometric Mean Calculator
Compute the n-th root of the product of n positive numbers — the right average for growth rates, returns and ratios — alongside the arithmetic mean for comparison.
Fibonacci Sequence Calculator
Enter any integer n from 0 to 1500 to instantly compute F(n) and F(n−1) with BigInt precision, the consecutive-term ratio (converging to the golden ratio φ) and the first 30 terms of the sequence.
Dice Roll Probability Calculator
Pick the number of dice, sides (d4 / d6 / d8 / d10 / d12 / d20) and a target sum to compute the probability of rolling exactly that total, at least, or at most.
Arithmetic Series Calculator
Enter first term a, common difference d and number of terms n to compute the nth term aₙ and the partial sum Sₙ = n/2·(2a + (n − 1)d).
Survey Sample Size Calculator
Enter confidence level, margin of error, expected proportion (and optional population size) to compute the survey sample size you need.
Geometric Series Sum Calculator
Enter the first term a, common ratio r and number of terms n to find the sum of the first n terms of a geometric series — plus the infinite-series sum when |r| < 1.
Cone Volume & Surface Area Calculator
Enter base radius and height to get the cone volume, slant height, lateral, base and total surface area.
Music Note Frequency Calculator
Pick a note (C, C♯, D, …), octave and tuning reference A4 (440 Hz by default) and the tool returns the frequency in Hz, the wavelength in air and the MIDI note number via f = A4 × 2^((n − 69)/12).
Linear Interpolation Calculator (Lerp)
Enter two known points (x₁, y₁) and (x₂, y₂) and a target x to instantly read off y via y = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁) — the tool flags whether your x sits inside the two points (interpolation) or outside (extrapolation).
Trapezoid Area Calculator
Enter the two parallel sides and height of a trapezoid to get its area, midsegment length and perimeter when the legs are known.
Binomial Probability Calculator
Enter the number of trials n, the per-trial success probability p and a target number of successes k to get P(X = k), P(X ≤ k), P(X ≥ k) along with the distribution mean and standard deviation.