Scatter Plot Calculator — Correlation & Linear Regression
Enter your X and Y values to visualise a scatter plot, measure the strength and direction of the linear relationship with Pearson r, and fit a least-squares regression line.
Pearson correlation: −1 = perfect negative, 0 = none, +1 = perfect positive
- 1
Mean X
x̄ = Σx ÷ 7 = 4 - 2
Mean Y
ȳ = Σy ÷ 7 = 5 - 3
Cross-deviations Σ(x−x̄)(y−ȳ)
27Sum of products of each point's deviation from its mean. - 4
√(Sxx × Syy)
√(28 × 28) = 28Denominator: geometric mean of the X and Y variance sums. - 5
Pearson r
27 ÷ 28 = 0.9643
How does this calculator work?
Enter X and Y lists to plot a scatter chart and compute Pearson r = Σ(x−x̄)(y−ȳ)/√(SxxSyy). R² reports variance explained (0–1). The least-squares line y = bx + a has slope b = Sxy/Sxx and intercept a = ȳ − b·x̄. Values near |r| = 1 indicate a strong linear relationship.
Formula
How this is calculated
Enter your X values and matching Y values as comma- or space-separated lists of the same length (minimum 2 points). Each X is paired with the Y at the same position to form an (x, y) data point on the scatter plot.
The Pearson correlation coefficient r measures the strength and direction of the linear relationship. It is computed as the sum of cross-deviation products Σ(x−x̄)(y−ȳ) divided by the geometric mean of the X and Y variances. r = +1 is a perfect positive linear relationship, r = −1 is perfect negative, and r = 0 indicates no linear pattern. R² = r² reports the fraction of Y-variance explained by the fitted line.
The least-squares regression line y = bx + a has slope b = Σ(x−x̄)(y−ȳ) / Σ(x−x̄)² and intercept a = ȳ − b·x̄. The line always passes through the mean point (x̄, ȳ). Note that r and the regression line describe only linear relationships; a curved association may have r ≈ 0 even if the data are strongly related. Outliers can heavily influence r — always inspect the scatter plot alongside the number.
Frequently asked questions
Pearson r quantifies the strength and direction of the linear relationship between two variables. Values above +0.8 or below −0.8 are considered strong; values near 0 are weak. r does not imply causation, only correlation.
r (correlation) ranges from −1 to +1 and shows both strength and direction. R² = r² ranges from 0 to 1 and gives the proportion of Y-variance explained by the linear model — it discards direction information.
At least two valid, matching (x, y) pairs are required. If all X values are identical (zero X-variance) the slope and r are undefined. Also check that both lists have the same number of numeric entries.
Also known as
TG we-Calculate Editorial Team. (2026). Scatter Plot Calculator — Correlation & Linear Regression [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/scatter-plot-calculator
TG we-Calculate Editorial Team. "Scatter Plot Calculator — Correlation & Linear Regression." TG we-Calculate. 2026. https://we-calculate.com/calculator/scatter-plot-calculator.
TG we-Calculate Editorial Team, "Scatter Plot Calculator — Correlation & Linear Regression," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/scatter-plot-calculator
@misc{wecalculate_scatter_plot_calculator, title = {Scatter Plot Calculator — Correlation & Linear Regression}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/scatter-plot-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
