Correlation and Regression Calculator

Fit a straight line to paired numbers and inspect Pearson correlation, predictions and residuals.

On-device No sign-up Free to use

Calculate result controls

Showing an example. Edit to see your own.

?

One comma-separated numeric pair per line; no header. Blank lines are ignored. At most 1,000 pairs and 100,000 characters; plain decimals with magnitude at most 10^12.

Processed in your browser. Your inputs stay on this device.

Result

Showing an example.

Fit the three pairs (1, 3), (2, 5) and (3, 7), which lie on y = 2x + 1.

Fitted 3 pairs: slope 2, intercept 1.
Answer: Slope 2; intercept 1

https://usefreetools.net/correlation-regression-calculator · 20 November 2026

Was this helpful?

How to use Correlation and Regression Calculator

  1. Enter one comma-separated x,y pair per line, with no header. Keep each response paired with its predictor; blank lines are ignored.
  2. Calculate the fit, then read slope, intercept, Pearson r, R² and residual sum of squares. Constant x is refused; constant y gives a constant fit with undefined r and R².
  3. Inspect the scatter and residuals for curvature or influential observations. An unusual point needs investigation rather than automatic deletion.
  4. Download regression-residuals.csv for all pairs or regression-plot.svg for the chart. The on-screen residual table shows only the first 50 pairs.

Example: Correlation and Regression Calculator

Fit the three pairs (1, 3), (2, 5) and (3, 7), which lie on y = 2x + 1.

You add
x,y pairs: 1,3 2,5 3,7
You get
Fitted 3 pairs: slope 2, intercept 1. Answer: Slope 2; intercept 1

Options

Paired observations
Enter one x,y pair per line without a header. Keep each response beside the predictor value from the same observation.
Residual output
A residual is observed y minus fitted y. The preview shows a subset; the CSV contains all entered pairs.

Supported inputs and limits

  • Enter 2 to 1,000 pairs and at most 100,000 characters.
  • Values are plain decimals of magnitude at most 10¹², with up to 25 digits and 12 fractional places.
  • The model is ordinary least squares with an intercept and one predictor.
  • Working arithmetic uses 80-digit decimal precision; displayed values and graph coordinates are rounded.
  • The residual CSV includes every pair.
More details

There is no significance test, causal inference, multivariable model or guarantee of reliable prediction outside the observed x range.

Where your input is processed

This tool does not upload your inputs. See the limits for anything saved on your device.

A straight fit can hide a pattern

Inspect the residuals and the original observations rather than relying on correlation alone. Curvature or influential observations can make a straight line a poor description. Constant x cannot define a unique slope, and predictions outside the entered x range require an additional assumption.

Questions about Correlation and Regression Calculator

Why inspect residuals?

A residual is observed y minus fitted y. Patterns can show that a straight line misses important structure.

Does r=1 prove the model will predict new data?

No. It describes the supplied pairs. New conditions and values outside the observed range can behave differently.

Why is constant y correlation undefined?

Its variance is zero, so the correlation denominator is zero even though a constant fitted line exists.

Page updated · Project managed by Tony Hines · Report a problem with Correlation and Regression Calculator