STATISTICS CALCULATOR

Correlation Coefficient Calculator

Calculate Pearson's correlation coefficient from summary statistics, with r squared and the regression slope.

Reviewed by the Calculator.nu math team
Updated August 2026
Pearson's r
0.99722
r squared
0.99446
Regression slope
2.07879

The formula

r = (nΣxy − ΣxΣy) ÷ √((nΣx² − (Σx)²)(nΣy² − (Σy)²))
# r ranges from −1 to +1

How to calculate correlation

Pearson's correlation coefficient measures the strength and direction of a straight-line relationship between two variables. It runs from −1, a perfect inverse relationship, through 0, no linear relationship, to +1.

The computational formula above works from six summary figures, which is how correlation is calculated in practice — no need to keep the raw pairs once the sums are known.

Here is what each field means:

  • Number of pairs
  • Sum of x
  • Sum of y
  • Sum of x × y
  • Sum of x²
  • Sum of y²

Results appear immediately — there is nothing to submit. Changing a field rewrites the link, so you can share the exact scenario you are looking at.

Units matter more here than the arithmetic itself: the formula assumes a specific set of units for each input, stated next to the field, and converting into those units first is usually the difference between a correct result and one that is wrong by a clean power of ten.

Why correlation matters

This kind of calculation comes up in coursework, in a laboratory or field setting, and in professional practice, and the arithmetic is identical in every case — only the numbers being fed into it, and what is riding on getting them right, actually change.

Beyond a single check, the same calculation is worth rerunning whenever a measured input changes — a new reading, a corrected value, an updated assumption — since the result here always reflects exactly what is currently in the fields above rather than a value calculated once and then left stale.

This calculation sits in a long tradition of being done first by hand with tables and slide rules, then with a scientific calculator, and now with a page like this one — the underlying mathematics has not changed at any point in that history, only the speed and convenience of getting from the inputs to the answer. Understanding the formula itself, shown above, is still worth doing even when a tool computes it instantly, since it is what makes the result trustworthy rather than just fast.

Where a calculation like this one is part of a larger piece of work, it is generally worth running it with a round, easy-to-check set of numbers first — inputs of exactly 1, 10 or 100 — purely to confirm the formula is being applied correctly, before switching to the real measured values the actual result depends on.

Worked example

Work through the defaults on this page:

  • Number of pairs: 10
  • Sum of x: 55
  • Sum of y: 125
  • Sum of x × y: 859
  • Sum of x²: 385
  • Sum of y²: 1,921

That gives:

  • Pearson's r: 0.99722
  • r squared: 0.99446
  • Regression slope: 2.07879

The figures above are the calculator's own default values, shown purely so the working is visible rather than hidden — the same steps apply exactly to your own numbers, entered in the fields at the top of this page.

Reading the result

Rough conventions: below 0.3 weak, 0.3 to 0.7 moderate, above 0.7 strong. Those thresholds vary sharply by field — 0.4 is a strong result in psychology and a poor one in physics.

Where this goes wrong. Correlation only detects linear relationships. A perfect parabola can produce r near zero, and a single outlier can create or destroy an apparent correlation. Plot the data before trusting the coefficient.

A result that is wrong by an exact factor of ten, a hundred or a similar round number is almost always a units error rather than a mistake in the formula itself — checking each input against the unit stated beside it is the fastest way to track it down.

No. A correlation is consistent with x causing y, y causing x, both being driven by something else, or coincidence. Only design — randomisation or a natural experiment — separates those.

Pearson measures linear association on the raw values. Spearman does the same on the ranks, which makes it robust to outliers and able to detect any consistently increasing relationship, not just a straight one.

It returns pearson's r. With 10 number of pairs, 55 sum of x and 125 sum of y, that comes to 0.99722. Change any field and the figure moves with it.

Generally, no more than the least precise input justifies — a result reported to six decimal places from inputs measured to two significant figures is implying a precision the calculation does not actually have. The calculator shows full precision so you can round appropriately for your own use.

Yes — the equation shown in the formula section above is the standard form used in textbooks and reference material for this calculation, not a simplified or approximate version.

Yes, in the sense that it applies the correct standard formula and returns an accurate result for the inputs given — but check your own course or publication's requirements for how results should be rounded, presented and referenced, since those conventions vary and are not something a calculator can know on your behalf.

Was this calculator helpful?

Tap a star to rate it. Your feedback helps us improve the tools people rely on most.