A scatter plot with a line in Excel is a chart that places one dot per x,y pair on a two-axis grid and adds either connecting segments between the points or a fitted trendline that summarizes the pattern. Excel ships three scatter-with-line variants in its Insert > Charts group — plain markers only, straight-line connectors, and smoothed-line connectors — plus an optional Linear, Exponential, or Polynomial trendline that you can layer on top of any scatter series. If your goal is to add a line that travels through the points in order, pick one of the scatter-with-lines chart subtypes; if you want a fitted line that summarizes the relationship, right-click any series and choose Add Trendline. Excel also lets you display the trendline equation and the R-squared value directly on the chart, which is useful when readers want to see the fit quality without opening a separate statistics window. Once the chart exists, you can move it off the worksheet, export it as a picture, or embed it in a slide deck without recomputing anything.

Excel handles this end to end, but it doesn't always give you a portable, vector-clean version of the result. A browser-based scatter plot generator fills that gap for a quick visual check or a standalone SVG export. Below is a complete Excel walkthrough for adding a line, followed by a focused look at the Scatter Plot Maker for previewing and exporting your points as a clean SVG — and an honest note on what the browser tool does and doesn't do.

how to make scatter plot with line in excel
How to Make a Scatter Plot With a Line in Excel

What "With a Line" Usually Means in Excel

Two different things get called a "line" on a scatter plot, and they answer different questions. A connecting line joins each pair of points in the order they appear in the spreadsheet, which is useful when the x axis is a sequence such as time, sample number, or step. A trendline is a statistical line — typically linear, exponential, or polynomial — that summarizes the relationship across all points and is useful when you want to communicate direction or rate of change without drawing every segment.

Excel's Insert > Charts > Scatter group exposes this choice directly. The chart subtype you pick controls whether Excel draws segments or smooth curves between consecutive points. The trendline is a separate object you add on top of any scatter series, regardless of subtype. Knowing which one you actually need saves you from picking the wrong chart and then trying to fix the result afterwards.

Add a Line to a Scatter Plot in Excel

Use this sequence the next time you open Excel and want points plus a line on the same chart. The steps work in Excel 2016, 2019, 2021, and Microsoft 365.

  1. Place your data in two adjacent columns with the x values on the left and the y values on the right, including a header row for each.
  2. Select both columns including the headers, then choose Insert > Charts > Scatter. Pick the subtype that matches your goal: Scatter (markers only), Scatter with Smooth Lines, or Scatter with Straight Lines and Markers.
  3. Right-click any point on the new chart and choose Select Data. Confirm that the X Values and Y Values ranges point at the correct columns; if Excel swapped them, edit the entry and re-pick the source range.
  4. Add axis titles by selecting the chart and choosing Chart Design > Add Chart Element > Axis Titles. Type a label for the horizontal axis and the vertical axis.
  5. For a trendline, right-click any data series and choose Add Trendline. In the Format Trendline pane, choose Linear, Exponential, or Polynomial, then check Display Equation on Chart and Display R-squared Value on Chart if you want the fit quantified.
  6. Right-click the trendline and choose Format Trendline > Line Color to set a distinct color or dash pattern so it doesn't blend with the connecting segments underneath.
  7. Move the chart off the worksheet area, then right-click and choose Save as Picture to export it as a PNG, or copy it with Ctrl+C and paste into Word or PowerPoint for embedding.

If you only want the markers and no connecting line, stay on the plain Scatter subtype and skip steps involving line subtypes. If you want the trendline but no connectors, switch the chart subtype to plain Scatter before adding the trendline so the line stands alone.

Use the Scatter Plot Maker to Preview Your Excel Points as a Clean SVG

Excel is the right tool for an editable workbook, but there are moments when you just want to inspect the points quickly without opening a file, or export a sharp vector image you can paste into a report. The Scatter Plot Maker handles both jobs by turning pasted x,y rows into a linear XY scatter plot and downloading the exact preview as a standalone SVG. Pasted input is capped at 50,000 UTF-16 code units; beyond that boundary the parser rejects the input outright. Every parse, layout, and export step runs in the current browser tab, so nothing about your data leaves your machine.

The tool is upfront about its scope. Each valid pair becomes one blue circle on a linear two-axis grid. It does not draw a connecting line between points, and it does not compute correlation, regression, a trendline, confidence intervals, or any other statistical summary. Use it for paired observations, calibration samples, classroom demonstrations, rough correlation checks, and quick visual inspection — not as a replacement for a statistical package.

For readers whose workflow starts with two Excel columns, the walkthrough on making a 2-variable scatter plot from Excel columns covers the exact copy-paste step for moving your data into the tool.

Read the Summary Counts and Axis Ranges Before Trusting the Chart

The Scatter Plot Maker deliberately separates three numbers in its generated summary, and the chart is only trustworthy once those numbers match your expectations.

Summary numberWhat it countsWhat it means for your chart
Valid pointsNon-empty rows with exactly two comma-separated finite numbers within ±1e12These rows become markers; nothing else does
Invalid rowsRows inside the first 200 that fail strict parsingDropped and reported, not plotted, not turned into zeros
Over-limit rowsNon-empty rows past row 200Counted separately, never mixed into invalid

Both axes use independent linear scales with no automatic zero. The smallest x value maps to the left plot edge, the largest x to the right, and the same rule applies vertically. Five reference lines and labels expose the displayed range, but if the smallest x in your data is, say, 47 and the largest is 53, the chart zooms in on that band and zero sits off-screen entirely. Inspect the axis labels before interpreting how tight or how spread out a cluster looks.

Two edge cases are handled explicitly. When every x value is identical, the tool expands the x domain symmetrically around that value by ten percent of the absolute constant or one unit, whichever is larger; the same rule applies independently to a constant y value. A single valid point therefore renders at the center of both axes instead of throwing a divide-by-zero error. Constant axes are a legitimate part of the data — they just need a visible scale to be readable.

When the Scatter Plot Maker Is the Wrong Tool

Reach for something else when any of the following matter for your deliverable:

  • You need a connecting line between consecutive points or a fitted trendline. The tool plots markers only.
  • You want statistical claims — correlation, regression coefficients, R-squared, confidence bands, density, or cluster detection. None of these are computed.
  • The dataset exceeds 200 valid rows you actually care about, or you want the tool to parse every pasted row instead of counting the rest as over-limit.
  • You need a logarithmic axis, categorical color encoding, accessible labeling beyond per-point text titles, or publication-style typography.
  • Your points overlap so often that the visualization needs jitter, transparency, or sizing to disambiguate them. Identical pairs repeat cleanly here but can hide one another.

For any of those cases, keep your source rows in a spreadsheet, run the analysis in a dedicated plotting or statistics package, and use the Scatter Plot Maker only for quick visual spot-checks. The on-page preview and the downloaded SVG are guaranteed to match because both come from the same percent-encoded SVG string, which means the file you save is the exact image you inspected, including the axis ranges and gridlines visible in the browser.

Edit and Re-Export Without Breaking the Download

The tool intentionally ties the on-page preview and the download link to one generated SVG string. As soon as you change the title or edit the data, that string is cleared and the old download is disabled. Re-running Generate rebuilds the string from your current input, which means the file you save will always reflect the chart you just looked at. There is no chance of downloading a stale SVG from an earlier draft of your data.

User text is treated conservatively throughout. The title you type is XML-escaped before it appears in the SVG, so ampersands, angle brackets, quotes, and apostrophes become entities and never create SVG elements or break the file. If your title contains something that looks like an HTML or SVG tag in plain text, it remains visible text in the output rather than turning into a real element. Coordinates are rounded to three decimal places, which is precise enough for visual inspection but not a substitute for keeping the original rows for analysis, reproducibility, or exact reproduction later. For an overview of the SVG standard that defines these shapes and text elements, the MDN SVG tutorial is a solid reference.

For a deeper look, see Creating a Yes or No Drop-Down in Excel With Web Crypto.