Skip to main content
statistics

Correlation Coefficient Calculator

Calculate Pearson's correlation coefficient (r) from summary statistics to measure the strength and direction of the linear relationship between two variables. Values range from -1 to +1.

Reviewed by Christopher FloiedPublished Updated

This free online correlation coefficient calculator provides instant results with no signup required. All calculations run directly in your browser — your data is never sent to a server. Enter your values below and see results update in real time as you type. Perfect for everyday calculations, homework, or professional use.

Minimum: 2

Results

Pearson's r

1.237437

How to Use This Calculator

1

Enter your input values

Fill in all required input fields for the Correlation Coefficient Calculator. Most fields include unit selectors so you can work in your preferred unit system — metric or imperial, whichever matches your problem.

2

Review your inputs

Double-check that all values are correct and that you have selected the right units for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.

3

Read the results

The Correlation Coefficient Calculator instantly computes the output and displays results with units clearly labeled. All calculations happen in your browser — no loading time and no data sent to a server.

4

Explore parameter sensitivity

Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.

When to Use This Calculator

  • Use the Correlation Coefficient Calculator when you need accurate results quickly without the risk of manual computation errors or unit conversion mistakes.
  • Use it to verify calculations made by hand or in spreadsheets — an independent check can catch errors before they lead to costly decisions.
  • Use it to explore how changing input parameters affects the output — a quick way to develop intuition and identify the most influential variables.
  • Use it when collaborating with others to ensure everyone is working from the same numbers and applying the same assumptions.

About Correlation Coefficient Calculator

The correlation coefficient calculator computes Pearson's r, which measures the strength and direction of the linear relationship between two variables. A value of +1 indicates a perfect positive linear relationship, -1 indicates a perfect negative linear relationship, and 0 indicates no linear relationship. Correlation is used in virtually every field: economics (GDP and unemployment), medicine (dosage and response), education (study hours and grades), psychology (test scores), and engineering (stress and strain). It is important to remember that correlation does not imply causation. Two variables can be highly correlated due to a confounding variable or pure coincidence.

The Math Behind It

Pearson's correlation coefficient r is defined as the covariance of X and Y divided by the product of their standard deviations: r = Cov(X,Y)/(s_X * s_Y). The computational formula using sums is r = (n*sum(xy) - sum(x)*sum(y)) / sqrt((n*sum(x^2) - (sum(x))^2) * (n*sum(y^2) - (sum(y))^2)). The square of r, called R-squared or the coefficient of determination, represents the proportion of variance in Y explained by the linear relationship with X. For example, r = 0.8 means R^2 = 0.64, so 64% of the variance in Y is explained by X. The significance of r can be tested using the t-statistic: t = r*sqrt(n-2)/sqrt(1-r^2) with (n-2) degrees of freedom. Pearson's r only measures linear relationships; variables can have strong nonlinear relationships with r near zero. Spearman's rank correlation and Kendall's tau are alternatives that capture monotonic relationships. Outliers can have a dramatic effect on r, so always visualize your data with a scatterplot before interpreting the correlation.

Formula Reference

Pearson Correlation Coefficient

r = (n*sum(xy) - sum(x)*sum(y)) / sqrt((n*sum(x^2) - (sum(x))^2) * (n*sum(y^2) - (sum(y))^2))

Variables: n = number of pairs; sum(xy) = sum of products; sum(x), sum(y) = sums of variables

Worked Examples

Example 1: Study hours vs. exam score

For 5 students: n=5, sum(x)=25, sum(y)=375, sum(xy)=2050, sum(x^2)=145, sum(y^2)=29125.

Step 1:Numerator = 5*2050 - 25*375 = 10250 - 9375 = 875.
Step 2:Denom part 1 = 5*145 - 625 = 100.
Step 3:Denom part 2 = 5*29125 - 140625 = 5000.
Step 4:r = 875 / sqrt(100 * 5000) = 875 / 707.1 = 0.9877.

r = 0.99, indicating a very strong positive linear relationship between study hours and exam scores.

Example 2: Temperature vs. ice cream sales

For 8 days: n=8, sum(x)=200, sum(y)=800, sum(xy)=21000, sum(x^2)=5200, sum(y^2)=84000.

Step 1:Numerator = 8*21000 - 200*800 = 168000 - 160000 = 8000.
Step 2:Denom = sqrt((8*5200 - 40000)*(8*84000 - 640000)) = sqrt(1600 * 32000) = 7155.4.
Step 3:r = 8000 / 7155.4 = 0.938.

r = 0.94, indicating a strong positive correlation between temperature and ice cream sales.

Common Mistakes & Tips

  • !Concluding causation from correlation. A high r does not prove that X causes Y.
  • !Using Pearson's r for nonlinear relationships; it only measures linear association.
  • !Ignoring outliers that can artificially inflate or deflate the correlation coefficient.

Related Concepts

Used in These Calculators

Calculators that build on or apply the concepts from this page:

Frequently Asked Questions

What is a strong correlation?

As a rough guide: |r| > 0.7 is considered strong, 0.4-0.7 moderate, and < 0.4 weak. However, the interpretation depends heavily on the field and context.

Can Pearson's r detect nonlinear relationships?

No. Pearson's r only measures linear association. A perfect quadratic relationship (like y = x^2) can yield r close to 0. Always plot your data.

What is the difference between correlation and covariance?

Covariance measures the direction of the linear relationship but is scale-dependent. Correlation normalizes covariance by the standard deviations, producing a dimensionless number between -1 and 1.