Line of Best Fit: How to Draw One and Judge How Well It Fits

#8th Grade Math#Statistics & Probability#Line of Best Fit
TL;DR
A line of best fit is one straight line through the middle of a scatter plot that follows the trend of the dots. You judge it by how close the dots sit.
Bhanzu TeamLast updated on December 2, 202615 min read

Key Points

  • A line of best fit is a single straight line that follows the trend of a scatter plot, with about as many points above it as below it.
  • The two-centers method splits the points into a left half and a right half, marks the center of each half, and joins the two centers.
  • The average vertical distance from the points to a line scores the fit, and a smaller average means the line hugs the data more closely.
  • Two lines can have equal counts of points above and below and still fit differently, as averages of 0.4 and 1.2 show in Example 3.

The comet problem that needed a line

In 1806, Adrien-Marie Legendre had more comet sightings than his equations needed. Each one was slightly off, so no single path ran through all of them.

His book on comet orbits ended with an appendix showing how to pick the one curve sitting closest to the whole crowd of points. Carl Friedrich Gauss published his own version in 1809, and Legendre spent years arguing for the credit.

You will do the same job with a ruler. Climate scientists fit lines to carbon dioxide readings, and geologists fit them to rock samples.

Three lines on one scatter plot, and only the line of best fit follows the trend of the dots.
Scatter plot of arm span against height for 8 students, from 57 to 71 inches, with three candidate lines labeled too steep with average distance 2.0, too flat with average distance 2.25, and follows the trend with average distance 0.75.

What is a line of best fit?

A line of best fit is a straight line on a scatter plot that follows the overall trend of the points, running through the middle of the cloud rather than through any particular dot. A scatter plot shows pairs of numbers as dots, such as each student's arm span and height. Paired measurements like these are called bivariate data.

The line only makes sense when the dots show a linear association, a roughly straight band. Dots that rise together show a positive association, and dots that fall as you move right show a negative one.

Common Core standard 8.SP.A.2 asks students to fit this line informally and judge it by how close the points are. For your child, that means drawing and scoring the line by eye in 8th grade, while the formula a calculator uses waits until high school.

How do you draw a line of best fit by eye?

Find the center of each half of the data and join the two centers. This is the two-centers method.

  1. Sort the points from left to right and split them into two halves.
  2. Average the x-values and the y-values of each half to get its center.
  3. Mark both centers.
  4. Lay a ruler across both centers and draw the line edge to edge.

Here it is on a class's arm span and height data, in inches.

Half Points (arm span, height) Center
Left (57, 58), (59, 61), (61, 60), (63, 65) (60, 61)
Right (65, 65), (67, 69), (69, 70), (71, 72) (68, 69)

The left x-values add to 240 and the y-values to 244, and dividing each by 4 gives (60, 61). From (60, 61) to (68, 69) the line rises 8 and runs 8, so its slope is 1 and its equation is y=x+1y = x + 1.

Line of best fit drawn with the two-centers method on arm span and height data.
Scatter plot of 8 arm span and height points split by a dashed divider at 64 inches, with the left center marked at (60, 61), the right center at (68, 69), and the line y = x + 1 drawn through both centers.

Each center sits in the middle of its half, so a line through both runs through the middle of the whole cloud.

Carleton College's Math You Need guide also shows an oval method: circle all the points, then cut the oval into two equal halves. Two people's ovals rarely match, though. Computers use the least squares method, a high school topic that picks the line with the smallest total of squared distances.

The two-centers method also breaks a common habit. Many first lines start at the leftmost dot, which is only one point and may sit far from the trend.

How do you judge how well a line fits?

Measure how far each point sits straight above or below the line, then average those distances. A small average means a close fit.

Arm span xx Height yy Line value x+1x + 1 Distance
57 58 58 0
59 61 60 +1
61 60 62 -2
63 65 64 +1
65 65 66 -1
67 69 68 +1
69 70 70 0
71 72 72 0

First, the balance check. Three points sit above, two below and three on the line, so the counts are close.

Next, the distance check. Add the sizes and ignore the signs (otherwise points above and below cancel out).

0+1+2+1+1+1+0+08=68=0.75 inches\frac{0 + 1 + 2 + 1 + 1 + 1 + 0 + 0}{8} = \frac{6}{8} = 0.75 \text{ inches}

Heights here span 14 inches, so missing by three quarters of an inch on average is a close fit. High school calls these vertical distances residuals.

Try It Yourself

Drag the two orange handles up and down to move the line through the arm span dots. Watch the counts above and below and the average distance, and try to get that average under 1 inch.

Examples of line of best fit

Example 1

The line y=2x+1y = 2x + 1 is drawn through the points (1, 4), (2, 4), (3, 7), (4, 10) and (5, 10). How many points lie above it, how many below, and what is the average distance?

Line values: 3, 5, 7, 9, 11.

Distances: +1, -1, 0, +1, -1.

1+1+0+1+15=45=0.8\frac{1 + 1 + 0 + 1 + 1}{5} = \frac{4}{5} = 0.8

Two points lie above, two below, one on the line, and the average distance is 0.8.

Example 2

Mateo scored 3, 8, 11, 10, 14, 17, 16 and 17 points in games 1 to 8. Draw a line of best fit for game number against points.

The tempting move is joining the first point (1, 3) to the last point (8, 17). That gives slope 147=2\frac{14}{7} = 2 and the line y=2x+1y = 2x + 1.

Its distances are 0, 3, 4, 1, 3, 4, 1 and 0. Six points sit above and none below, with an average of 168=2\frac{16}{8} = 2. Games 1 and 8 happened to be low, so the line rides under the cloud.

Use the two-centers method instead. Games 1 to 4 have center (2.5,324)=(2.5,8)\left(2.5, \frac{32}{4}\right) = (2.5, 8), and games 5 to 8 have center (6.5,644)=(6.5,16)\left(6.5, \frac{64}{4}\right) = (6.5, 16).

slope=16−86.5−2.5=84=2\text{slope} = \frac{16 - 8}{6.5 - 2.5} = \frac{8}{4} = 2

The line is y=2x+3y = 2x + 3. Its distances are -2, +1, +2, -1, +1, +2, -1, -2, so four points sit above and four below.

The line of best fit is y=2x+3y = 2x + 3, with an average distance of 128=1.5\frac{12}{8} = 1.5 points instead of 2.

Example 3

For the points (1, 2), (3, 5), (5, 5), (7, 8) and (9, 10), which fits better, Line A y=x+1y = x + 1 or Line B y=0.5x+3.5y = 0.5x + 3.5?

Line A distances: 0, +1, -1, 0, 0. One above, one below, average 25=0.4\frac{2}{5} = 0.4.

Line B values are 4, 5, 6, 7, 8, so its distances are -2, 0, -1, +1, +2. Two above, two below, average 65=1.2\frac{6}{5} = 1.2.

Both lines pass the balance check, but Line A fits better with an average of 0.4.

Example 4

Two lab groups hang 2, 4, 6, 8 and 10 washers on a spring. Group P measures lengths of 14, 18, 23, 25 and 30 cm, and Group Q measures 19, 12, 26, 21 and 33 cm. For which group is the line y=2x+10y = 2x + 10 a close fit?

Line values: 14, 18, 22, 26, 30 cm.

Group P distances are 0, 0, +1, -1, 0, an average of 25=0.4\frac{2}{5} = 0.4 cm.

Group Q distances are +5, -6, +4, -5, +3, an average of 235=4.6\frac{23}{5} = 4.6 cm.

From 2 to 10 washers the line climbs 16 cm. Missing by 0.4 cm is tiny, while 4.6 cm is more than a quarter of that climb, so the line fits Group P closely and Group Q loosely.

Example 5

Yearly average carbon dioxide (CO2) at Mauna Loa, in parts per million (ppm), was 404.4, 406.8, 408.7, 411.7, 414.2, 416.4, 418.5, 421.1, 424.6 and 427.4 for 2016 to 2025. Fit and judge a line.

Parts per million counts CO2 molecules in every million molecules of air, and here n=10n = 10 years.

The 2016 to 2020 levels add to 2,045.8, a center of about (2018, 409.2). The 2021 to 2025 levels add to 2,108.0, a center of (2023, 421.6).

slope=421.6−409.22023−2018=12.45=2.48 ppm per year\text{slope} = \frac{421.6 - 409.2}{2023 - 2018} = \frac{12.4}{5} = 2.48 \text{ ppm per year}
Line of best fit through ten years of NOAA carbon dioxide data from Mauna Loa.
Scatter plot of yearly average carbon dioxide at Mauna Loa from 2016 to 2025, rising from 404.4 to 427.4 parts per million, a dashed divider between 2020 and 2021, centers at (2018, 409.2) and (2023, 421.6) and a fitted line with slope 2.48 ppm per year.

The slope says the level climbs about 2.5 ppm a year. For 2021 the line gives 409.2+3×2.48=416.64409.2 + 3 \times 2.48 = 416.64, close to the real 416.4.

Six points sit above and four below, with an average distance of about 0.35 ppm against a 23.0 ppm rise, so the fit is very close. The values come from the NOAA Global Monitoring Laboratory annual file, updated in November 2026.

Example 6

Kai practiced free throws 1 to 6 hours a week and made 7, 8, 11, 12, 3 and 15 shots out of 20. The 5-hour week was on a windy court. For the line y=2x+4y = 2x + 4, find the outlier and judge the fit of the other weeks.

An outlier is a point far from the pattern of the rest.

Line values: 6, 8, 10, 12, 14, 16. Distances: +1, 0, +1, 0, -11, -1.

The point (5, 3) sits 11 below the line, so it is the outlier.

1+0+1+0+15=35=0.6\frac{1 + 0 + 1 + 0 + 1}{5} = \frac{3}{5} = 0.6

The other five weeks average 0.6, a close fit, while including the outlier pushes the average to 146≈2.33\frac{14}{6} \approx 2.33. Keep the line and report the windy week separately.

Why do scientists trust a straight line?

A straight line squeezes a cloud of noisy measurements into one rule you can say in a sentence. Legendre wanted exactly that for his comets.

  • Wobble cancels out. Every measurement is a little off, and a line through the middle lets highs and lows balance.
  • One number tells the story. "About 2.5 ppm more each year" says what ten separate CO2 readings can't.
  • Gaps get filled. You can read a sensible value between two measured points.
  • Surprises stand out. A point far from the line, like Kai's windy week, is easy to spot.

The NIST/SEMATECH e-Handbook of Statistical Methods names checking for a relationship between two variables as the scatter plot's purpose.

Where do kids trip up on the line of best fit?

Mistake 1: Chasing points instead of the trend

Where it slips in: The first line on a new scatter plot, as in Example 1.

Don't do this: Drawing y=3x−2y = 3x - 2 because it passes through three dots, (2, 4), (3, 7) and (4, 10). It misses the other two by 3 each, an average of 65=1.2\frac{6}{5} = 1.2.

The correct way: Draw y=2x+1y = 2x + 1, which touches one dot but averages 0.8. Years of dot-to-dot puzzles train the eye to hit dots, so touching more of them feels right.

A line of best fit follows the trend instead of touching the most dots.
Two side-by-side scatter plots of the points (1, 4), (2, 4), (3, 7), (4, 10) and (5, 10), with the left plot marked wrong showing y = 3x minus 2 touching three dots with average distance 1.2, and the right plot marked right showing y = 2x + 1 with average distance 0.8.

Mistake 2: Trusting the line far outside the data

Where it slips in: Questions about a value past the last data point.

Don't do this: Using Kai's line for 10 hours, 2×10+4=242 \times 10 + 4 = 24 made shots, when Kai only takes 20.

The correct way: Trust the line only across the measured range, 1 to 6 hours. Reading values off a fitted line is the focus of using linear models to make predictions, the next lesson.

Mistake 3: Drawing a line through a blob

Where it slips in: Scatter plots with no clear direction, such as birthday month against shoe size.

Don't do this: Drawing a rising line through (1, 7), (4, 6), (6, 8), (9, 9) and (11, 7) and claiming people born later have bigger feet.

The correct way: First ask whether the dots form a straight band. These sizes bounce between 6 and 9 with no direction, so no line belongs there. A curved band needs a curve, the difference between linear and nonlinear functions. With a ruler already in hand, this check is the one that gets skipped.

What most guides miss about the line of best fit

Most guides stop at "same number of points above and below." That rule can't choose between two balanced lines, and in Example 3 one balanced line sits three times closer than the other.

The average distance settles it with arithmetic an 8th grader can do by hand. High school correlation and regression measure the same closeness with formulas.

One part is genuinely confusing. Two careful students can draw slightly different lines, and both can be right. A by-eye fit is a judgment, so the score that matters is the average distance, not matching an answer key to the decimal.

Key Takeaways

  • A trend line earns the name line of best fit only when it runs through the middle of a straight band of dots.
  • Averaging each half of the data and joining the two centers keeps one stray endpoint from steering the line.
  • Equal counts above and below are a starting check, and the average vertical distance decides between balanced lines.
  • An outlier gets reported, not chased, and the line only speaks for the range the data covers.
  • For more practice scoring a fitted line and spotting the endpoint trap, explore Bhanzu's 8th grade math tutor or the Common Core math curriculum.

A Practical Next Step

Grab graph paper and a ruler for these three problems.

  1. For y=2x+1y = 2x + 1 and the points (1, 3), (2, 6), (3, 6), (4, 9) and (5, 11), count points above and below and find the average distance.
  2. Use the two-centers method on (1, 2), (2, 5), (3, 5), (4, 8), (5, 10) and (6, 12).
  3. For y=x+5y = x + 5 and the points (2, 7), (4, 9), (6, 2) and (8, 13), find the outlier.

Answers: 1. One above, one below, three on the line, average 0.4. 2. Centers (2, 4) and (5, 10), line y=2xy = 2x. 3. (6, 2), which sits 9 below the line.

Practice these to solidify your understanding. If joining the first and last dots catches you, return to Example 2. Want a live Bhanzu trainer to walk through more line of best fit problems? Book a free demo class, online globally, or in person at our McKinney, TX center.

Read More

Research Behind This Article

  1. J J O'Connor and E F Robertson, MacTutor History of Mathematics, Adrien-Marie Legendre (1999). mathshistory.st-andrews.ac.uk
  2. Common Core State Standards Initiative, Grade 8 Statistics and Probability, 8.SP.A.2 (2010). thecorestandards.org
  3. Science Education Resource Center, Carleton College, How Do I Construct a Straight Line through Data Points? Best-Fit Lines (2024). serc.carleton.edu
  4. OpenStax, Algebra 1, 3.2.2 Determining the Best Line That Fits the Data (2025). openstax.org
  5. NOAA Global Monitoring Laboratory, Mauna Loa CO2 Annual Mean Data (2026). gml.noaa.gov
  6. NIST/SEMATECH, e-Handbook of Statistical Methods, 1.3.3.26 Scatter Plot (2012). itl.nist.gov

Quick Quiz: Check Yourself

Three levels with new numbers each round, where Easy counts the points above a line, Medium finds the average distance from a line, and Hard sets aside an outlier before judging the fit.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is a line of best fit in science?
In a lab, a line of best fit is the straight line drawn through measured points to show the trend, since real measurements never land perfectly on one line.
Does a line of best fit need an equation?
Not to draw or judge it. Any two points on the line give its slope and its line of best fit equation, as Example 5 shows with the CO2 data.
Is it okay to use a line of best fit calculator or graphing app?
Yes, once your child can draw a best fit line by hand and explain where it sits. The calculator's least squares line usually lands close to a careful two-centers line, so comparing them is good practice.
Why do computers square the distances when they fit a line?
Squaring makes every distance positive and punishes big misses, so a point 4 units off counts 16 times as much as a point 1 unit off. Your average distance does a similar job with simpler arithmetic.
When do kids learn the line of best fit?
Usually in 8th grade, under the Common Core statistics standards, starting with drawing and judging the line by eye and moving to its equation later that year.
How can I help my child with line of best fit at home?
Measure arm span and height for six to eight family members, plot them, and let your child draw and score a line with the two-centers method. If your child handles the arithmetic but freezes on long word problems, the snag is often reading or confidence rather than math, and their teacher can usually tell which. A tutor makes sense when earlier skills such as slope or plotting points are shaky. This page teaches the method, and the Quick Quiz gives fresh practice in place of a printed worksheet.
✍️ Written By
Bhanzu Team
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →