Vertical Line Equation — Formula, Examples & Rules
Vertical Line Equation
x = a, where a is the x-intercept.
Movie Clip (with narration)
![]() Vertical Line: how to find the equation (1.46M) |
See also
Undefined slope, slope-intercept, point-slope, standard form, two intercept, horizontal line
Key Formula
x=a
Where:
- x = The x-coordinate of every point on the line
- a = A constant equal to the x-intercept — the value where the line crosses the x-axis
Worked Example
Problem: Write the equation of the vertical line that passes through the point (5, 3).
Step 1: Identify the x-coordinate of the given point.
x=5
Step 2: Recall that a vertical line has the same x-coordinate for every point. The equation takes the form x = a.
x=a
Step 3: Substitute the x-coordinate of the given point for a.
x=5
Step 4: Verify: pick any other point on this line, such as (5, −2) or (5, 10). In each case, x = 5 holds true.
Answer: The equation of the vertical line is x = 5.
Another Example
This example starts with two points instead of one, and it shows how an undefined slope confirms the line is vertical.
Problem: Find the equation of the vertical line that passes through the points (−3, 7) and (−3, −4).
Step 1: Look at the x-coordinates of both points. Both have x = −3.
(−3,7) and (−3,−4)
Step 2: Because the x-coordinates are the same, the line through these points is vertical.
Step 3: Try computing the slope to confirm it is undefined.
m=−3−(−3)−4−7=0−11=undefined
Step 4: Write the equation using the shared x-value.
x=−3
Answer: The equation of the vertical line is x = −3.
Frequently Asked Questions
Why can't you write a vertical line in slope-intercept form (y = mx + b)?
Slope-intercept form requires a defined slope m. A vertical line has an undefined slope because the change in x is zero, which puts zero in the denominator of the slope formula. Since m does not exist as a real number, y = mx + b cannot represent a vertical line. That is why we use the special form x = a instead.
What is the slope of a vertical line?
The slope of a vertical line is undefined. When you apply the slope formula m = (y₂ − y₁)/(x₂ − x₁), the denominator equals zero because all points share the same x-coordinate. Division by zero is not defined, so the slope does not exist as a number.
What is the difference between a vertical line and a horizontal line equation?
A vertical line equation is x = a, where every point has the same x-coordinate, and the line goes up and down. A horizontal line equation is y = b, where every point has the same y-coordinate, and the line goes left and right. Vertical lines have undefined slope while horizontal lines have a slope of zero.
Vertical Line Equation vs. Horizontal Line Equation
| Vertical Line Equation | Horizontal Line Equation | |
|---|---|---|
| Formula | x = a | y = b |
| Direction | Runs up and down (parallel to y-axis) | Runs left and right (parallel to x-axis) |
| Slope | Undefined | Zero (m = 0) |
| Constant coordinate | Every point has the same x-value | Every point has the same y-value |
| Intercept | Crosses the x-axis at (a, 0); no y-intercept (unless a = 0) | Crosses the y-axis at (0, b); no x-intercept (unless b = 0) |
| Is it a function? | No — fails the vertical line test | Yes — passes the vertical line test |
Why It Matters
You encounter vertical lines whenever you graph boundaries, asymptotes, or lines of symmetry in algebra and precalculus. Recognizing a vertical line is also essential for understanding why not every relation is a function — a vertical line fails the vertical line test because it assigns multiple y-values to a single x-value. Being able to write x = a quickly saves time on tests and in problems involving parallel/perpendicular lines.
Common Mistakes
Mistake: Writing the vertical line through (5, 3) as y = 5 instead of x = 5.
Correction: Remember that a vertical line fixes the x-coordinate, so the equation is x = a. The equation y = 5 describes a horizontal line.
Mistake: Saying the slope of a vertical line is zero.
Correction: A slope of zero belongs to a horizontal line. A vertical line has an undefined slope because the run (change in x) is zero, which causes division by zero in the slope formula.
Related Terms
- Horizontal Line Equation — Counterpart equation where y is constant
- Undefined Slope — The slope type that vertical lines have
- x-intercept — The point where a vertical line crosses the x-axis
- Slope-Intercept Equation of a Line — Cannot represent vertical lines (requires defined slope)
- Point-Slope Equation of a Line — Another line form that also requires a defined slope
- Standard Form for the Equation of a Line — Can represent vertical lines when B = 0
- Two Intercept Form for the Equation of a Line — Requires both intercepts; cannot represent vertical lines with no y-intercept

