Correlation Calculator

Calculate the Pearson correlation coefficient (r) between two data sets. See r squared, strength interpretation, and means.

Data Input

Separate numbers with spaces or new lines. Use a dot for decimals (1.5). X and Y must have the same count.

Results

Enter two equal-length lists of numbers and click Calculate.

How Does the Formula Work?

The correlation calculator measures how strongly two variables are linearly related. Enter paired data, for example hours studied (X) and exam scores (Y), and it returns the Pearson correlation coefficient r, the coefficient of determination r², the number of pairs, and both means. This tool computes the Pearson product-moment correlation coefficient, the standard measure of linear association used in science, economics, and health research. Results are validated against known reference values.

r = Σ((xi - x̄)(yi - ȳ)) / √(Σ(xi - x̄)² × Σ(yi - ȳ)²)
r² = r × r
Range: -1 ≤ r ≤ +1
Example: X = [1, 2, 3, 4, 5], Y = [2, 4, 6, 8, 10] → r = 1 (perfect positive)

Reading the r Value

The coefficient r always falls between -1 and +1. At +1 the points lie exactly on a rising straight line, at -1 exactly on a falling line, and at 0 there is no linear relationship at all. The sign tells you the direction: positive means the variables increase together, negative means one decreases as the other increases. The magnitude tells you the strength. A common guideline: |r| of 0.9 or more is very strong, 0.7 to 0.9 strong, 0.5 to 0.7 moderate, 0.3 to 0.5 weak, and below 0.3 very weak or negligible. These thresholds are conventions, not laws; what counts as strong depends on the field. In physics r = 0.7 may be disappointing, while in psychology it may be remarkable.

What r² Tells You

Squaring r gives the coefficient of determination, the proportion of variance in one variable that is explained by its linear relationship with the other. If study time and exam scores correlate at r = 0.8, then r² = 0.64: 64% of the variation in scores is associated with study time, and the remaining 36% comes from other factors. r² is always between 0 and 1 and is the same whether the correlation is positive or negative, which makes it useful for comparing the explanatory power of different relationships.

Where Correlation Is Used

Correlation analysis appears everywhere paired data exists. Economists relate income to spending, epidemiologists relate smoking to disease rates, agronomists relate fertilizer to yield, and finance analysts relate two stocks to build diversified portfolios (assets with low or negative correlation reduce risk). In quality control, correlating a cheap measurement with an expensive one can justify replacing it. In machine learning, correlation screening helps select informative features before model building.

Limitations You Must Know

Pearson r only detects linear relationships. A perfect U-shaped curve can produce r near 0 even though the variables are tightly related, so always plot your data. Outliers are the second trap: a single extreme pair can inflate or destroy a correlation, so inspect unusual points before trusting the number. Third, correlation says nothing about cause and effect. Two variables can move together because one drives the other, because a third variable drives both, or by pure coincidence. Finally, r computed from a small sample is unstable; with only a handful of pairs, a large |r| can easily arise by chance.

Methodology

This tool computes the Pearson product-moment correlation coefficient using the mean-centered formula, which stays numerically accurate even for large values. The result is kept within the mathematical bounds of -1 and +1, and correlation is reported as undefined when either variable has zero variance, when the lists have different lengths, or when fewer than two pairs are provided. Each release is tested against known reference values.

Tips & Recommendations

Not Causation

Correlation is NOT causation. A high r shows co-movement, never proof that one variable causes the other.

Outliers Distort r

One extreme data pair can flip a weak correlation into a strong one. Inspect unusual points first.

Linear Only

Pearson r can be near 0 for a strong curved relationship. r ≈ 0 does not mean no relationship.

Input Format

Separate values with spaces or new lines, use a dot for decimals. Paste columns from Excel directly.

Frequently Asked Questions

What is correlation?

Correlation measures how strongly two variables move together. The Pearson coefficient r ranges from -1 (perfect negative) through 0 (no linear relationship) to +1 (perfect positive).

What does the r value mean?

The sign shows direction: positive r means both variables rise together, negative r means one falls as the other rises. The size shows strength: |r| above 0.9 is very strong, 0.7 to 0.9 strong, 0.5 to 0.7 moderate, 0.3 to 0.5 weak, below 0.3 very weak or none.

What is r squared?

r squared (the coefficient of determination) is the share of variance in one variable explained by the other. With r = 0.8, r squared = 0.64, so 64% of the variation is explained by the linear relationship.

Does correlation mean causation?

No. A high r only shows the two variables move together. Ice cream sales and drownings correlate because both rise in summer; neither causes the other. Establishing causation requires controlled experiments, not correlation alone.

When is Pearson correlation not appropriate?

Pearson r only captures linear relationships. It can be near 0 for a strong curved (nonlinear) relationship, and outliers can distort it heavily. For ranked or nonlinear monotonic data, Spearman rank correlation is a better fit.

Recent Calculations

No calculations yet

Last updated: July 2, 2026 Reviewed by: MathGyro Editorial Team