Correlation Analysis

Correlation Coefficient Calculator

Use this calculator to find the correlation coefficient between two quantitative variables. Get Pearson’s correlation coefficient, r, t statistic, p-value, r critical value, and a clear step-by-step solution.

Enter paired observations in the same order. Both variables must contain the same number of values.
The significance test is two-tailed: H₁: ρ ≠ 0.

Scatter Plot

The fitted line helps visualize the direction of the linear relationship. Correlation does not establish causation.

Step-by-Step Solution

How to Use the Correlation Coefficient Calculator

This correlation coefficient calculator finds Pearson’s r from two sets of paired quantitative data. It also tests whether the observed correlation is statistically significant.

To use the calculator:

  1. Enter the X and Y values in the calculator input fields. You can either enter values manually and separate them using commas, spaces, tabs, or line breaks, or paste values directly from Excel, Google Sheets, or text documents.
  2. Enter the significance level (α) as a decimal
  3. Click Calculate

The calculator will instantly compute Pearson’s correlation coefficient and determine whether the relationship is statistically significant. Thus, it will return the Correlation Coefficient (r), t-test statistic, p-value, and r critical value. It will also return a clear, step-by-step solution, showing you exactly how to calculate the correlation coefficient and how to determine whether the relationship is statistically significant.

What Is a Correlation Coefficient?

A correlation coefficient is a statistical measure of the strength and direction of the linear relationship between two variables. This calculator computes Pearson’s correlation coefficient, r, which measures the strength and direction of a linear relationship between two quantitative variables. If the variables are not quantitative, you should consider using the Spearman’s correlation coefficient calculator.

The correlation coefficient value (r) lies between -1 and +1, with positive values indicating that the two variables move together and negative values indicating that the two variables move in the opposite direction. A correlation coefficient value of zero (r = 0), indicates that there is no relationship between the two variables.

The table below provides a quick summary of how to interpret correlation coefficient values.

Value of rInterpretation
r = +1Perfect positive linear correlation
r is close to +1Strong positive linear correlation
r is close to 0Weak or no linear correlation
r is close to −1Strong negative linear correlation
r = −1Perfect negative linear correlation

As you can see from the above table, the sign of a correlation coefficient value shows the direction of the correlation, while the absolute value shows its strength.

Note. The correlation coefficient is a measure of association and not causation. As such, a strong correlation value does not prove that changes in one variable directly cause changes in the other but rather indicates that the variables move together or in opposite directions.

Correlation Coefficient Formula

The correlation coefficient formula is:

Correlation Coefficient Formula

Where:

  • r is the correlation coefficient
  • n is the number of paired observations.
  • Σx is the sum of the X values.
  • Σy is the sum of the Y values.
  • Σx² is the sum of the squared X values.
  • Σy² is the sum of the squared Y values.
  • Σxy is the sum of the products of each paired X and Y value.

Sometimes, the correlation coefficient formula can be expressed using covariance and standard deviations. The formula becomes:

correlation coefficient formula using covariance and variances

Where:

  • r is the correlation coefficient
  • Cov (x, y) is the covariance between x and y
  • Sx is the sample standard deviation of x
  • Sy is the sample standard deviation of y

How to Calculate the Correlation Coefficient by Hand

To calculate the correlation coefficient manually, you can use either the standard formula or the covariance-variance formula defined above. Both methods will yield similar results. While the first method is often quicker when working with raw data, the second method works best when you already have summary statistics data such as covariance between x and y and the standard deviation/variance of x and y.

To calculate the correlation (r) using the standard correlation coefficient formula, follow these steps:

  1. Calculate x², y², and xy for each pair.
  2. Find n, Σx, Σy, Σx², Σy², and Σxy.
  3. Substitute the totals into the Pearson correlation formula and solve

However, if you prefer the covariance-standard deviations formula, follow these steps:

  1. Find the sample covariance between X and Y.
  2. Find the sample standard deviation of X and Y.
  3. Divide the Covariance between X and Y by the product of the standard deviations.

To help you learn how to compute the correlation coefficient (r) using both methods, we will use the following example.

Example 1.

A researcher records the number of hours eight students study and their corresponding quiz scores.

StudentStudy Hours, XQuiz Score, Y
112
224
335
444
555
667
778
889

Calculate Pearson’s correlation coefficient between study hours and quiz scores and interpret the result.

Method 1: Using the Standard Correlation Coefficient Formula

To find the correlation coefficient value using the standard formula, follow these steps:

Step 1: Calculate x², y², and xy for each pair

The table below shows how to calculate x², y², and xy for each pair

Studentxyxy
1121² = 12² = 41 × 2 = 2
2242² = 44² = 162 × 4 = 8
3353² = 95² = 253 × 5 = 15
4444² = 164² = 164 × 4 = 16
5555² = 255² = 255 × 5 = 25
6676² = 367² = 496 × 7 = 42
7787² = 498² = 647 × 8 = 56
8898² = 649² = 818 × 9 = 72
TotalΣx = 36Σy = 44Σx² = 204Σy² = 280Σxy = 236

Step 2. Find n, Σx, Σy, Σx², Σy², and Σxy

From the table, we can see that:

  • Number of pairs, n = 8
  • Σx = 36
  • Σy = 44
  • Σx² = 204
  • Σy² = 280
  • Σxy = 236

Step 3: Substitute the Values Into the Formula

By definition, the standard Pearson’s correlation formula is:

r = ​n∑xy−(∑x)(∑y)​/√{[n∑x2−(∑x)2][n∑y2−(∑y)2]}

Substituting the values into the formula gives:

r = ​8(236)−(36)(44)​/√{[8(204)−362][8(280)−442]}

= 304/√336(304)

=304/319.5997

Thus, r = 0.9512

A Pearson’s correlation coefficient value of 0.9512 indicates that there is a strong positive linear relationship between study hours and quiz scores. This positive nature of the correlation between these variables indicates that quiz scores tend to increase with an increase in study hours and vice versa.

Method 2: Using Covariance and Standard Deviations

To calculate the correlation coefficient using the covariance and variances, follow these steps:

Step 1. Find the sample covariance between X and Y.

You can quickly find the covariance between X and Y using the covariance calculator and following these steps:

  1. Select the sample option
  2. Copy and paste the values: 1, 2, 3, 4, 5, 6, 7, 8 into the X values field
  3. Copy and paste the values: 2, 4, 5, 4, 5, 7, 8, 9 into the Y values field
  4. Click calculate

The calculator will instantly return the covariance between X and Y as: sxy = 5.4286

Step 2. Find the sample standard deviation or variance of X and Y

You can quickly find the sample standard deviation of X and Y using the standard deviation calculator and following these steps:

  1. Select the Sample Option
  2. Copy-paste the values of X (1, 2, 3, 4, 5, 6, 7, 8) into the input field and click calculate. This returns: s = 2.44949
  3. Copy-paste the values of Y (2, 4, 5, 4, 5, 7, 8, 9) into the input field and click calculate. This returns: s = 2.329929

Step 3. Divide the Covariance between X and Y by the product of the standard deviations.

Therefore, the correlation coefficient, r = Sxy/sx*sy

= 5.4286/(2.44949*2.329929)

= 0.9512

Alternatively, instead of calculating the sample standard deviations, you can calculate the sample variances of X and Y using the variance calculator and use the following formula instead.

Correlation coefficient, r = Sxy/√(sx2*sy2)

As you can see, both the standard formula and the covariance-standard deviation formula yield the same results.

How to Perform Correlation Test By Hand

Pearson’s correlation coefficient (r) tells us the direction and strength of the relationship in the sample. However, it does not tell us whether the observed correlation provides sufficient evidence of a linear relationship in the population.

To determine whether the linear relationship is statistically significant, we need to perform a hypothesis test to find the t-statistic, p-value, and r critical value. To help you learn how to perform a hypothesis test for the correlation coefficient, we’ll use the results from Example 1.

From Example 1, we know that:

  • Pearson correlation coefficient, r = 0.9512
  • Number of paired observations, n = 8

Now, we can perform a two-tailed hypothesis test to determine whether the correlation was statistically significant at the 5% significance level by following these steps.

Step 1: State the Hypotheses

The population correlation coefficient is represented by ρ. Therefore, for a two-tailed correlation test, we need to test the hypotheses:

  • H₀: There is no linear relationship between study hours and quiz scores (i.e., ρ = 0)
  • H₁: There is a significant linear relationship between study hours and quiz scores (i.e., ρ ≠ 0)

Step 2: State the Significance Level

We wish to test the hypothesis at the 5% significance level. Thus, α = 0.05. This means we will reject the null hypothesis when the p-value is less than or equal to 0.05.

Step 3: Calculate the Test Statistic

The test statistic formula for Pearson’s correlation is:

test statistic formula for Pearson's correlation

Where:

  • n is the number of pairs
  • r is the Pearson’s correlation coefficient value

Substituting the values into the formula gives:

t = 0.9512 * √(8-2)/(1-0.95122)

= 0.9512 * √6/(0.09522)

=0.9512*7.9381

Thus, t =7.5507

Step 4: Find the P-Value and r Critical Value

We can test the correlation using either the p-value approach or the critical-value approach. To find the p-value for the test, use the p-value from r calculator and enter r = 0.9512 and n = 8. This gives: p-value = 0.00028. Alternatively, you can use the p-value calculator from t and enter t = 7.5507, df = 6 to get a similar result.

To find the critical value for the test, you can use the r critical value table, select two-tailed, and look up r0.05, df = 6. This gives ±0.7067. Alternatively, using the r critical value calculator, select a two-tailed test, enter α = 0.05, n = 8, and click calculate to get a similar result.

Tip. The degrees of freedom formula for Pearson’s correlation is: df = n-2, where n is the number of pairs. In this example, n = 8. Thus, df = 8-2 = 6.

Step 5: Make the Decision

  • P-Value Approach. Since the p-value (0.00028) is less than the 0.05 significance level, we reject the null hypothesis (H0)
  • Critical-Value Approach. Since the absolute correlation coefficient value (r = 0.9512) is greater than the absolute r critical value (0.7067), we reject the null hypothesis (H0)

Step 6: Write the Conclusion

At the 5% significance level, there is sufficient evidence to conclude that a statistically significant positive linear correlation exists between study hours and quiz scores, r(6) = 0.9512, p < .001.

The positive value of r means that students who studied for more hours generally earned higher quiz scores. However, this correlation alone does not prove that additional study time caused the higher scores.

How to Interpret the Strength of Pearson’s Correlation Coefficient, r

The calculator classifies the strength of the correlation coefficient using the absolute value of r. The table below provides a quick summary to help you determine the strength of a correlation coefficient value.

Absolute value of rInterpretation
0.00 to 0.19Very weak
0.20 to 0.39Weak
0.40 to 0.59Moderate
0.60 to 0.79Strong
0.80 to 1.00Very strong

Note. These ranges in the table above are practical guidelines rather than strict rules. The importance of a correlation depends on the subject area, sample size, measurement quality, and purpose of the analysis.

It is also worth noting that a correlation can be statistically significant without being practically important. Large samples can make relatively small correlations significant.

Frequently Asked Questions

What does this correlation coefficient calculator calculate?

It calculates Pearson’s correlation coefficient from two sets of paired quantitative data and performs a hypothesis test to determine whether the correlation coefficient is statistically significant. The calculator instantly returns the Pearson’s correlation coefficient, r, t statistic, two-tailed p-value, r critical value, scatter plot, and a complete step-by-step solution.

How should I enter the data?

Enter the values for the first variable in the X field and the corresponding values for the second variable in the Y field. You should separate values with commas, spaces, tabs, or new lines.

Can I paste data from a spreadsheet?

Yes. You can copy two columns separately from Excel or Google Sheets and paste each column into its corresponding field. The calculator recognizes spaces, tabs, commas, and new lines.

Can Pearson’s r be greater than 1?

No. Pearson’s r must be between −1 and +1. The calculator will never return a valid correlation outside this range.

What does r = 0 mean?

An r value of zero indicates no linear correlation. A nonlinear relationship may still exist, which is why you should also inspect the scatter plot.

Does a significant correlation mean one variable causes the other?

No. Statistical significance supports the existence of a linear association, but it does not establish a cause-and-effect relationship.

Cite

Choose APA, MLA, Chicago, or Harvard, then copy the citation.

Mburu, J.. (2026, August 1). Correlation Coefficient Calculator. StatCalc.net. Retrieved August 23, 2026, from https://statcalc.net/correlation-coefficient-calculator/

Joseph Mburu

About This Calculator

Prepared by Joseph Mburu · Updated on

Joseph is an applied statistician and data analyst with over 6 years of experience helping students, researchers, and professionals solve statistics and data analysis problems. He holds a degree in Applied Statistics and a Master’s degree in Data…

We aim to keep our calculators accurate, easy to use, and helpful for learning. Always check that your inputs match the assumptions of the method you are using.