Correlation Coefficient Calculator

The Correlation Coefficient Calculator helps you measure the strength and direction of the relationship between two sets of data. Enter your X and Y values to calculate Pearson’s correlation coefficient instantly, view the result, and understand what it means with a step-by-step breakdown.

Correlation Coefficient Calculator

Enter two sets of paired data to calculate Pearson’s correlation coefficient.

Enter the first dataset, separating values with commas, semicolons, or line breaks.
Enter the corresponding Y values in the same order. Both datasets must contain the same number of values.
Try an example

Calculation Result

Correlation Coefficient (r) 0.7746
Paired observations 5
Relationship Strong positive

Interpretation

Strong positive correlation. As X increases, Y tends to increase. The coefficient describes a linear relationship, not proof of causation.

Pearson’s Formula

r = Σ[(x − x̄)(y − ȳ)] / √[Σ(x − x̄)² × Σ(y − ȳ)²]
Here, x̄ and ȳ are the means of the X and Y datasets.

Calculation Details

Mean of X = 3
Mean of Y = 4
Sum of cross-deviations = 7
Sum of squared X deviations = 10
Sum of squared Y deviations = 6

Paired Data Breakdown

No. X Y X − x̄ Y − ȳ
112-2-2
224-10
33501
44410
55521

Pearson’s r ranges from −1 to +1. A value near either endpoint indicates a stronger linear relationship; a value near zero indicates a weaker linear relationship. Correlation does not establish causation.

What Is a Correlation Coefficient?

A correlation coefficient measures how two variables are related. It helps you understand whether two sets of values tend to increase together, move in opposite directions, or show little to no linear relationship.

Pearson’s correlation coefficient, represented by r, ranges from -1 to +1. A value close to +1 indicates a strong positive relationship, a value close to -1 indicates a strong negative relationship, and a value near 0 indicates little or no linear correlation.

Correlation Coefficient Formula

The correlation coefficient formula helps you find out how strongly two sets of data are related and whether they move in the same or opposite directions. Pearson’s correlation coefficient, represented by r, is commonly used to measure this relationship.

The formula is:

\displaystyle r=\frac{n\sum xy-(\sum x)(\sum y)} {\sqrt{[n\sum x^2-(\sum x)^2][n\sum y^2-(\sum y)^2]}}

Where:

  • r = Correlation coefficient
  • x and y = Values from the two datasets
  • n = Number of paired observations
  • Σxy = Sum of the products of corresponding X and Y values
  • Σx and Σy = Sum of all X values and all Y values
  • Σx² and Σy² = Sum of the squared X and Y values

The result always falls between -1 and +1. A value close to +1 indicates a strong positive relationship, a value close to -1 indicates a strong negative relationship, and a value near 0 suggests little or no linear relationship.

How to Calculate the Correlation Coefficient

Let's understand how to calculate the correlation coefficient using a small dataset. Suppose we want to check whether study time is related to exam scores for five students.

StudentStudy Hours (X)Exam Score (Y)X²Y²XY
112142
2244168
33592515
444161616
555252525
Total1520558666

Now, use the totals in the formula:

  • n=5
  • \sum x=15
  • \sum y=20
  • \sum x^2=55
  • \sum y^2=86
  • \sum xy=66

Substitute these values into the formula:

\displaystyle r=\frac{5(66)-(15)(20)}{\sqrt{[5(55)-15^2][5(86)-20^2]}}
\displaystyle r=\frac{330-300}{\sqrt{(275-225)(430-400)}}
\displaystyle r=\frac{30}{\sqrt{50\times30}}
\displaystyle r=\frac{30}{\sqrt{1500}}\approx 0.775

Result: The correlation coefficient is approximately 0.775, indicating a strong positive correlation.

This indicates a strong positive correlation between study hours and exam scores in this example. In general, students who studied more tended to score higher, although correlation alone does not prove that additional study time caused the higher scores.

How to Use the Correlation Coefficient Calculator

  1. Enter your X values in the first input box.
  2. Enter the corresponding Y values in the second box, keeping each pair in the same order.
  3. Make sure both datasets contain the same number of values.
  4. View the correlation coefficient and its interpretation.
  5. Check the calculation details to understand how the result was obtained.

You can also use the example buttons to explore different types of correlation.

How Is the Correlation Coefficient Calculated?

The calculator uses Pearson’s correlation formula to compare how each value differs from its dataset’s mean.

The formula considers the deviations of X and Y from their respective averages and measures how those deviations vary together. The result is a number between -1 and +1.

For example, if X values increase and Y values also increase in a consistent pattern, the coefficient will be positive. If one tends to increase while the other decreases, the coefficient will be negative.

Understanding Your Result

Here is a simple guide to interpreting Pearson’s correlation coefficient:

  • +1: Perfect positive linear correlation.
  • Near +1: Strong positive linear relationship.
  • Near 0: Weak or no linear relationship.
  • Near -1: Strong negative linear relationship.
  • -1: Perfect negative linear correlation.

These descriptions are general guidelines. What counts as a weak or strong correlation can depend on the subject and the data being studied.

Related Math Tools

Scroll to Top