Line Segment: Definition, Properties & Examples

#Geometry
TL;DR
A line segment is a part of a straight line bounded by two distinct endpoints, so it has a fixed, measurable length — unlike a line or a ray, which run on forever. This article covers the definition and notation, how a segment differs from a line and a ray, its properties, the distance formula for length, and six worked examples.
BT
Bhanzu TeamLast updated on June 6, 20269 min read

The One Geometric Object Every Shape Is Built From

Take any triangle, square, or pentagon apart, and what you are left with is a handful of straight pieces, each pinned down at both ends. Those pieces are line segments, and they are the smallest building block in all of geometry: strip them out, and there is no shape left to talk about.

Once you can see why only the bounded piece has a length you can measure, the notation and the distance formula stop being rules to memorise and become things you can reconstruct.

What Is a Line Segment?

A line segment is a part of a straight line that is bounded by two distinct endpoints, and it contains every point on the line that lies between those two ends. As you trace it, you start at one endpoint and stop at the other; there is no running on forever in either direction.

If the endpoints are A and B, the segment is written $\overline{AB}$, read "line segment AB". The order makes no difference, so $\overline{AB}$ and $\overline{BA}$ name the same set of points. The length of the segment is written $AB$ without the bar: $\overline{AB}$ is the geometric object, while $AB$ is the number measuring how long it is.

How a Line Segment Differs From a Line and a Ray

A reader audit kept surfacing one question above all others here, so it is worth answering head-on. What is the difference between a line, a ray, and a line segment? All three live on the same straight path; the difference is only where they start and stop.

Object

Notation

Endpoints

Length

Line

$\overleftrightarrow{AB}$

None, runs both ways forever

Infinite

Ray

$\overrightarrow{AB}$

One, starts at A and runs through B forever

Infinite

Line segment

$\overline{AB}$

Two, fixed at A and B

Finite, measurable

The fastest way to read the notation: count the arrowheads. Two arrowheads ($\overleftrightarrow{AB}$) means a line, one arrowhead ($\overrightarrow{AB}$) means a ray, and a plain bar ($\overline{AB}$) means a segment. Only the segment can be laid against a ruler and given a length.

Properties of a Line Segment

Everything special about a line segment comes from the fact that it is closed off at both ends. The properties below are just that one idea, seen from different angles.

  • Fixed, measurable length. The length of $\overline{AB}$ stays the same no matter which way you measure it or where you slide or rotate it. A line and a ray have no finite length to speak of.

  • Congruence. Two segments are congruent ($\overline{AB} \cong \overline{CD}$) when they have equal lengths. In a square, all four sides are congruent segments; in an equilateral triangle, all three are.

  • Parallel segments. Two segments are parallel ($\parallel$) when the gap between them stays constant, so extended they would never meet. Opposite sides of a rectangle or parallelogram are parallel.

  • Perpendicular segments. Two segments are perpendicular ($\perp$) when they meet at a right angle ($90°$). Adjacent sides of a square meet this way. (For the line that cuts a segment in half at a right angle.)

  • Intersecting segments. Two segments intersect when they share at least one point. The two diagonals of a rectangle cross at a single interior point.

  • Midpoint. Every segment has exactly one midpoint — the point that splits it into two congruent halves.

The Length of a Line Segment: the Distance Formula

When you can lay a ruler against a drawn segment, you simply read the length off. When the endpoints are given as coordinates $(x_1, y_1)$ and $(x_2, y_2)$ on the plane, you compute the length with the distance formula:

$$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}.$$

Here $x_2 - x_1$ is the horizontal gap between the endpoints and $y_2 - y_1$ is the vertical gap. The formula is the Pythagorean theorem in disguise: the segment is the hypotenuse of a right triangle whose two legs are those horizontal and vertical gaps, so $d^2 = (\text{horizontal})^2 + (\text{vertical})^2$, and taking the square root gives $d$.

Examples of the Line Segment

With the definition, the notation, and the distance formula in place, here is the concept doing real work. The problems build from naming a segment up to finding an unknown endpoint.

Example 1:

Identify whether $\overline{PQ}$, $\overrightarrow{PQ}$, and $\overleftrightarrow{PQ}$ each have a measurable length.

Only $\overline{PQ}$ does. The bar means a segment with two endpoints, so it has a finite length. The single arrow $\overrightarrow{PQ}$ is a ray and the double arrow $\overleftrightarrow{PQ}$ is a line; both run on forever and have no finite length.

Final answer: only $\overline{PQ}$ has a measurable length.

Example 2:

Find the length of the segment between $P(-3, 4)$ and $Q(5, -2)$.

A common first move is to write $d = \sqrt{(5 - 3)^2 + (-2 - 4)^2} = \sqrt{4 + 36} = \sqrt{40}$. Check the first bracket: the x-coordinate of P is $-3$, not $3$, so the horizontal gap is $5 - (-3)$, not $5 - 3$. Dropping that negative sign shrank the gap from 8 down to 2, and the answer is too small to match a quick sketch, where the points sit a full 8 units apart left to right.

Done correctly, write each subtraction in brackets first:

$$d = \sqrt{(5 - (-3))^2 + (-2 - 4)^2} = \sqrt{8^2 + (-6)^2} = \sqrt{64 + 36} = \sqrt{100} = 10.$$

Final answer: $d = 10$ units.

Example 3:

Find the length of the segment between $A(1, 2)$ and $B(4, 6)$.

$$d = \sqrt{(4 - 1)^2 + (6 - 2)^2} = \sqrt{9 + 16} = \sqrt{25} = 5.$$

Final answer: $d = 5$ units.

Example 4:

The midpoint of $\overline{AB}$ is $M(3, 5)$ and one endpoint is $A(1, 2)$. Find the other endpoint B.

The midpoint is the average of the endpoints, so $B = (2 \cdot 3 - 1,; 2 \cdot 5 - 2) = (5, 8)$.

Final answer: $B = (5, 8)$.

Example 5:

Two segments measure $\overline{CD} = 7$ cm and $\overline{EF} = 7$ cm. Are they congruent, and does congruence mean they sit in the same place?

They are congruent, written $\overline{CD} \cong \overline{EF}$, because they have equal lengths. Congruence is about length only, so the two segments can point in different directions or sit far apart and still be congruent.

Final answer: yes, congruent; congruence fixes length, not position.

Example 6:

A segment has length 13 units. One endpoint is $A(2, 3)$ and the other has the form $(x, 8)$. Find x.

Apply the distance formula and square both sides:

$$13 = \sqrt{(x - 2)^2 + (8 - 3)^2} ;\Rightarrow; 169 = (x - 2)^2 + 25 ;\Rightarrow; (x - 2)^2 = 144.$$

So $x - 2 = \pm 12$, giving $x = 14$ or $x = -10$.

Final answer: $x = 14$ or $x = -10$ — the second endpoint can sit to the right or the left of A.

Where Line Segments Show Up

A line segment is the most basic object in geometry, which is exactly why it turns up wherever a fixed distance between two points matters. The reach goes well past the textbook.

  • Engineering and CAD drawings. Every edge of every part on a computer-aided design is a line segment carrying a precise length tolerance.

  • Computer graphics. A "line" drawn on a screen is really a segment, and drawing apps run the Bresenham algorithm to decide which pixels to colour between its two endpoints.

  • GPS routing. Mapping apps approximate roads as chains of segments; the trip distance is the sum of all the segment lengths.

  • Land surveying. Surveyors record plot boundaries as segments and add their lengths to find a property's perimeter.

The coordinate treatment that lets us compute a segment's length from its endpoints traces back to René Descartes, whose 1637 work married algebra to geometry — the same framework you lean on in every later graphing topic.

Where Students Trip Up on Line Segments

Mistake 1: Treating a line or a ray as if it had a finite length

Where it slips in: A problem asks for the length of $\overleftrightarrow{AB}$, and a student computes a number anyway.

Don't do this: Read every "AB" as a measurable segment.

The correct way: Read the notation first. Only $\overline{AB}$ (the bar) has a finite length. $\overrightarrow{AB}$ and $\overleftrightarrow{AB}$ run on forever.

Mistake 2: Dropping a negative sign in the distance formula

Where it slips in: Computing $(x_2 - x_1)$ when $x_1$ is negative, writing $(5 - 3)$ instead of $(5 - (-3))$.

Don't do this: Subtract in your head before writing the brackets.

The correct way: Write $(x_2 - x_1)$ with the actual values bracketed, $(5 - (-3))$, then simplify to $5 + 3 = 8$. The bracket discipline catches the sign before it spreads.

Mistake 3: Forgetting the square root at the end

Where it slips in: Reaching $(x_2 - x_1)^2 + (y_2 - y_1)^2 = 169$ and reporting 169 as the length.

Don't do this: Stop at $d^2$.

The correct way: Take the positive square root: $d = \sqrt{169} = 13$. A length is always positive.

Key Takeaways

  • A line segment is a part of a straight line bounded by two distinct endpoints, with a fixed, measurable length.

  • It differs from a line (runs both ways forever) and a ray (runs one way forever); only the segment has a finite length.

  • Segments can be congruent, parallel, perpendicular, or intersecting, and each has exactly one midpoint.

  • The length between coordinates $(x_1, y_1)$ and $(x_2, y_2)$ is the distance formula $d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$.

  • The most common slip is dropping a negative sign in the subtraction; write the brackets before you compute.

Practice These Problems to Solidify Your Understanding

  1. Find the length of the segment between $A(2, 1)$ and $B(8, 9)$.

  2. Find the length of the segment between $P(-2, 3)$ and $Q(4, -5)$.

  3. A segment has length $\sqrt{50}$ units with one endpoint $(1, 2)$ and the other $(x, 7)$. Find x.

Answer to Question 1: $d = 10$. Answer to Question 2: $d = 10$. Answer to Question 3: $x = 6$ or $x = -4$. If Question 3 gave a single value, check that you kept the $\pm$ when taking the square root (see Mistake 3).

Want a live Bhanzu trainer to walk your child through coordinate-geometry problems and the distance formula? Book a free demo class — online globally.

Book a Free Demo

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

Can a line segment have zero length?
Only if both endpoints land on the same point, $A = B$. That collapsed case is called a degenerate segment, a single point. In normal use the two endpoints are distinct.
Is the diagonal of a rectangle a line segment?
Yes. Every diagonal of any polygon is a segment joining two non-adjacent vertices.
How many line segments can pass between two points?
Exactly one. Two distinct points determine a single segment, and it is the shortest path between them.
What units measure a line segment?
Any length unit fits the scale of the problem, such as centimetres, metres, inches, or kilometres. The length is just the distance between the two endpoints.
What is a closed line segment versus an open one?
A closed segment includes both endpoints; an open segment excludes both; a half-open segment includes exactly one. School geometry almost always means the closed segment.
✍️ Written By
BT
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 →