Difference Between a Line and a Line Segment (With Examples)

#Difference Between a Line and a Line Segment
TL;DR
A line has no endpoints: it runs on forever in both directions and has no length. A line segment is the part of a line between two endpoints, so it has a definite length. A ray sits in between, with one endpoint.
Ashra Siddiquiยทreviewed byShikha SharmaLast updated on December 2, 202612 min read

Key Points

  • Line: no endpoints, endless both ways, no length. Written ABโ†”\overleftrightarrow{AB}.
  • Line segment: two endpoints and a length. Written ABโ€พ\overline{AB}; its length is ABAB.
  • Ray: one endpoint, endless one way. Written ABโ†’\overrightarrow{AB}, starting at AA.
  • Count the endpoints, 0, 1 or 2, and all three are sorted.
  • Two lines that cross can carry segments that never touch.

Two Words That Look the Same on Paper

Draw a straight pencil mark between two dots, and the mark alone cannot say what it is. Is it a line or a line segment?

  • An arrowhead on each end means a line, which never stops.
  • Dots at the ends mean a line segment, which you can measure.
  • Where it ends, or whether it ends, is the whole difference between a line and a line segment.
the difference between a line and a line segment, with a ray in between, is only in their ends
Three versions of the same mark through A and B: a purple line with arrowheads at both ends, a green ray with an endpoint at A and an arrowhead past B, and an orange segment that stops at A and B, each beside its notation.

What Is a Line?

The short answer to the title: a line never ends, while a line segment stops at two endpoints, so only the segment has a length. Start with the line.

A line is a straight path of points that goes on without end in both directions. With no ends, there is nothing to measure from, so it has no length.

  • It is named by two of its points with a two-headed arrow: ABโ†”\overleftrightarrow{AB}, or by one letter, such as line ll.
  • Letter order does not matter: ABโ†”=BAโ†”\overleftrightarrow{AB} = \overleftrightarrow{BA}.
  • Through any two different points there is exactly one line.
  • Picture a straight line through two points, carried on past both forever.

What Is a Line Segment?

A line segment is the part of a line between two endpoints, including the endpoints. It starts and stops, so a ruler gives its length.

  • It is written with a plain bar: ABโ€พ\overline{AB}. No arrows means it stops.
  • Without the bar, ABAB means its length: "AB=5AB = 5 cm".
  • Every segment has exactly one midpoint, found on a grid with the midpoint formula. A line has none.
  • Most real "lines" are a line segment: a book's edge, a triangle's side, a clock hand.

What Is a Ray?

A ray has one endpoint and goes on without end in one direction.

  • It is written ABโ†’\overrightarrow{AB}, and the first letter is always the endpoint.
  • So ABโ†’\overrightarrow{AB} and BAโ†’\overrightarrow{BA} point opposite ways.
  • Two opposite rays from one point make a whole line.

Difference Between a Line and a Line Segment: The Comparison

Both are straight; they differ in their ends, length and notation.

Line Ray Line segment
Endpoints 0 1 2
Extends forever, both ways forever, one way not at all
Length none none a definite number
Midpoint none none exactly one
Notation ABโ†”\overleftrightarrow{AB} ABโ†’\overrightarrow{AB} ABโ€พ\overline{AB}
Letter order matters? no yes no
Drawn with an arrowhead at each end a dot and an arrowhead a dot at each end
Everyday model an idea only a torch beam the edge of a ruler
  • In short: a segment is the piece of a line you can hold a ruler to.

A Line on a Grid, and the Segment Inside It

On a grid, a segment is exactly the piece of a line between two points. Take A(โˆ’2,โˆ’1)A(-2, -1) and B(2,1)B(2, 1). Every point on their line is

A+t(Bโˆ’A)=(โˆ’2+4t,ย โˆ’1+2t)A + t(B - A) = (-2 + 4t,\ -1 + 2t)
  • t=0t = 0 gives AA, t=1t = 1 gives BB, and t=0.5t = 0.5 gives the midpoint (0,0)(0, 0).
  • The segment is every point with 0โ‰คtโ‰ค10 \le t \le 1.
  • The ray from AA is every point with tโ‰ฅ0t \ge 0.
  • The line is every tt: (4,2)(4, 2) at t=1.5t = 1.5 is on the line, not the segment.
  • The segment's length is the distance between two points: 42+22โ‰ˆ4.47\sqrt{4^2 + 2^2} \approx 4.47.
the segment is the part of the line with t between 0 and 1
On a grid, the solid orange segment from A(โˆ’2, โˆ’1) at t = 0 to B(2, 1) at t = 1, with the midpoint at t = 0.5, and the dashed purple line continuing to (4, 2) at t = 1.5 and (โˆ’4, โˆ’2) at t = โˆ’0.5.

Try It Yourself

In the tool, the thick orange piece is the segment, with its length from the distance formula. The dashed purple line stops at the grid's edge, but the line itself does not. Drag AA and BB: the segment's length changes, while the line has none to report.

Where the Difference Between a Line and a Line Segment Shows Up

"Goes on forever" versus "stops at two points" decides what you can measure and what must cross.

Only segments can be measured

  • Length, midpoint, perimeter and area all need ends.
  • A triangle's sides are segments, so it has a perimeter.
  • "The length of line ABโ†”\overleftrightarrow{AB}" does not exist.

Lines must meet; segments need not

  • Two different lines in a plane cross once or are parallel.
  • Segments can end before the crossing point.
  • The segments A(โˆ’5,โˆ’1)A(-5, -1) to B(โˆ’1,1)B(-1, 1) and C(4,โˆ’3)C(4, -3) to D(2,0)D(2, 0) lie on lines crossing at (0.75,1.875)(0.75, 1.875), but the segments never touch.
two lines can cross while the segments on them never meet
Segment AB in blue and segment CD in green; their dashed extensions cross at X(0.75, 1.88), beyond the ends of both segments, so the segments never touch.

Counting gives different answers

  • Four points on one line: 6 segments but only 1 line.
  • Four points, no three in a line: 6 segments and 6 lines.
  • For nn points, there are n(nโˆ’1)2\frac{n(n - 1)}{2} segments, one per pair.
n points with no three in a line give n(n โˆ’ 1) รท 2 segments
Two panels: four points as a square with its four sides and two diagonals, 6 segments; five points as a pentagon with its five sides and five diagonals, 10 segments.

Building, drawing and light

Everything you can touch is a segment at best; the line is an idea.

  • Building: every cut, seam and beam has two ends and a length.
  • Drawing software: the "line" tool stores a segment as two endpoints.
  • Light: a torch beam starts at the torch and keeps going, so it is a ray.
a ruler's edge is a segment and a torch beam is a ray
A yellow ruler whose bottom edge is marked as a segment with an endpoint at each end, and a torch whose beam is drawn as a green ray starting at the torch, with a note that nothing physical is an endless line.

Euclid's Lines Were Mostly Segments

The old meanings were different from today's.

  • In Euclid's Elements, about 300 BCE, a "line" could even be curved, and its ends were points.
  • His straight lines were finite: what we call segments.
  • His second postulate let you extend a segment as far as needed. The endless "line" came much later.

Examples of Lines and Line Segments

These move from spotting the difference to using it on a grid.

Example 1

Classify: (a) arrowheads at both ends; (b) a dot at one end, an arrowhead at the other; (c) dots at both ends.

  1. Count the endpoints: 0, 1 and 2.
  2. Final answer: (a) a line, (b) a ray, (c) a line segment.

Example 2

A student measures the drawing of line AB (two-headed arrow): 8 cm. What is the right answer?

  1. The arrows say it goes on forever; the drawing is only a piece.
  2. Final answer: a line has no length. The segment ABโ€พ\overline{AB} would be 8 cm.
measuring the drawing of a line does not give the line a length
A purple double-headed arrow standing for line AB above a ruler reading 0 to 8 cm: 8 cm measures the drawing, while the line itself is endless and only a segment has a length.

Example 3

Write the segment from P to Q, the ray from P through Q, and the ray from Q through P.

  1. Segment: PQโ€พ\overline{PQ}, the same as QPโ€พ\overline{QP}.
  2. Final answer: rays PQโ†’\overrightarrow{PQ} and QPโ†’\overrightarrow{QP}, which differ.

Example 4

Segment AB runs from A(1, 2) to B(7, 10). Find its length, then place C(4, 6), D(10, 14) and E(4, 5).

  1. AB=62+82=100=10AB = \sqrt{6^2 + 8^2} = \sqrt{100} = 10.
  2. The line is (1+6t,ย 2+8t)(1 + 6t,\ 2 + 8t).
  3. C: t=0.5t = 0.5 fits, so it is on the segment (the midpoint).
  4. D: t=1.5t = 1.5 fits, so it is on the line, beyond BB.
  5. E: t=0.5t = 0.5 needs y=6y = 6, not 5, so it is off the line.
a point can be on the segment, only on the line, or on neither
Segment AB from (1, 2) to (7, 10) on a grid with its dashed line: C(4, 6) on the segment at t = 0.5, D(10, 14) on the line but not the segment at t = 1.5, and E(4, 5) off the line.

Example 5

How many lines and segments do two points give? Four points on one line?

  1. Two points: 1 segment and 1 line.
  2. Four points on a line: 4ร—32=6\frac{4 \times 3}{2} = 6 segments, all on 1 line.

Example 6

C lies on segment AB with AC = 3 cm and CB = 5 cm. Find AB. Works for a line?

  1. AB=3+5=8AB = 3 + 5 = 8 cm, by the segment addition postulate.
  2. Final answer: 8 cm. A line has no total to add up to.

Where Students Trip Up on the Difference Between a Line and a Line Segment

Most slips come from trusting the drawing instead of the marks on its ends.

Mistake 1: Measuring a line

Where it slips in: Every drawing of a line looks finite.

Don't do this: Give a length for ABโ†”\overleftrightarrow{AB}.

The correct way: Arrows mean "do not measure"; only a segment has a length.

Mistake 2: Mixing up the marks above the letters

Where it slips in: Copying notation fast.

Don't do this: Write ABโ€พ\overline{AB} for a line, or ABโ€พ=5\overline{AB} = 5 cm.

The correct way: Bar for a segment, one arrow for a ray, two for a line, no mark for a length.

Mistake 3: Forgetting that a ray sits between the two

Where it slips in: Sorting figures into only two boxes.

Don't do this: Call a one-endpoint figure a segment or a line.

The correct way: One endpoint means a ray. Write its endpoint first: the ray from BB through AA is BAโ†’\overrightarrow{BA}.

Mistake 4: Assuming two sides meet because their lines do

Where it slips in: Proofs and grid questions about crossing edges.

Don't do this: Say the segments cross where their lines cross.

The correct way: Check the crossing point lies between the endpoints of both.

The Short Version

  • A line has no endpoints; a segment has two; a ray has one.
  • Ask "how many ends?" and all three sort themselves.
  • ABโ†”\overleftrightarrow{AB} line, ABโ†’\overrightarrow{AB} ray, ABโ€พ\overline{AB} segment, ABAB its length.
  • Only segments have a length, and segments on crossing lines need not meet.

Practice These Problems to Solidify Your Understanding

Practice these problems to solidify your understanding. In the tool, pick a point on the dashed line beyond BB and check its tt is more than 1.

  1. A figure has an endpoint at AA and an arrowhead through BB. Name it and write it.
  2. Find the length of the segment from C(โˆ’2,1)C(-2, 1) to D(4,9)D(4, 9).
  3. How many segments make a triangle's edges, and are any of them lines?

Answers: a ray, ABโ†’\overrightarrow{AB}; 36+64=10\sqrt{36 + 64} = 10 units; three, and none are lines. If Question 1 gave "line" or "segment", see Mistake 3.

To build these foundations with a teacher, explore Bhanzu's geometry tutor sessions.

Want a live Bhanzu trainer to guide your child through points, lines and segments? Book a free demo class.

Read More

Research Behind This Article

  1. Euclid, Elements, Book I, Definitions 1 to 4 (point, line, the ends of a line, straight line), with commentary by D. E. Joyce, Clark University. mathcs.clarku.edu
  2. Euclid, Elements, Book I, Postulate 1 (a straight line from any point to any point), with commentary by D. E. Joyce, Clark University. mathcs.clarku.edu
  3. Euclid, Elements, Book I, Postulate 2 (extending a finite straight line), with commentary by D. E. Joyce, Clark University. mathcs.clarku.edu
  4. OpenStax, Contemporary Mathematics, Section 10.1: Points, Lines, and Planes (line, segment and ray notation). openstax.org
  5. Euclid, Elements, Book I, Proposition 20 (any two sides of a triangle are together longer than the third, the reason the segment is the shortest path), D. E. Joyce, Clark University. mathcs.clarku.edu

Quick Quiz: Check Yourself

Three levels, questions with figures, instant feedback with the reason.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is the main difference between a line and a line segment?
Endpoints. The difference between a line and a line segment is that a line has none and no length, while a segment has two and a measurable length.
What is the difference between a line, a ray and a line segment?
A line has 0 endpoints, a ray 1 and a segment 2. Only the segment can be measured.
How is a line segment measured?
With a ruler, or on a grid with (x2โˆ’x1)2+(y2โˆ’y1)2\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.
Can a line segment be part of a line?
Yes. Every segment lies on exactly one line, and a line holds endless segments.
Is a line segment the shortest path between two points?
Yes, on a flat surface. That is why its length is called the distance between the points.
How many line segments make a triangle or a square?
A triangle has three. A square has four sides, or six segments with its diagonals.
โœ๏ธ Written By
Ashra Siddiqui
Ashra Siddiqui
Subject Matter Expert
Ashra Siddiqui is a Subject Matter Expert on Bhanzu's Learning Experience team with over 10 years of experience teaching mathematics at the primary and middle school levels. She follows a student-centred, differentiated approach, recognizing that every child learns differently, and connects concepts to real-life examples. She has also trained students for competitive exams and Olympiads.
LinkedIn
๐Ÿ”ฌ Reviewed By
Shikha Sharma
Subject Matter Expert
Book a FREE Demo ClassBook Now โ†’