Correlation Calculator
Calculate the Pearson correlation coefficient between two data sets.
Last updated · View algorithm, constants and default inputs (JSON)
Results
About this calculator
Enter the same number of numeric values in both lists. Correlation is undefined when either list has fewer than two values or no variation. It describes association, not causation.
Worked example
calculated with the default values below
X values (comma separated) 1, 2, 3, 4, 5 · Y values (comma separated) 2, 4, 5, 4, 5 Correlation coefficient (r) 0.7746 · R squared 0.6000 · Covariance 1.5000 · Mean of X 3.0000 · Mean of Y 4.0000 · Pairs 5
General background references
Disclaimer
These calculators give general mathematical results. They suit study, planning and estimation — verify anything that feeds a graded submission, a published figure or a financial commitment.
Implementation source
This record describes the implementation used by this page. It is not independent validation. External references, when available, support only the stated formula or definition; estimates and custom rules retain their own assumptions.
Formula and variables
r = Σ(x − x̄)(y − ȳ) ÷ √(Σ(x − x̄)² × Σ(y − ȳ)²)
- x,y
- paired sample values
- x̄,ȳ
- sample means
- n
- number of pairs
- r
- Pearson correlation
Pearson r uses paired finite numeric observations and is undefined when either list is constant. Inputs must have equal length (at least two); empty comma-separated fields are rejected rather than silently skipped.
Frequently asked questions
What makes the correlation undefined?
Both lists must contain the same number of at least two numeric pairs, with variation in each list. Blank entries, mismatched counts, nonnumeric values, or a constant list are rejected. Pearson correlation describes linear association; it does not establish causation.