Correlation coefficient calculator

Pearson correlation for two series, together with the regression line.

Inputs

Correlation coefficient calculator

2 fields

Use the format shown in the field description.

Use the format shown in the field description.

Results are reference estimates. Verify the inputs before making important decisions.

Fill in the fields and the result will appear here automatically.

Computes the Pearson correlation coefficient for two series and derives the least-squares line along with it. The coefficient measures only the strength and sign of a LINEAR relationship: for a parabolic dependence it can come out near zero even though the relationship is exact. Series of different lengths are rejected rather than truncated — pairs are formed by position, and silently dropping a tail would compute the correlation of the wrong data. If every value in one series is identical the coefficient has no meaning, and the calculation says so instead of reporting zero.

FAQ
5 questions
Freshness
formula-based

How it works

Formula and logic

Deviations from the mean are computed for each series. The coefficient is the sum of the products of deviations divided by the root of the product of their squared sums. The slope is that same sum of products divided by the squared sum for X. The intercept is ȳ − b·x̄. In least squares with an intercept, r² is the fraction of Y variation described by this linear fit, not evidence of causation. r and r² are dimensionless; covariance has units X×Y, slope Y/X and intercept Y. This product accepts 3–10000 pairs and at most 1000000 characters per series; two distinct pairs can also mathematically define correlation. No significance test or p-value is calculated. Use consistent units within each series; X and Y may have different units.

Example

Series 1, 2, 3, 4, 5 against 2, 4, 5, 4, 5 give a coefficient of 0.7746 and a line of slope 0.6.

Fields and units

  • Series X: values separated by spaces or line breaks — data unit
  • Series Y: the same number of values — data unit

How to use

  • — Enter the first series: spaces, semicolons, newlines or a comma followed by whitespace separate numbers; a comma without whitespace is decimal.
  • — Paste the second series — it must hold the same number of values.
  • — Read the coefficient: it lies between −1 and 1.
  • — The slope and intercept define the line that best fits the data.

Method and limitations

Calculation method
Formula and logic
Limitation
A relationship may be explained by a third factor or by coincidence. The coefficient measures how two series move together, not whether one drives the other.

FAQ

What does a coefficient of 0.77 mean?

A marked positive linear relationship: as one series rises the other tends to rise too. One would mean an exact straight line, minus one an exact inverse.

Does correlation prove causation?

No. A relationship may be explained by a third factor or by coincidence. The coefficient measures how two series move together, not whether one drives the other.

Why are series of different lengths rejected?

Because pairs are formed by position. Truncating the longer series would compute the correlation of the wrong data without saying so.

What if every value in a series is identical?

The coefficient cannot be computed: the denominator becomes zero. Reporting zero would claim «no relationship» where the question itself makes no sense.

How do I enter decimal values?

With a comma, as in «1,5 2,5». A comma only separates values when followed by a space, so the fractional part is not lost.