How to run a line of best fit on Desmos

Scatterplots, "models of best fit," and prediction questions all come down to one Desmos habit: drop the data in a table, then fit it with a single character — the tilde. Desmos does the regression; you read the equation.

Open a table and type your data into the x_1 and y_1 columns. Then on a new line, fit a model using ~ instead of =: y_1 ~ m x_1 + b for a line (Desmos returns m, b and r²), y_1 ~ a x_1^2 + b x_1 + c for a quadratic, or y_1 ~ a b^{x_1} for exponential growth. Use the fitted equation to predict a value at any new x. The closer is to 1, the tighter the fit.

table to best-fit line: Make the mathematical object in this brief the hero: a Desmos-style panel: a small two-column table (x, y) on the left, a scatter of points on the right with a straight best-fit line through them in the accent color, and a results row showing m, b and r² as dotted placeholders
The tilde fits~ means "best fit to my data," not "graph this equation."
Parameters returnedDesmos hands you m, b (and a, c) plus r² automatically.
Predict anywherePlug a new x into the fitted equation to forecast y.
Match the shapeLine for straight data; quadratic or exponential when it curves.
Step by step

From a table to a prediction

Eight steps from a blank table to a forecasted value. The whole flow is type, tilde, read — and it works the same for lines, parabolas and exponentials.

01

Add a table

From the expression list, choose the option to add a table. Desmos creates two columns already labelled x_1 and y_1 — the subscript names matter for the next step.

02

Type the data in

Enter each x-value down the first column and its matching y-value beside it in the second. The points appear on the graph as you go, so you can eyeball the shape.

03

Decide the model

Look at the scatter. Roughly straight → a line. A single curve up or down → a quadratic. Steeply accelerating growth or decay → an exponential.

04

Fit with the tilde

On a new line type y_1 ~ m x_1 + b. The ~ (not =) is what triggers the regression. Use the same column names as your table.

05

Read the parameters

Desmos lists the fitted values — for a line, m (slope) and b (y-intercept). It also draws the fitted line right through your points.

06

Check r²

Find r^2 in the results. Close to 1 means the points hug the line; a lower value warns that this model type may be the wrong choice.

07

Predict a value

To forecast y at a new x, define f(x)=m x+b (the names m and b now hold the fitted numbers) and type f(12), or just substitute the x into the equation.

08

Swap models if needed

If r² is poor or the data clearly curves, change the fit line to y_1 ~ a x_1^2 + b x_1 + c or y_1 ~ a b^{x_1} and re-read the new parameters.

Worked example

Fit a line, then predict

A typical SAT scatterplot question: a handful of points, a line of best fit, and a prediction at a value that isn't in the table.

SAT-style problem

A café records cups of cold brew sold against the day's high temperature (°F): (60, 18), (68, 27), (75, 33), (82, 41), and (90, 50). Using the line of best fit, predict the cups sold on a 78 °F day.

Build the table. Add a table and type the five temperatures down x_1 and the matching cup counts down y_1. The five points plot in a nearly straight, upward band.

Fit the line. On a new line type y_1 ~ m x_1 + b. Desmos returns roughly m ≈ 1.06 and b ≈ -45.3, with r² ≈ 0.998 — extremely close to 1, confirming a line is the right model.

Predict at x = 78. Define f(x)=m x+b and type f(78). Desmos returns about 36.96. Since the question asks for cups sold, you'd report roughly 37 cups — and the matching multiple-choice option is the nearest whole number.

Reading r² like a pro

An of 0.998 means the line explains about 99.8% of the variation in the data — the points sit almost exactly on it, so a linear model is safe and the prediction is trustworthy. If that number had come back low (say 0.55), it would be a signal to try a quadratic or exponential instead.

Avoid this slip: let Desmos keep the full-precision m and b. Rounding the slope and intercept by hand before predicting can push your answer past the nearest option — evaluate the function with the exact fitted values, then round only the final result.

When to use / pitfalls

When the tilde wins — and where it bites

Use it

Scatterplots and "model" questions.

Any time you're given paired data and asked for a slope, an intercept, a "line/model of best fit," or a prediction, a table plus one tilde line beats setting up the regression by hand or guessing from the graph.

Watch for

Wrong model, wrong column names.

Fitting a line to clearly curved data gives a bad answer even though Desmos "works." And your fit line must reference the same names as the table (x_1, y_1) — a mismatched subscript means no fit appears.

Skip it

When the equation is already given.

If the question states the line of best fit, you don't need to refit — just graph that equation or plug your x straight in. Reach for regression only when you must derive the model from data.

Practice fits on SAT-style data.

Regression setups stick only when you run them on real questions with the built-in calculator, until the tilde is second nature.

Start free practice
FAQ

Desmos regressions on the SAT, answered

How do I do a line of best fit in Desmos on the SAT?
Open a table and type your data into the x_1 and y_1 columns. Then on a new line type y_1 ~ m x_1 + b using the tilde key. Desmos fits the line and shows the slope m, the intercept b, and .
What does the tilde (~) mean in Desmos?
The tilde tells Desmos to fit a model to your data rather than graph a fixed equation. Writing y_1 ~ m x_1 + b means "find the m and b that best match the points in my table" — that is regression.
How do I fit a quadratic or exponential model in Desmos?
Use the same table, then type y_1 ~ a x_1^2 + b x_1 + c for a quadratic or y_1 ~ a b^{x_1} for an exponential model. Desmos returns the fitted parameters and an for the fit. Choose the model that matches the shape of the plotted points.
What is r² and what counts as a good fit?
measures how well the model explains the variation in the data, on a scale from 0 to 1. Values near 1 mean the points sit close to the fitted curve; lower values mean a looser fit. On the SAT it's mainly a check that your chosen model type is reasonable.
Can I use the fitted equation to predict a value on the SAT?
Yes. Once Desmos gives you the parameters, substitute your target x into the fitted equation — or define a function with the fitted numbers and evaluate it — to predict the corresponding y. This is exactly what line-of-best-fit prediction questions ask for. Confirm current calculator behavior on the official sites.

Turn scatterplots into easy points.

Start free and practice SAT-style data questions with the built-in calculator, until fitting a model and predicting is automatic.