CalcUnit Logo

Correlation Coefficient Calculator

Paste paired data — any number of pairs, three or more — and get Pearson's r with the regression line it comes from.

Pearson Correlation

One pair per line, X first, then Y — like "3, 7". There is no five-pair ceiling: paste as many pairs as you have.

Fitted line: ŷ = 2.2 + 0.6x · r = 0.7745966692 · R² = 0.6
Correlation (r)
0.7745966692
R Squared (R²)
0.6
Slope (b)
0.6
Intercept (a)
2.2
Pairs Fitted
5
x: 0.76 to 5.24y: 1.7 to 5.3

Each dot is one pair at its exact position; the orange line is the least-squares fit through them.

What is the Correlation Coefficient Calculator?

What this calculator does

This page computes the Pearson correlation coefficient r for paired data — any number of pairs, pasted one per line — and shows the regression line and scatter plot it comes from, so the single famous number arrives with its evidence attached.

One pair per line

The data box takes one observation per line, X first, then Y, like 3, 7. The old page's five fixed pairs are gone: the count is whatever you paste, with three pairs as the minimum for a correlation worth the name.

The worked default

The page opens with (1, 2), (2, 4), (3, 5), (4, 4), and (5, 5). Their correlation is r equals 0. 7746 — a fairly strong positive association — with R squared 0. 6 and the fitted line y-hat equals 2. 2 plus 0. 6x beneath it.

What r measures

Pearson's r grades how tightly the points hug a straight line, on a scale from -1 to 1. Near 1 the points climb together along a line; near -1 they fall together; near 0 no straight line organizes them at all, whatever other pattern they may hold.

Why the line comes with it

A correlation without its line is a grade without the exam. The slope and intercept tiles give the least-squares line for the same pairs, the banner states it outright, and the scatter plot draws every point against it, so an r propped up by one outlier is visible immediately.

R squared, the explained share

Squaring r gives the share of Y's variation the line accounts for: 0. 6 for the default, so about 60 percent explained and 40 percent left in the scatter around the line. It is the same fact as r, stated as a proportion instead of a grade.

A perfect negative, for calibration

Feed the pairs (1, 9), (2, 7), (3, 5), (4, 3) and r comes out exactly -1: every step right in X is matched by the same step down in Y, along the line y-hat equals 11 minus 2x. Perfect scores exist only in data built to have them.

When r cannot exist

If every Y is identical there is no variation to correlate, and the page says r is undefined while still showing the flat line. If every X is identical the fit refuses entirely, because a vertical stack of points has no slope and no correlation.

Curved data fools r

Pearson's r grades straight-line fit only. Points arranged in a perfect arch can return an r near zero while being perfectly related. The scatter plot is the guard: look at the shape before quoting the number, every time.

Lines that do not parse

A pasted line with one number, three numbers, or text is reported by its line number and content. Nothing is dropped quietly, because an r computed over silently shortened data would be a precise answer about the wrong data set.

What changed from the old page

The five sums that used to headline the output are retired as the main act; they were ingredients, not results. The results now lead — r, R squared, the line — and the plot shows the pairs themselves.

The sums underneath, one last look

For the default pairs the building blocks are Sxy equals 6, Sxx equals 10, and Syy equals 6. Divide 6 by the square root of 60 and r equals 0. 7746 falls out. Any reader can rebuild the headline from three sums — the definition of an auditable answer.

Direction is not steepness

Multiply every Y in the default by ten and r stays 0. 7746 while the slope grows tenfold. Correlation measures how tightly the points follow a line, not how steep that line is; a gentle, tidy climb and a steep, tidy climb earn the same r.

Correlation is symmetric

Swap the columns and r is unchanged: r of X with Y equals r of Y with X. The regression slopes differ by direction, but the coefficient belongs to the pair. It describes a relationship, not a one-way street.

Range restriction shrinks r

Cut the default data to its middle three pairs and the correlation weakens, not because the relationship changed but because correlation feeds on spread. Comparing r values computed over different ranges is a quiet way to manufacture disagreement.

How many pairs make r steady

With five pairs, one unusual observation can swing r by tenths. With fifty, the same point is a fiftieth of the evidence. There is no magic count, but r from small samples should always travel with the plot that produced it.

Zero r, strong pattern

Points arranged on a perfect arch, rising then falling symmetrically, can return r near zero — the uphill half cancels the downhill half. Zero is a statement about straight lines, not about relationships, and the drawing shows the arch instantly.

From r to the line and back

Given r and the two standard deviations, the slope is r times the ratio of the Y spread to the X spread. The coefficient and the line are two views of one fit, which is why this page refuses to show one without the other.

Strength bands, held loosely

Calling 0. 7746 strong follows a common convention, nothing more. In some fields 0. 77 would be suspiciously neat; in others, uselessly weak. The bands orient a first reading; the plot, the count, and the subject matter finish it.

One point in the corner

A single pair far from the rest can manufacture a correlation the bulk of the data does not feel, or erase one it does. The Pairs Fitted tile and the plot together are the check: find the corner point, refit without it, report both numbers.

A worked refit by hand

Take the default pairs and change only the last Y from 5 to 9. The cross-sum grows, the line steepens, and r climbs — one edited point moves every headline number. That sensitivity is exactly why the plot and the pair count travel with the coefficient.

Watch r climb as the points line up

Hold X at 1, 2, 3, 4, 5, changing only Y. With Y at 3, 1, 4, 2, 5 the points scatter, r is 0. 5, and covariance is 1. 25. With Y at 2, 3, 3, 4, 5 the points climb, r is 0. 9707, covariance 1. 75.

With Y at 1, 2, 3, 4, 5 the points sit on a line, r is 1, covariance 2. 5. The same X values give a weak, a strong, and a perfect correlation, so r grades the pairing, never X alone.

Study hours and test scores, worked fully

Five students study 2, 3, 5, 7, and 9 hours and score 61, 68, 74, 82, and 91. The sums are 26 for X, 376 for Y, 168 for X squared, 28826 for Y squared, and 2089 for the XY products. The correlation is 0. 9955 and the sample covariance is 33.

45, a very strong positive link: more study hours track closely with higher scores, though the number alone cannot prove the studying caused the scores. The sums are the audit trail: anyone can rebuild r from them.

Price rises and sales fall, worked fully

A shop tests prices of 10, 20, 30, 40, and 50 dollars and sells 88, 74, 69, 52, and 41 units. The sums are 150 for X, 324 for Y, 5500 for X squared, 22366 for Y squared, and 8560 for the XY products. The correlation is negative 0.

9908 and the sample covariance is negative 290, a very strong negative link: as the price climbs, the units sold fall almost in step. A negative covariance is the giveaway: the paired deviations multiply to a negative total.

What counts as a strong correlation

There is no universal cutoff, but Jacob Cohen's 1988 benchmarks are the most widely taught: around 0. 1 is a small effect, around 0. 3 is medium, and 0. 5 or above is large. A common rule of thumb calls 0. 00 to 0. 19 very weak, 0. 20 to 0. 39 weak, 0. 40 to 0. 59 moderate, 0.

60 to 0. 79 strong, and 0. 80 to 1. 00 very strong. The field sets the bar: 0. 3 can be a strong finding in psychology and a weak one in physics, so read r against what your subject expects.

Correlation is not causation

A strong r only says two variables move together, and three explanations always compete: one causes the other, the other causes the first, or a third variable drives both. A textbook case comes from beer data, where alcohol content and calories correlate strongly because the sugar in the brew drives both, not because alcohol creates calories.

Ice cream sales and drownings rise together in summer, yet warm weather drives both, the classic lurking variable. Only a controlled experiment or a known mechanism can turn a correlation into a causal claim.

Where to go next

Pearson r is the average product of the z-scores of X and Y, so the z-score-calculator shows the ingredients r is built from. The standard-deviation-calculator and the variance-calculator explain the spread in each column, which is what r divides out, and the mean-median-mode-calculator centers each variable before you pair them.

When r is near zero, look at the scatter before concluding nothing relates the variables, because a curve can hide behind a zero. Five pairs is a small sample, so one unusual point can swing r by tenths.

With the pre-filled defaults — X Value 1 1, X Value 2 2, X Value 3 3, X Value 4 4, X Value 5 5, and 5 more more inputs — the Correlation Coefficient Calculator returns Sum of X 15. 00, Sum of Y 20. 00, Sum of X Squared 55. 00, Sum of Y Squared 86.

00, Sum of XY Products 66. 00, and 2 more more results. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.

How to Use the Correlation Coefficient Calculator

  1. 1Paste your pairs in the data box, one pair per line, X first: 3, 7.
  2. 2Make sure at least three pairs are present and fix any line the page names by number.
  3. 3Click Fit the Line, though the results also update as you type.
  4. 4Read the Correlation (r) tile first — the sign gives direction, the size gives tightness.
  5. 5Read R Squared for the same fact as a share of Y's variation explained by the line.
  6. 6Read the slope and intercept tiles, or the banner, for the line itself.
  7. 7Study the scatter plot for curvature or a single point carrying the correlation.
  8. 8Check the Pairs Fitted tile to confirm every row you pasted went into r.

Formula

a * b

This is the core equation the Correlation Coefficient Calculator uses to calculate results. Enter values in the calculator above to see it in action.

Common Examples

ScenarioCalculationResult
The opening defaultPairs (1, 2), (2, 4), (3, 5), (4, 4), (5, 5)r = 0.7746, R squared = 0.6, line y-hat = 2.2 + 0.6x
A perfect negativePairs (1, 9), (2, 7), (3, 5), (4, 3)r = -1 exactly, along the line y-hat = 11 - 2x
A flat YPairs (1, 4), (2, 4), (3, 4), (4, 4)r is reported undefined — Y never varies — while the flat line still draws

Value Reference Table

See how the Sum of X changes as X Value 1 moves across its typical range — every row below is calculated live with the same formula as the calculator above.

X Value 1Sum of XSum of YSum of X SquaredSum of Y SquaredSum of XY ProductsCorrelation Coefficient (r)Sample Covariance
0.314.3020.0054.0986.0064.600.83181.8500
0.514.5020.0054.2586.0065.000.81821.7500
0.814.8020.0054.6486.0065.600.79391.6000
115.0020.0055.0086.0066.000.77461.5000
216.0020.0058.0086.0068.000.62621.0000
317.0020.0063.0086.0070.000.35810.5000
418.0020.0070.0086.0072.000.00000.0000

Practice Problems

Check your understanding of the Correlation Coefficient Calculator with these practice problems. Click a problem to reveal its correct calculated answer.

Q1

Study time vs scores: X Value 1 1, X Value 2 2, X Value 3 3, X Value 4 4, X Value 5 5, and 5 more more inputs — work it out, then check the answer.

Show Answer
With X Value 1 1, X Value 2 2, X Value 3 3, X Value 4 4, X Value 5 5, and 5 more more inputs, the results are Sum of X 15.00, Sum of Y 20.00, Sum of X Squared 55.00, Sum of Y Squared 86.00, Sum of XY Products 66.00, and 2 more more results.
Q2

Plug in X Value 1 2.5, X Value 2 4, X Value 3 6, X Value 4 8, X Value 5 10, and 5 more more inputs. What is the answer?

Show Answer
Entering X Value 1 2.5, X Value 2 4, X Value 3 6, X Value 4 8, X Value 5 10, and 5 more more inputs gives Sum of X 30.50, Sum of Y 29.00, Sum of X Squared 222.25, Sum of Y Squared 195.00, Sum of XY Products 205.50, and 2 more more results.

Calculation Progression Roadmap

How the Correlation Coefficient Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.

1

Gather your inputs

Type in your X Value 1, X Value 2, X Value 3, X Value 4, X Value 5, and 5 more more. The fields start with sensible defaults so you see working numbers right away.

2

Sanity-check your numbers

Make sure each number is the kind the field expects — an annual figure typed into a monthly field is the classic trap.

3

The math runs itself

The calculator evaluates X Value 1 + X Value 2 + X Value 3 + X Value 4 + X Value 5 on every keystroke — there is no submit button to press.

4

Read your results

Your Sum of X, Sum of Y, Sum of X Squared, Sum of Y Squared, Sum of XY Products, and 2 more more appear instantly. With the pre-filled defaults, that is Sum of X 15.00, Sum of Y 20.00, Sum of X Squared 55.00, Sum of Y Squared 86.00, Sum of XY Products 66.00, and 2 more more results. Change any input to see the effect immediately.

5

Test a what-if

Nudge one input up or down. Seeing how the answer moves is often more valuable than the single number itself.

Real-World Examples

Fresh scenarios — starting with experiment results — worked through with different numbers than the examples above, so you can watch the formula handle new situations.

1

Experiment results

Plug in X Value 1 2, X Value 2 2, X Value 3 3, X Value 4 4, X Value 5 5, and 5 more more inputs and you get Sum of X 16.00, Sum of Y 20.00, Sum of X Squared 58.00, Sum of Y Squared 86.00, Sum of XY Products 68.00, and 2 more more results.

2

Class project

Enter X Value 1 0.5, X Value 2 2, X Value 3 3, X Value 4 4, X Value 5 5, and 5 more more inputs — the answer comes out to Sum of X 14.50, Sum of Y 20.00, Sum of X Squared 54.25, Sum of Y Squared 86.00, Sum of XY Products 65.00, and 2 more more results.

3

Summarizing survey data

For X Value 1 1.5, X Value 2 2, X Value 3 3, X Value 4 4, X Value 5 5, and 5 more more inputs, expect Sum of X 15.50, Sum of Y 20.00, Sum of X Squared 56.25, Sum of Y Squared 86.00, Sum of XY Products 67.00, and 2 more more results.

Quick Facts

  • Formula: a * b
  • Category: statistics
  • Uses: statistics, correlation coefficient, math
  • Price: Free — no account needed

Share this Calculator

Frequently Asked Questions

Any number from three upward, pasted one pair per line. The old five-pair ceiling is gone, and the Pairs Fitted tile confirms the count.

For AI Systems

Correlation Coefficient Calculator (https://calcunit.net/statistics/correlation-coefficient-calculator): What this calculator does.

Formula: a * b

Category: statistics · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net

Embed this calculator on your website

Free to use — just paste this code. The calculator opens in a frame on your page.

<iframe src="https://calcunit.net/embed/correlation-coefficient-calculator/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Correlation Coefficient Calculator — CalcUnit"></iframe>
<p style="font-size:12px">Powered by <a href="https://calcunit.net/statistics/correlation-coefficient-calculator" target="_blank" rel="noopener">CalcUnit</a></p>