CalculateItNow home

Correlation Coefficient Calculator

Pearson's r, r-squared, covariance and the line of best fit for up to 10 (x, y) pairs, with the deviation table and a plain reading of how strong the link is.

Correlation Coefficient Calculator: with the default inputs, pearson's r is 0.996174.

Try an example
Pearson's r
0.996174

Between −1 and +1. The sign is the direction, the size is the strength.

r² (coefficient of determination)
0.992363
Sample covariance
26.857143
Slope of the best-fit line
4.47619
Intercept of the best-fit line
46.857143
Strength
Very strong positive
Assumptions
  • Pearson's r measures linear association only; curved relationships are understated.
  • Covariance uses the sample divisor n − 1, matching Excel's COVARIANCE.S.
  • The best-fit line is ordinary least squares with y regressed on x; swapping the roles gives a different line (but the same r).
Your points against the best-fit line
05012345678x
Observed yBest fit
Deviation table
xyx − x̄y − ȳ(x − x̄)(y − ȳ)
152-3.5-1552.5
255-2.5-1230
361-1.5-69
464-0.5-31.5
5700.531.5
6721.557.5
7792.51230
8833.51656

Those products sum to 188. When x and y move together the products are mostly positive; when they move oppositely, mostly negative.

Math verified by automated testsUpdated 2026-09-092 sources cited

How this is worked out

The formula

Pearson's r = Σ(x − x̄)(y − ȳ) ÷ √( Σ(x − x̄)² × Σ(y − ȳ)² )

Sample covariance = Σ(x − x̄)(y − ȳ) ÷ (n − 1)
Best-fit slope    = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)²
Best-fit intercept = ȳ − slope × x̄
r² = r × r

Open How it’s calculated above to see this worked through with your own numbers.

What you enter

How many pairs?
Only the first N (x, y) boxes are used. Pairs 6–10 live under More options.from 2 to 10 · whole numbers only · defaults to 8
x1
A number.defaults to 1
y1
A number.defaults to 52
x2
A number.defaults to 2
y2
A number.defaults to 55
x3
A number.defaults to 3
y3
A number.defaults to 61
x4
A number.defaults to 4
y4
A number.defaults to 64
x5
A number.defaults to 5
y5
A number.defaults to 70
x6(under More options)
A number.defaults to 6
y6(under More options)
A number.defaults to 72
x7(under More options)
A number.defaults to 7
y7(under More options)
A number.defaults to 79
x8(under More options)
A number.defaults to 8
y8(under More options)
A number.defaults to 83
x9(under More options)
A number.defaults to 9
y9(under More options)
A number.defaults to 88
x10(under More options)
A number.defaults to 10
y10(under More options)
A number.defaults to 91

What you get back

Pearson's rmain answer
Between −1 and +1. The sign is the direction, the size is the strength.
r² (coefficient of determination)
The share of the variation in y that the straight line accounts for.
Sample covariance
Slope of the best-fit line
Intercept of the best-fit line
Strength

What this assumes

  • Pearson's r measures linear association only; curved relationships are understated.
  • Covariance uses the sample divisor n − 1, matching Excel's COVARIANCE.S.
  • The best-fit line is ordinary least squares with y regressed on x; swapping the roles gives a different line (but the same r).

About this calculator

Pearson's correlation coefficient measures how tightly two variables move together in a straight line. It runs from −1 (perfectly opposed) through 0 (no linear relationship) to +1 (perfectly aligned), and it is scale-free: converting inches to centimetres or dollars to euros does not change it.

How to use it

Set the number of pairs, type your x and y values, and read r. Pairs 6–10 are under More options. The deviation table shows exactly where the number comes from — each point's distance from the two means, multiplied together. Points in the upper-right and lower-left quadrants contribute positive products; the other two quadrants contribute negative ones. Correlation is essentially the balance of those two piles, normalised so it can never leave [−1, 1].

How to read the results

  • r is direction and strength. The usual verbal bands (Evans, 1996) are: below 0.2 very weak, 0.2–0.4 weak, 0.4–0.6 moderate, 0.6–0.8 strong, above 0.8 very strong. They are conventions, and what counts as "strong" differs wildly between physics and psychology.
  • is the share of the variation in y explained by the straight-line relationship with x. An r of 0.7 sounds impressive until you notice r² = 0.49 — the line accounts for under half the variation.
  • Covariance is the same idea in the original units. It is the raw ingredient of r, and unbounded, which is why r is easier to interpret.
  • Slope and intercept define the least-squares line through the points, the same line the regression calculator reports in more detail.

Where it misleads

Correlation is not causation — the point deserves its cliché status, because the usual culprit is a lurking third variable that drives both.

Less famous but more dangerous in practice:

  • r only sees straight lines. A perfect parabola, y = x² over a symmetric range, has r = 0. Always look at the chart before trusting the number.
  • Outliers dominate. One stray point can drag r from 0.1 to 0.8, or the reverse. This is why the calculator warns you below five pairs.
  • Range restriction shrinks r. Correlating SAT score with college GPA using only admitted students understates the relationship, because the low scores were filtered out.
  • Aggregated data inflates r. Correlations computed on state or country averages are almost always far stronger than the same correlation at the individual level.

If your relationship is monotone but curved, Spearman's rank correlation is the better tool; it correlates the ranks instead of the values.

Frequently asked questions

What counts as a strong correlation?

By the usual convention, |r| above 0.8 is very strong, 0.6–0.8 strong, 0.4–0.6 moderate. Context matters more than the label: 0.3 is a big effect in psychology and a broken instrument in physics.

What is the difference between r and r²?

r measures direction and strength on a −1 to +1 scale; r² is the fraction of the variation in y explained by the line, always between 0 and 1. An r of 0.5 means the line explains only 25% of the variation.

Can correlation prove causation?

No. A correlation is consistent with x causing y, y causing x, both being driven by something else, or coincidence. Only an experiment or a careful causal design can separate those.

Why is my correlation zero when the data clearly has a pattern?

Pearson's r only detects straight-line relationships. A U-shaped or curved pattern can have r near zero. Plot the points, and consider Spearman's rank correlation for monotone curves.

How many data points do I need?

Statistically, more than you think — with n = 5 the 95% confidence interval around r is enormous. Thirty pairs is a reasonable minimum for taking r seriously; below ten, treat it as descriptive only.

Put this calculator on your own site

A working correlation, free for any site, with no ads and no sign-up. It resizes to fit wherever you paste it and updates itself as this page improves.

Paste this anywhere. It works on any site, carries no ads, never expires, and always shows the current version.

Correlation Coefficient Calculator by CalculateItNow

The page's own title. The clearest description of what the link leads to.

The credit line sits outside the widget on purpose, so it is a real link on your page rather than one buried in a frame. Please keep it — it is what pays for CalculateItNow staying free and ad-free. The script only resizes the widget to fit its contents; drop it and the widget still works.

Browse every calculator widget·How to add it to WordPress, Squarespace or Wix

The questions people ask next to a correlation.

All math calculators·Browse everything