Correlation Coefficient Calculator
Pearson, Spearman and Kendall correlations with tests, intervals and a correlation matrix.
Try before you buy.
- Free preview: a watermarked scatter plot of your data and the names of each table’s first rows (up to 3), with the coefficient, the working and every figure hidden.
- Locked until you unlock it: download and copy.
- Unlock: Pro pass, ₹179 for 30 days, a one-time payment that never renews.
Ways to unlock shows how to get the full result.
Printing this result is locked in the free preview.
Result
This is the last result worked out. Fix the input above to update it.
Locked in the free preview. Opens the ways to unlock this result.
Locked in the free preview. Batch runs unlock with a pass.
Locked in the free preview. Query results unlock with a pass.
About the Correlation Coefficient Calculator
Paste two columns of numbers and get Pearson’s r — with r², the covariance, the t-test of whether the correlation is zero and a Fisher-z confidence interval — together with the rank correlations Spearman’s ρ and Kendall’s τ-b, each with its p-value. Small samples without ties get exact p-values for the rank correlations, and ties are handled the standard way: average ranks for Spearman, the τ-b correction and Kendall’s tie-corrected variance for Kendall.
A step table lists the deviations, products, squares, ranks and rank differences behind every formula, and the scatter plot shows the points with the least-squares line. Paste three or more columns to get a colour-coded correlation matrix with p-values; choose any cell to see that pair in detail.
How to use it
- Paste two or more columns from a spreadsheet — a first row of names is used — or type one x, y pair per line.
- Choose which coefficient to show first, the alternative hypothesis (two-sided unless you expect a direction) and α; the confidence level is for the interval of Pearson’s r.
- Read the coefficient and its p-value, then compare all three coefficients and look at the scatter plot: very different values mean outliers or a curved relationship.
- With several variables, choose a cell of the matrix (or the two variables) to see that pair in detail.
- Copy the results or download a CSV file or the scatter plot — with a Pro pass or after unlocking this result; without one you see the free preview.
Examples
x: 10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5 · y: 8.04, 6.95, 7.58, 8.81, 8.33, 9.96, 7.24, 4.26, 10.84, 4.82, 5.68
r = 0.816421 (t(9) = 4.2415, p = 0.00217), 95 % CI [0.4244, 0.9507]; ρ = 0.818182; τ-b = 0.636364 (exact p = 0.00571)
Anscombe made four data sets with this same r; only plotting them shows how different they are.
(1, 2), (2, 1), (3, 4), (4, 3), (5, 7), (6, 5), (7, 6)
ρ = 0.821429 with exact two-sided p = 0.0341; τ = 0.619048 with exact p = 0.0690
(1, 3), (2, 1), (2, 2), (3, 2), (4, 5), (4, 4), (4, 6), (5, 6)
τ-b = 0.640513 (19 concordant, 3 discordant pairs), z = 2.0839; ρ = 0.788957 from average ranks
Common uses
- Measuring how strongly two measurements move together — study time and scores, price and demand, height and weight.
- Rank correlations for ordinal data (ratings, rankings) or for relationships that are monotonic but not straight.
- Screening many variables at once with a correlation matrix before building a model.
- Checking textbook and homework correlations with the full working.
The three coefficients
- Pearson’s r (Pearson) = Σ(x − x̄)(y − ȳ) / √[Σ(x − x̄)²·Σ(y − ȳ)²] measures the strength of a straight-line relationship, from −1 to 1. r² is the share of the variance of y explained by a straight line in x.
- Spearman’s ρ (Spearman) is Pearson’s r of the ranks: it measures any monotonic relationship and resists outliers. Without ties ρ = 1 − 6Σd²/(n(n² − 1)), where d is the difference of the two ranks; with ties the calculator uses average ranks and the Pearson formula.
- Kendall’s τ (Kendall) compares every pair of points: concordant pairs (both variables move the same way) against discordant ones. τ-b = (n_c − n_d)/√((n₀ − n₁)(n₀ − n₂)) corrects for ties; it is usually smaller than ρ for the same data.
Is the correlation significant?
For Pearson’s r the test of no correlation is t = r·√(n − 2)/√(1 − r²) with n − 2 degrees of freedom. Spearman’s ρ uses the same t approximation, and for up to 10 pairs without ties the calculator also gives the exact p-value from all n! orderings. Kendall’s S = n_c − n_d has an exact distribution for up to 50 pairs without ties; otherwise z = S/√Var(S) with the variance corrected for ties. A significant correlation can still be weak: with 1,000 pairs, r = 0.07 is significant at the 5 % level.
A confidence interval for r
Fisher’s transformation z = atanh r = ½·ln((1 + r)/(1 − r)) is approximately normal with standard error 1/√(n − 3). The interval tanh(z ± 1.96/√(n − 3)) is then turned back to the r scale, so it is not symmetric around r. It needs at least 4 pairs and assumes the data are roughly bivariate normal.
Correlation is not the whole story
A correlation summarizes one aspect of the data. Anscombe’s quartet — four data sets with the same r = 0.816 — includes a curve, a line with one outlier and a single influential point: always look at the scatter plot. Pearson’s r misses relationships that are strong but not straight, such as a U-shape, and correlation never shows on its own which variable causes which. Cohen’s rough guide calls |r| = 0.1 small, 0.3 medium and 0.5 large; your field’s typical values matter more.
Limitations
- Up to 100,000 rows and 12 variables; the step table on the page lists the first 1,000 pairs, and the CSV all of them.
- Missing values are left out pair by pair, so different cells of a matrix can rest on different numbers of rows (each cell shows its n).
- The p-values assume independent observations; for time series, autocorrelation makes them far too small.
- The matrix gives p-values for each pair separately; with many variables some will be significant by chance.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What do I get without a pass?
Without a pass, Correlation Coefficient Calculator shows a watermarked scatter plot of your data and the names of each table’s first rows (up to 3), with the coefficient, the working and every figure hidden. Until you unlock it, the result can’t be downloaded or copied. A Pro, Premium or Ultimate pass, a one-time payment that never renews, unlocks the full result. The pricing page lists the passes and their prices.
How do I calculate Pearson’s correlation coefficient by hand?
Subtract the means, multiply the paired deviations and add them up, then divide by the square root of the product of the two sums of squared deviations. The step table does exactly that: for Anscombe’s first data set Σ(x − x̄)(y − ȳ) = 55.01, Σ(x − x̄)² = 110 and Σ(y − ȳ)² = 41.27, so r = 55.01/√(110 × 41.27) = 0.816.
When should I use Spearman or Kendall instead of Pearson?
Use a rank correlation when the data are ranks or ratings, when the relationship is monotonic but curved, or when outliers would dominate Pearson’s r. Kendall’s τ has a more direct meaning (the difference between the chances that a pair is in the same or the opposite order) and better small-sample behaviour; Spearman’s ρ is more widely reported.
What does r² mean?
The share of the variation of one variable that a straight-line relationship with the other explains. r = 0.816 gives r² = 0.667: about two thirds of the variation of y goes with x, and one third does not.
Can a correlation be significant but weak?
Yes. Significance depends on the sample size: with 1,000 pairs even r = 0.07 has p < 0.05, while with 10 pairs r = 0.6 does not quite reach it (p = 0.067). Report the coefficient and its interval, not only the p-value.
What is the difference between covariance and correlation?
Covariance Σ(x − x̄)(y − ȳ)/(n − 1) is in the units of x times the units of y, so its size depends on the scale. Correlation divides it by both standard deviations, which makes it unit-free and always between −1 and 1.