Toolzent

Correlation Coefficient Calculator

Free correlation coefficient calculator: paste paired X and Y values to get Pearson's r, r squared and a strength label instantly, with formulas and worked examples.

Updated 2026-06-09 · Free · No sign-up · Runs privately in your browser

What is a correlation coefficient calculator?

A correlation coefficient calculator takes two columns of paired numbers — an X value and a Y value for each observation — and measures how tightly they move together in a straight line. The result, Pearson’s r, is a single number between −1 and +1. A value near +1 means the points climb together; near −1 they trade off in opposite directions; near 0 there is no straight-line relationship at all.

This tool reports Pearson’s r, the coefficient of determination r², and a plain-language strength label. Enter at least two pairs of equal length and it does the arithmetic instantly, with nothing leaving your browser.

How does the correlation coefficient calculator work?

The calculator uses the standard Pearson formula:

r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² · Σ(y − ȳ)²)

It works in clear steps:

  1. Means. Find the average of the X values (x̄) and of the Y values (ȳ).
  2. Deviations. For each pair, compute how far X sits from x̄ and how far Y sits from ȳ. Call these dx and dy.
  3. Cross-products. Multiply dx by dy for each pair and add them up: this sum, Σ(dx·dy), is the numerator and carries the sign of the relationship.
  4. Spreads. Add up dx² and add up dy² separately. Multiply those two sums and take the square root for the denominator.
  5. Divide. The numerator over the denominator gives r.

Here x̄ and ȳ denote the two means, and Σ means “sum of”. Because r divides a covariance-like quantity by the spread of both variables, it is unitless — the answer is the same whether X is in dollars, centimetres or points. The calculator then squares r to get (the share of Y’s variance explained by X) and applies a strength label: strong when |r| is at least 0.7, moderate at 0.4 or more, and weak at 0.1 or more.

Examples

Each example matches the calculator exactly. Type the same pairs into the tool above and you will get the same results.

Example 1: the verified five-pair set

For X = 1, 2, 3, 4, 5 and Y = 2, 4, 5, 4, 5:

  • Means: x̄ = 3 and ȳ = 4.
  • dx: −2, −1, 0, 1, 2. dy: −2, 0, 1, 0, 1.
  • Cross-products dx·dy: 4, 0, 0, 0, 2 — these add to Σ(dx·dy) = 6.
  • Σdx² = 4 + 1 + 0 + 1 + 4 = 10; Σdy² = 4 + 0 + 1 + 0 + 1 = 6.
  • r = 6 ÷ √(10 · 6) = 6 ÷ √60 ≈ 0.7746, so r² ≈ 0.60 — a strong positive correlation.

Example 2: a perfect positive line

For X = 1, 2, 3 and Y = 2, 4, 6 (Y is always 2·X):

  • Means: x̄ = 2 and ȳ = 4.
  • dx: −1, 0, 1. dy: −2, 0, 2.
  • Σ(dx·dy) = 2 + 0 + 2 = 4; Σdx² = 2; Σdy² = 8.
  • r = 4 ÷ √(2 · 8) = 4 ÷ √16 = 4 ÷ 4 = 1.0000, so r² = 1.00 — a perfect positive correlation.

Example 3: a perfect negative line

For X = 1, 2, 3 and Y = 6, 4, 2 (Y falls as X rises):

  • Means: x̄ = 2 and ȳ = 4.
  • dx: −1, 0, 1. dy: 2, 0, −2.
  • Σ(dx·dy) = −2 + 0 + −2 = −4; Σdx² = 2; Σdy² = 8.
  • r = −4 ÷ √(2 · 8) = −4 ÷ 4 = −1.0000, so r² = 1.00 — a perfect negative correlation.

Notice that r keeps the sign of the cross-products, but r² is always positive: r² = 1.00 in both Example 2 and Example 3 even though the relationships run in opposite directions.

How to read r and r squared

r valueDirectionStrength labelr² (variance explained)
+1.0PositivePerfect1.00 (100%)
+0.7 to +0.99PositiveStrong0.49 to 0.98
+0.4 to +0.69PositiveModerate0.16 to 0.48
+0.1 to +0.39PositiveWeak0.01 to 0.15
−0.1 to +0.1NoneNegligibleunder 0.01
−0.4 to −0.1NegativeWeak0.01 to 0.16
−1.0NegativePerfect1.00 (100%)

The strength label uses the size of r regardless of sign, so an r of −0.8 is just as strong as an r of +0.8. The r² column shows why the distinction matters: an r of 0.7 explains 49% of the variation in Y, while an r of 0.4 explains only 16%.

Common uses for the correlation coefficient

  • Research and science. Quantify how closely two measurements track, such as study hours versus exam scores or dose versus response.
  • Finance. Measure how two assets move together; a low or negative correlation between holdings is the basis of diversification.
  • Marketing and analytics. Check whether ad spend, traffic, or email frequency moves in step with conversions or revenue.
  • Health and sports. Relate training volume to performance, or one biometric to another, before building a model.
  • Feature selection. Before regression or machine learning, r flags which variables share a strong linear link with the target.

Tips and common mistakes

  • Correlation is not causation. A high r shows two variables move together, not that one drives the other; a hidden third factor or coincidence can fake it.
  • Pearson’s r only sees straight lines. A perfect U-shaped curve can give r near 0 even though X and Y are tightly related — always plot your points.
  • Watch for outliers. One extreme pair can swing r dramatically, inflating or hiding a relationship.
  • Pair your data correctly. X and Y must be the same length and aligned observation by observation; a misaligned row corrupts every cross-product.
  • Do not over-read small samples. With only a handful of pairs, a large r can appear by chance, so collect more data before trusting it.

Limitations and notes

Pearson’s r needs at least two paired values, and the two lists must be equal in length. It captures only the linear component of a relationship, so it can miss strong curved or cyclical patterns entirely. The coefficient is also dimensionless and symmetric — it does not tell you which variable is the cause, the slope of the line, or how to predict one value from another (that is the job of regression). Because deviations are multiplied, r is sensitive to outliers and to the range of the data you happen to sample. Treat r as one summary among several: pair it with a scatter plot and, where appropriate, a significance test. This tool is for educational and general analytical use and is not a substitute for professional statistical advice.

Keep exploring the statistics category: summarise the centre of a single list with the mean, median, mode calculator, gauge spread with the standard deviation calculator, or work out odds and chances with the probability calculator.

Frequently asked questions

What does the correlation coefficient tell you?+

It measures how strongly two variables move together in a straight line, from −1 (perfect negative) through 0 (no linear link) to +1 (perfect positive).

Worked example: what is Pearson's r for X = 1,2,3,4,5 and Y = 2,4,5,4,5?+

The means are 3 and 4, Σ(dx·dy) = 6, Σdx² = 10 and Σdy² = 6, so r = 6 ÷ √60 ≈ 0.7746 and r² = 0.60, a strong positive correlation.

What is the difference between r and r squared?+

r is the correlation coefficient between −1 and +1; r² is its square, between 0 and 1, giving the fraction of variance in Y explained by X.

What counts as a strong correlation?+

This tool labels |r| at or above 0.7 as strong, 0.4 or more as moderate and 0.1 or more as weak; below 0.1 there is essentially no linear relationship.

Can the correlation coefficient be negative?+

Yes. A negative r means the variables move in opposite directions, so as X rises, Y tends to fall, with −1 being a perfect downward line.

How many data pairs do I need?+

At least two paired values, and the X and Y lists must be the same length; more pairs give a far more reliable and meaningful estimate.

Does a high correlation prove causation?+

No. Correlation only measures association; a third factor or pure coincidence can produce a high r without one variable causing the other.