Correlation Coefficient Calculator
Compute Pearson’s r between two lists of numbers.
Results update as you type.
About this calculator
Pearson’s correlation coefficient (r) measures the strength and direction of the linear relationship between two variables, ranging from −1 (perfect negative) through 0 (no linear relationship) to +1 (perfect positive). It is found by dividing the covariance of x and y by the product of their standard deviations, which standardises the result into that fixed −1 to +1 range.
Enter paired x and y values in the same order; the two lists must have the same number of values. The calculator returns r, the coefficient of determination r², the covariance, and the least-squares regression line (slope and intercept), plus a plain-English reading of the strength, and plots the data with its best-fit line. It needs at least two pairs, and the result is undefined if either variable never changes.
Worked example: for x = 1, 2, 3, 4, 5 and y = 2, 4, 5, 4, 6 the points trend upward together, giving r ≈ 0.85 — a strong positive correlation — and r² ≈ 0.73, meaning about 73% of the variation in y is explained by a straight-line relationship with x. Correlation is used in finance, science and social research to spot which variables move together.
Frequently asked questions
What does the correlation coefficient tell me?
It quantifies how closely two variables move together in a straight line. Values near +1 or −1 indicate a strong linear relationship, while values near 0 mean little or no linear association. The sign shows the direction of the relationship.
Does correlation mean causation?
No. A high correlation shows two variables move together but not that one causes the other. A hidden third factor, or pure coincidence, can create a strong correlation with no causal link.
What is R²?
R² is the square of the correlation coefficient. It is the proportion of the variation in y explained by a linear relationship with x — an r of 0.8 gives an R² of 0.64, meaning 64% of the variation is accounted for.
What counts as a strong correlation?
As a rough guide, an absolute r below 0.3 is weak, around 0.3 to 0.5 moderate, 0.5 to 0.7 moderate-to-strong and above 0.7 strong. This calculator labels the strength for you, but sensible cutoffs vary by field.
What does a negative correlation mean?
A negative r means the variables move in opposite directions: as one rises the other tends to fall. An r of −0.9 is just as strong a linear relationship as +0.9, only reversed in direction.
What is the difference between correlation and covariance?
Covariance measures how two variables vary together but its size depends on their units, so it is hard to interpret. Pearson’s r is the covariance divided by the two standard deviations, which rescales it to a unit-free −1 to +1 range.
How is the regression line related to the correlation?
The least-squares regression line is the straight line that best fits the points, and its slope shares its sign with r. The correlation tells you how tightly the points hug that line, while r² gives the share of variation the line explains.
API — use this calculator from code
Call this calculator as a free JSON endpoint — no key required. Send the field values below as query parameters or JSON. Read the full API docs →
Endpoint
GET https://calculator.free/api/v1/correlation-coefficient/
curl
curl "https://calculator.free/api/v1/correlation-coefficient/?x=1, 2, 3, 4, 5&y=2, 4, 5, 4, 6"
JavaScript fetch()
const r = await fetch(
"https://calculator.free/api/v1/correlation-coefficient/?" + new URLSearchParams({
"x": "1, 2, 3, 4, 5",
"y": "2, 4, 5, 4, 6"
}));
const data = await r.json();
console.log(data.results);
Results are estimates for general guidance only, not financial, medical or tax advice.