Skip to content
Tezmy Tools

Correlation Coefficient Calculator

Pearson r, Spearman rho, r squared and the best-fit line

For example hours studied.

The matching results, in the same order.

Pearson correlation (r)

0.99622931

A very strong positive relationship

R squared (r²)
0.99247283
Spearman rank correlation
1
Covariance (sample)
15.8
Best-fit line
y = 4.5142857x + 46.866667
Pairs
6
Mean of X and Y
3.5 and 62.666667

Correlation measures how closely two lists move together. It does not show that one causes the other.

Runs in your browser. Nothing is uploaded.

About the Correlation Coefficient Calculator

A correlation coefficient measures how closely two sets of numbers move together. A value of +1 means that when one rises the other rises in perfect step, −1 means they move in perfect opposition and 0 means no straight-line link. This calculator takes two lists of the same length, such as hours studied and exam scores, and gives Pearson's r, which measures straight-line relationships, Spearman's rank correlation, which measures any steadily rising or falling relationship, the coefficient of determination r squared, the sample covariance and the equation of the best-fit line. A plain-language label tells you if the link is weak, moderate or strong.

Updated October 2026

How to use the Correlation Coefficient Calculator

  1. 1Enter your X values, one per data point.
  2. 2Enter the matching Y values in the same order.
  3. 3Read Pearson's r and the strength label.
  4. 4Check r squared, Spearman's rank correlation and covariance.
  5. 5Use the best-fit line to predict Y from X.

How to read r

  • 0.9 to 1.0 (or −0.9 to −1.0): very strong.
  • 0.7 to 0.9: strong.
  • 0.4 to 0.7: moderate.
  • 0.2 to 0.4: weak.
  • Below 0.2: very weak or none.

Worked example

Six students study 1 to 6 hours and score 52, 55, 61, 64, 70 and 74. The correlation is about 0.99, an almost perfect upward line. The best-fit line says each extra hour of study goes with roughly 4.5 more marks, starting from about 46.9. Treat predictions inside the data range with more confidence than predictions far beyond it.

If you are not sure which coefficient to quote, report Pearson's r for data that follow a straight line and Spearman's for rankings, ordinal scores or data with outliers and curves. In a report, give the number of pairs with the coefficient, because r means little without it. A correlation of 0.6 from 8 points is far less convincing than 0.6 from 800 points. For a formal test of whether the correlation could be due to chance, you will need a p-value, which the P-Value Calculator on this site can help with.

Prepare your data with care before pasting it. Both lists must have the same number of values in the same order, so that the first X goes with the first Y. Delete incomplete rows from both lists, not just from one. If one value is missing from a column of a spreadsheet, copy the two columns after filtering so that blanks are removed in both. Mixed units, such as centimetres in one row and metres in another, can quietly spoil the result, so check before you calculate.

Cautions

Plot your data before trusting r. Outliers can create or hide a correlation, and curved relationships can give r near zero even though the link is strong. Pearson's r assumes roughly linear data without extreme values. Combining groups can also mislead, a trap known as Simpson's paradox, so check subgroups when you can.

Related tools

The Linear Regression Calculator gives a full regression line, the Standard Deviation Calculator and Variance Calculator describe spread, the Z-Score Calculator standardises values and the Chart Maker draws scatter plots from your numbers.

Features

  • Pearson and Spearman correlation
  • R squared and covariance
  • Best-fit line equation
  • Strength label in plain words
  • Handles tied values in ranks
  • Checks that the lists match

Frequently asked questions

What does a correlation coefficient tell me?

How strongly and in which direction two variables are linearly related. Close to +1 or −1 is strong, near 0 is weak. It tells you nothing about cause and effect.

What is the difference between Pearson and Spearman?

Pearson measures straight-line relationships using the actual values. Spearman works on ranks, so it detects any consistently rising or falling pattern, even curved, and is less affected by outliers.

What is r squared?

The share of the variation in Y explained by a straight-line relationship with X. If r is 0.9, r squared is 0.81, so 81 percent of the variation is accounted for by the line.

How many data points do I need?

At least three for the calculation, but many more for a trustworthy result. With few points, a high correlation can arise by chance. Twenty or more points are a better base for conclusions.

Does correlation mean causation?

No. Ice cream sales and sunburn are correlated because both rise in hot weather. A third factor, or pure chance, can create a link. Establishing causation needs controlled experiments or careful analysis.

Why do I get an error about variation?

If all the values in one list are identical, there is nothing to correlate, as the line would be flat. Check your data for a typing error or a constant column.

Related tools