Skip to content

Math

Correlation Coefficient Calculator

Paste your X values and Y values as comma-separated lists of equal length. The calculator returns Pearson's r, r squared, the sample size, and the mean of each variable. Pearson's r ranges from -1 to 1 and measures the strength of a straight-line relationship. It says nothing about cause and effect.

Updated 2026-11-12 Editorial estimate Calccc Editorial Team Free · No sign-up

Loading calculator…

What this calculator does

Pearson's correlation coefficient summarizes how closely two sets of numbers move together in a straight line. It is used in science, finance, quality control, and other paired-data settings. This calculator takes two equal-length lists and reports r, r squared, and the means, plus the sample size, because a correlation from a handful of points is less stable than one from a large sample.

How to use it

  1. Enter X values separated by commas, such as 1, 2, 3, 4, 5.
  2. Enter Y values in the same order and with the same count.
  3. Read r, r squared, n, and both means.

How it works

Pearson's r = Σ((x - x̄)(y - ȳ)) / √(Σ(x - x̄)² x Σ(y - ȳ)²). The numerator measures how the variables vary together; the denominator scales by their separate spreads. The result lies between -1 and 1. Squaring r gives r², the share of variance in one variable associated with the other in a linear model. The sample size n is the number of pairs.

Example calculations

Example 1: positive relationship

With x = 1, 2, 3, 4, 5 and y = 2, 4, 5, 4, 5, the means are 3 and 4. The deviations give r = 6 / √60, about 0.775, and r² = 0.60. The pairs rise together, but the fit is imperfect.

Example 2: perfect negative relationship

With x = 1, 2, 3, 4 and y = 10, 8, 6, 4, every increase in x comes with a drop of 2 in y. r = -1 and r² = 1, so the points fall exactly on a downward line.

Example 3: weak negative relationship

With x = 1, 2, 3 and y = 3, 1, 2, the means are 2 and 2. The result is r = -1 / √4 = -0.5, with r² = 0.25. Three points are too few to trust the sign.

What the result means

r describes the direction and tightness of a linear pattern: positive means both variables tend to rise together, negative means one tends to fall as the other rises, and values near zero mean little linear pattern. r² is often more intuitive: the fraction of variation explained by a linear fit. Both are sensitive to outliers and miss curved relationships that are strong but not linear. Correlation is not causation: a third factor, reverse causation, or plain coincidence can produce a high r. A small sample can also produce a large r by chance, so check n and the scatter plot before drawing conclusions.

Common mistakes

  • Reading r as proof that one variable causes the other.
  • Using lists of different lengths or mismatched order.
  • Including an outlier without checking its influence.
  • Assuming a high r means a linear, strong relationship everywhere.
  • Reporting r² as a percentage of causation.

Assumptions and limits

  • Both lists contain numeric values and the same number of entries.
  • Pairs are matched by position, so order matters.
  • The relationship of interest is linear.
  • Values are treated as a sample of paired observations.
  • No missing values are imputed.

Frequently asked questions

What is a good correlation coefficient?

There is no universal cutoff. Values near 1 or -1 are strong, values near zero are weak, but what is useful depends on the field.

What does r squared mean?

It is the share of variance in one variable explained by a linear fit with the other. An r² of 0.60 means 60% of the variation is accounted for.

Can r be greater than 1?

No. Pearson's r stays between -1 and 1. A result outside that range means the inputs or calculation are wrong.

Does correlation prove causation?

No. Two variables can move together because one causes the other, because a third factor drives both, or by chance.

What happens if the lists have different lengths?

The calculator needs equal counts to pair the values. Check for a missing entry or extra comma.

How many pairs do I need?

More is generally better. Very small samples can show a strong r by chance, so treat a handful of pairs as a hint, not a finding.

Sources

This calculator is an educational statistics tool. Pearson's r assumes a linear relationship and is sensitive to outliers and small samples. Correlation is not causation, so check results against the original data.

2026 update

How to use the professional output

This page is not just a formula box. The result is designed to be checked, compared, and taken away.

  • Professional worksheet. The result includes the inputs used, the method and scope, and a one-variable sensitivity check for finance calculators.
  • A/B scenarios. Save two input sets in the browser and compare the primary, secondary, and breakdown figures side by side.
  • Print / PDF and CSV. Print a branded worksheet, or export the year-by-year table when the calculator produces one.

The formulas and assumptions above still govern the number. The worksheet makes the estimate auditable; it does not make it a lender quote, tax return, or personalized advice.

Go deeper

Guides that explain the math

Correlation Coefficient: Strength, Direction, and Causation
Math

Correlation Coefficient: Strength, Direction, and Causation

How Pearson's r turns a scatterplot into one number, what r-squared adds, when Spearman is safer, and why a strong correlation still cannot prove causation.

8 min read

Calccc Editorial Team · Updated 2026-11-12

Prepared by Calccc Editorial Team as an educational estimate. This page is not a licensed professional review and is not financial, medical, legal, or tax advice.

Editorial estimate prepared by the Calccc Editorial Team; not a licensed professional review.