Scatter Plot Maker with Line of Best Fit

Plot X and Y pairs, add a least-squares line of best fit and see its equation and R².

Chart type

Data

First column: X values. Each other column is a set of Y values. You can paste a block of cells copied from Excel or Google Sheets into any box.

Options

Your data and settings stay in this browser.

Make a scatter plot to see whether two measurements are related. Put the X values in the first column and the Y values beside them, one pair per row, or paste two columns from a spreadsheet. Add more Y columns to plot several sets of points in different shades against the same X values. Both axes are true number scales, so uneven gaps between X values are shown as they are. Tick Line of best fit to draw the least-squares straight line through each set of points, with its equation (y = mx + b) and R², the share of the variation in Y that the line explains: close to 1 is a strong straight-line relationship, close to 0 is none. The equation also appears under the chart so you can copy it. Untick Start the axis at zero to zoom in on the points. Add a title and axis labels, choose a palette and size, and download a PNG or SVG. Your data stays in this browser. A strong fit shows the two go together, not that one causes the other. To look at how one list of numbers is spread, try the Histogram Maker or Box Plot Maker.

Common use cases

  • Science and statistics homework with a line of best fit
  • Checking whether two measurements go together
  • Height against arm span, study time against scores
  • Spotting points that don't fit the pattern

How to use

  1. Put X values in the first column and Y values beside them
  2. Add more columns for more sets of points
  3. Tick Line of best fit to see the equation and R²
  4. Add labels and download the scatter plot

FAQ

How is the line of best fit worked out?

By least squares: the straight line that makes the sum of the squared vertical distances from the points to the line as small as possible. It's the same line as a linear trendline in Excel or LinReg on a graphing calculator.

What does R² mean?

R² (the coefficient of determination) runs from 0 to 1. It's the share of the variation in Y that the straight line accounts for. For a straight-line fit it's the square of the correlation coefficient r.

Does a good fit prove one thing causes the other?

No. Two measurements can move together because a third thing drives both, or by chance. A scatter plot shows the pattern; working out the cause needs more evidence.

Why was a row left out?

Every point needs a number in the X column and in its Y column. Rows without both are skipped, and a note under the chart says how many.