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².
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
- Put X values in the first column and Y values beside them
- Add more columns for more sets of points
- Tick Line of best fit to see the equation and R²
- 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.
Related tools
- Graph Maker: Free Online Chart MakerFree graph maker: type or paste your data and make a bar, line, pie or scatter chart, histogram or box plot…
- Line Graph Maker: Make a Line Chart OnlineFree line graph maker: plot one or more series over time, choose straight or smooth lines, shade the area…
- Box Plot Maker: Box and Whisker PlotFree box plot maker: paste numbers for one or more groups and get box and whisker plots with quartiles, the…
- Pie Chart Maker: Make a Pie Chart OnlineFree pie chart maker: enter categories and values, see the percentages worked out, switch to a donut chart…
- Bar Graph Maker: Free Bar Chart CreatorFree bar graph maker: type or paste data, compare several series side by side or stacked, turn bars sideways…
- Histogram Maker: Free Online HistogramFree histogram maker: paste a list of numbers, let it choose the bins or set the bin width and start, see the…
- Graphing Calculator: Plot Functions OnlineIn Calculators
- Standard Deviation CalculatorIn Calculators