Quick answer
Pearson's correlation is r = Sxy ÷ √(Sxx·Syy). For x = 1 to 5 and y = 2, 4, 5, 4, 5, r = 0.7746, r² = 0.6 and n = 5.
Enter equal-length lists of x and y values. The calculator returns r, r² and n. Use this correlation coefficient calculator to check your own figures.
Related tools: Least Squares Regression Calculator: Fit the least-squares regression line to paired data and read off the slope, intercept and a prediction. Covariance Calculator: Sample and population covariance. Linear Regression Calculator: Least-squares line y = a + bx through paired data.
How to use the Correlation Coefficient Calculator
- Type x values, for example 1, 2, 3, 4, 5.
- Type y values, for example 2, 4, 5, 4, 5.
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| x values | Text, such as 1, 2, 3, 4, 5 | — |
| y values | Text, such as 2, 4, 5, 4, 5 | — |
Formula and method
Formula
r = Sxy ÷ √(Sxx·Syy)
IEEE-754 double precision; shown to at most 6 decimal places.
Pearson product-moment correlation; undefined for constant data.
Worked examples
These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: x values = 1,2,3,4,5; y values = 2,4,5,4,5.
| Result | Value |
|---|---|
| Correlation r | 0.774597 |
| r² | 0.6 |
| n | 5 |
Example 2
Inputs: x values = 1 2 3; y values = 3 2 1.
| Result | Value |
|---|---|
| Correlation r | -1 |
| r² | 1 |
| n | 3 |
The first line is the headline result (correlation r). Below it the correlation Coefficient Calculator lists r² and n, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.
Interpretation
r runs from −1 to 1. 0.77 is a strong positive linear relationship, and r² = 0.6 means 60% of the variance in y is explained by x. Correlation does not imply causation.
Cautions
With only 5 points, r is unreliable; test its significance. Outliers can distort r, and it measures only linear relationships. Both lists need variation.
Reading r
For x = 1 to 5 and y = 2, 4, 5, 4, 5, r ≈ 0.7746 and r² = 0.6. That is a fairly strong positive linear relationship, but with only 5 points it is not statistically significant at the 5% level (the critical value for |r| is about 0.878).
r measures only linear association, from −1 to 1, and is sensitive to outliers. A value near 0 does not rule out a curved relationship, and correlation does not show cause.
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- y values: entering "5,5,5" shows "Correlation is undefined when a variable does not vary." beside that field and no result.
Choosing between the Correlation Coefficient Calculator and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [Least Squares Regression Calculator](/statistics/least-squares-regression/) | x values and y values | Regression line |
| [Covariance Calculator](/statistics/covariance-calculator/) | x values and y values | Sample covariance |
| [Linear Regression Calculator](/statistics/linear-regression-calculator/) | x values and y values | Regression line |
| [R-Squared Calculator](/statistics/r-squared-calculator/) | x values and y values | R² |
| [Coefficient of Variation Calculator](/statistics/coefficient-of-variation-calculator/) | data set and data type | Coefficient of variation |
Background: regression and correlation
Least squares chooses the line that minimises the sum of the squared vertical distances from the points. The slope is the sum of the cross-products of the deviations divided by the sum of the squared x deviations, and the intercept is the mean of y minus the slope times the mean of x.
For simple regression R² is the square of the correlation coefficient r, the share of the variation in y that the line explains. R² has no sign, so the sign of the slope tells you whether the relationship rises or falls. A strong fit does not prove one variable causes the other.
Assumptions and limitations
- Equal-length lists with variation
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for y values to confirm this.
Frequently asked questions
What does r = 0 mean?
No linear relationship.
Is 0.77 significant for n = 5?
Not at 5% (it needs about 0.88).
What's the difference from covariance?
Correlation is standardised.
Does r = 0 mean there is no relationship?
No. It means no linear relationship; a curved pattern can still exist.
Does a high correlation show that x causes y?
No. Correlation measures association only; other factors or chance can create it.
What does the Correlation Coefficient Calculator calculate?
Pearson correlation of two variables. It returns Correlation r, r² and n.
What formula does the Correlation Coefficient Calculator use?
r = Sxy ÷ √(Sxx·Syy). Pearson product-moment correlation; undefined for constant data.
What do I need to enter in the correlation Coefficient Calculator?
You enter x values and y values.
How is the result rounded or limited?
IEEE-754 double precision; shown to at most 6 decimal places. Equal-length lists with variation.
What is an example of a correlation Coefficient result?
With x values 1,2,3,4,5 and y values 2,4,5,4,5, the correlation r is 0.774597.
Related calculators
- Least Squares Regression Calculator — Fit the least-squares regression line to paired data and read off the slope, intercept and a prediction.
- Covariance Calculator — Sample and population covariance.
- Linear Regression Calculator — Least-squares line y = a + bx through paired data.
- R-Squared Calculator — Coefficient of determination for a simple linear fit.
- Coefficient of Variation Calculator — Standard deviation relative to the mean.
- Multiple Linear Regression Calculator — Least-squares coefficients and R² for up to three predictors.
Sources
- OpenStax, Introductory Statistics 2e (Rice University): measures of center and spread, correlation and regression
- NIST/SEMATECH e-Handbook of Statistical Methods (nist.gov), Exploratory Data Analysis chapter
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.