Pearson Correlation

Calculate Pearson correlation coefficient between two paired data series with interactive scatter plot, regression line, covariance, R-squared, and comprehensive statistics.

Calculate Pearson correlation

About This Calculator

This Pearson correlation calculator computes the Pearson correlation coefficient (r) between two paired numerical data sets. Enter X and Y values as comma-separated lists of equal length to instantly get r, R-squared, covariance, means, standard deviations, regression line equation, and an interactive scatter plot with regression line. Pearson correlation is widely used in statistics, research, psychology, economics, finance, and data science to quantify the strength and direction of linear relationships between variables.

How the Pearson correlation is calculated

The Pearson correlation coefficient (r) is calculated using the formula: r = Cov(X,Y) / (Sx · Sy), where Cov(X,Y) is the sample covariance of X and Y, and Sx and Sy are their sample standard deviations. The value always falls between -1 and +1. A value of +1 indicates a perfect positive linear relationship, -1 a perfect negative linear relationship, and 0 indicates no linear relationship. The R-squared (r²) value shown represents the proportion of shared variance between the two variables. For example, r = 0.8 means r² = 0.64, so 64% of the variance in one variable can be predicted from the other.

How to interpret the results

The scatter plot visualizes each paired observation as a point, with the regression line showing the best-fit linear trend. A tight cluster around the line indicates a strong correlation. The equation of the regression line (y = mx + b) lets you predict Y from X. Check the covariance sign to confirm the direction: positive means both variables move together, negative means they move in opposite directions. The means and standard deviations help characterize each variable's central tendency and spread. For best results, always visualize your data alongside the correlation coefficient to detect non-linear patterns that r might miss.

Frequently Asked Questions

What is the Pearson correlation coefficient?

The Pearson correlation coefficient (r) measures the strength and direction of a linear relationship between two continuous variables. It ranges from -1 to +1, where -1 indicates a perfect negative linear relationship, +1 a perfect positive linear relationship, and 0 indicates no linear relationship.

How is Pearson r calculated?

Pearson r is calculated as the covariance of the two variables divided by the product of their standard deviations. The formula is r = Cov(X,Y) / (Sx * Sy), where Cov is covariance and Sx, Sy are sample standard deviations.

What does R-squared mean in this context?

R-squared (r^2) is the square of the Pearson correlation coefficient. It represents the proportion of variance in one variable that can be predicted from the other. For example, r = 0.8 means r^2 = 0.64, so 64% of the variance is shared between the two variables.

How do I enter paired data?

Enter X and Y values as comma-separated lists with equal counts. For example: X: 1,2,3,4,5 and Y: 2,4,5,4,5. Each position corresponds to one data pair (x=1, y=2), (x=2, y=4), etc.

What are the assumptions of Pearson correlation?

Pearson correlation assumes: (1) a linear relationship between variables, (2) both variables are approximately normally distributed, (3) there are no significant outliers, and (4) the data is measured on an interval or ratio scale. Violations of these assumptions may require Spearman correlation instead.

What is the difference between Pearson and Spearman correlation?

Pearson correlation measures linear relationships, while Spearman correlation measures monotonic relationships (any consistent trend, not necessarily linear). Spearman uses ranked data and is less sensitive to outliers. Use Pearson when the relationship is linear and data is normally distributed; use Spearman for ordinal data or non-linear monotonic relationships.

How many data points do I need for Pearson correlation?

You need at least 3 paired data points to compute Pearson correlation, but for meaningful results 10 or more pairs are recommended. More data points give more reliable estimates and greater statistical power to detect real relationships.

Can Pearson correlation be used for non-linear relationships?

No — Pearson correlation only measures linear relationships. Two variables can have a perfect non-linear relationship (e.g., quadratic, exponential) yet have a Pearson r close to zero. Always visualize your data with a scatter plot alongside the correlation coefficient.