Home › Learning Resources › Maths › Line Segment: Definition, Formula, Examples & Difference from Line and Ray

Line Segment: Definition, Formula, Examples & Difference from Line and Ray

What is a line segment, how many endpoints does it have, and how do you find its length and midpoint? A complete, diagram-based guide to one of geometry's most fundamental building blocks.

Maths 01 October, 2026 13 min read

1. What Is a Line Segment?

In geometry, a line segment is a straight path between two specific points, called endpoints. It includes every point that lies between those two endpoints, plus the endpoints themselves. Because it stops at both ends, a line segment has a definite, measurable length — unlike a full line, which never ends.

A line segment from point A to point B is written as segment AB, often shown with a small bar over the letters: A̅B̅. The order of the letters doesn't change the segment itself — segment AB and segment BA refer to the same set of points.

A Line Segment Has Two Endpoints A B Length of segment AB — a fixed, measurable distance

Figure 1: Line segment AB, bounded by two endpoints A and B, with a definite measurable length between them.

2. Point, Line, Line Segment, and Ray

A line segment is best understood alongside the three other basic building blocks of geometry: the point, the line, and the ray. Together, these four concepts form the foundation for everything else in geometry.

Point, Line, Line Segment, and Ray POINT P An exact location — no length, width, or size LINE A B Extends infinitely both ways — no endpoints LINE SEGMENT A B Two endpoints — fixed, measurable length RAY A B One endpoint — extends infinitely in one direction

Figure 2: A point marks a location, a line extends infinitely both ways, a line segment has two fixed endpoints, and a ray has one endpoint and extends infinitely in one direction.

ConceptEndpointsLengthNotation
PointN/A (it is a location)None — zero dimensionsPoint P
Line0 (extends forever both ways)Infinite / undefinedLine AB (with arrows), or ⟷AB
Line Segment2 (fixed start and end)Fixed, measurableSegment AB, or A̅B̅
Ray1 (starts, never ends)Infinite in one directionRay AB, or →AB (starts at A)

3. Line vs Line Segment — Key Differences

This is one of the most searched questions on the topic: what is the difference between a line and a line segment? The answer comes down entirely to endpoints and length.

Line

Extends infinitely in both directions. Has no endpoints and no measurable length. Drawn with arrowheads on both ends to show it continues forever.

Line Segment

A finite piece of a line, bounded by two endpoints. Has a fixed, measurable length. Drawn as a simple straight path with no arrowheads — it clearly stops at both ends.

A Simple Way to Remember It

Think of a line as an endless road with no beginning or end, while a line segment is like a single fence panel — it has a clear start, a clear finish, and you can measure exactly how long it is.

4. Length of a Line Segment — Formula & Examples

When a line segment's endpoints are placed on a coordinate plane, its length can be calculated precisely using the distance formula, which comes directly from the Pythagorean theorem.

Length of a Line Segment (Distance Formula)

Length = √[(x₂ − x₁)² + (y₂ − y₁)²]

Where (x₁, y₁) and (x₂, y₂) are the coordinates of the two endpoints

Length of a Line Segment Uses the Pythagorean Theorem A (x₁, y₁) B (x₂, y₂) Length AB (x₂ − x₁) (y₂ − y₁)

Figure 3: The line segment AB is the hypotenuse of a right triangle; the horizontal and vertical legs are the coordinate differences used in the distance formula.

Worked Example — Finding the Length of a Line Segment
Question

Find the length of the line segment joining points A(2, 3) and B(6, 6).

Solution

Length = √[(6−2)² + (6−3)²] = √[(4)² + (3)²] = √[16 + 9] = √25 = 5 units

5. Midpoint of a Line Segment — Formula & Examples

The midpoint of a line segment is the point exactly halfway between its two endpoints, splitting the segment into two equal lengths.

Midpoint Formula

Midpoint = ( (x₁ + x₂)/2 , (y₁ + y₂)/2 )

Average the x-coordinates and average the y-coordinates separately

Worked Example — Finding the Midpoint
Question

Find the midpoint of the line segment joining points A(2, 3) and B(6, 6).

Solution

Midpoint = ( (2+6)/2 , (3+6)/2 ) = ( 8/2 , 9/2 ) = (4, 4.5)

6. Perpendicular Bisector of a Line Segment

A perpendicular bisector is a line that crosses a line segment at exactly its midpoint, forming a 90° angle with it. It cuts the segment into two equal halves and, importantly, every point on the perpendicular bisector is the same distance from both endpoints of the original segment.

Perpendicular Bisector of a Line Segment A B M (midpoint) Perpendicular bisector Crosses AB at 90° exactly at its midpoint — AM = MB

Figure 4: The perpendicular bisector crosses segment AB at a right angle, exactly at the midpoint M, where AM = MB.

Why Perpendicular Bisectors Matter

Perpendicular bisectors are used throughout geometry — to construct the circumcenter of a triangle (the point equidistant from all three vertices), to find the center of a circle passing through given points, and in many compass-and-straightedge constructions.

7. Congruent Line Segments

Two line segments are called congruent when they have exactly the same length, regardless of their position or orientation in space. Congruent segments are marked with identical tick marks in diagrams to show they are equal without stating the exact measurement.

TermMeaning
Congruent line segmentsTwo or more segments with equal length, written as AB ≅ CD
Segment bisectorAny line, ray, or segment that passes through the midpoint of a segment, dividing it into two equal parts
Oblique line segmentA line segment that is neither horizontal nor vertical — it runs at a slant

8. How Line Segments Relate — Parallel, Perpendicular & Intersecting

When two or more line segments or lines are drawn in the same plane, they can relate to each other in a few standard ways.

Parallel Lines

Lines or segments that never meet, no matter how far extended — they maintain a constant distance apart.

Perpendicular Lines

Lines or segments that intersect at exactly a 90° angle.

Intersecting Lines

Lines or segments that cross each other at exactly one point, at any angle.

Skew Lines

Lines that do not intersect and are not parallel — possible only in three-dimensional space, since they lie in different planes.

Where Angles Come In

When two line segments meet at a point (called a vertex), they form an angle. Depending on the angle's measure, it is classified as acute (less than 90°), right (exactly 90°), obtuse (between 90° and 180°), or straight (exactly 180°) — all built from the same basic line segments covered in this article.

9. Real-World Examples of Line Segments

Everyday Examples of Line Segments

  • The edge of a ruler, book, or table — a fixed, measurable length
  • Each side of a triangle, square, or any polygon
  • A road between two specific towns on a map
  • The hands of a clock, from the center to the tip
  • A fence panel between two posts
  • The diagonal of a rectangular picture frame

Frequently Asked Questions (FAQ)

A line segment is a part of a line bounded by two distinct endpoints. Unlike a line, which extends infinitely in both directions, a line segment has a fixed, measurable length because it starts at one point and ends at another. It is one of the most basic building blocks in geometry, used to form the sides of shapes like triangles, squares, and polygons.

A line extends infinitely in both directions and has no endpoints, so it has no measurable length. A line segment is a finite portion of a line with two fixed endpoints, which gives it a definite, measurable length. In notation, a line through points A and B is written as line AB with arrows on both ends, while a line segment is written as segment AB with no arrows, since it stops at A and B.

A line segment has exactly two endpoints, one at each end, which define where the segment begins and ends. These two endpoints are what distinguish a line segment from a line, which has no endpoints, and from a ray, which has exactly one endpoint and extends infinitely in only one direction.

The length of a line segment with endpoints (x1, y1) and (x2, y2) on a coordinate plane is found using the distance formula: Length = square root of [(x2 − x1)^2 + (y2 − y1)^2]. This formula comes directly from the Pythagorean theorem, treating the horizontal and vertical differences between the two points as the legs of a right triangle and the line segment as the hypotenuse.

The midpoint of a line segment with endpoints (x1, y1) and (x2, y2) is given by the formula: Midpoint = ((x1 + x2)/2, (y1 + y2)/2). This formula finds the point exactly halfway between the two endpoints by averaging their x-coordinates and averaging their y-coordinates separately.

A perpendicular bisector of a line segment is a line (or line segment) that crosses the original segment at a 90-degree angle exactly at its midpoint, dividing it into two equal halves. Every point on a perpendicular bisector is equidistant from both endpoints of the original line segment, a property used frequently in geometric constructions and proofs.

A line extends infinitely in both directions with no endpoints. A line segment has two endpoints and a fixed, measurable length. A ray has exactly one endpoint and extends infinitely in only one direction, like a beam of light starting at a source. All three are made up of points and are fundamental concepts in geometry, but they differ in whether and how many endpoints they have.