What Is the Equation of a Line Parallel to the Y-Axis?
The equation of a line parallel to the y-axis is $x = a$, where $a$ is a constant. It represents a straight line on which every single point has the same x-coordinate, equal to $a$, while the y-coordinate is free to take any value.
Geometrically, this line runs straight up and down. It never touches the y-axis (unless $a = 0$, which is the y-axis) and it crosses the x-axis at exactly one point, $(a, 0)$. Because it points in the same direction as the vertical line, it is one of the two "axis-parallel" special cases of the general equation of a straight line.
If $a > 0$, the line sits to the right of the y-axis.
If $a < 0$, the line sits to the left of the y-axis.
If $a = 0$, the line coincides with the y-axis itself, so its equation is $x = 0$.
How Do You Find the Equation of a Line Parallel to the Y-Axis?
You need just one piece of information: the x-coordinate of any point the line passes through. That single number is the whole equation.
The rule: a line parallel to the y-axis passing through the point $(a, b)$ has the equation $x = a$. The y-coordinate $b$ is ignored entirely, because the line stretches through every possible y-value at that fixed x-position.
Here is the reasoning in one line. On a vertical line the x-coordinate can never change - if it did, the line would tilt and stop being parallel to the y-axis. So the equation must lock x to a constant and say nothing about y. That is exactly what $x = a$ does.
This is different from the slope-based forms you meet first. You cannot use the slope-intercept form $y = mx + c$ here, because a vertical line has no defined slope $m$ to plug in. The equation $x = a$ is the form that steps in when slope fails.
Why Is the Slope of a Line Parallel to the Y-Axis Undefined?
Slope is the ratio $m = \dfrac{\Delta y}{\Delta x}$, the change in y divided by the change in x between two points. On a line parallel to the y-axis, every point shares the same x-coordinate, so $\Delta x = 0$ for any pair of points.
That forces a division by zero:
$$m = \frac{\Delta y}{\Delta x} = \frac{\Delta y}{0}$$
Division by zero has no value in mathematics, so the slope is undefined, not zero. A slope of zero would mean a flat, horizontal line; an undefined slope means a perfectly upright one. This is the single most important distinction in the whole topic, and mixing the two up is the most common error students make.
What Is the Equation of the Y-Axis Itself?
The y-axis is simply the vertical line for which the constant distance is zero, so its equation is $x = 0$. Every point on the y-axis, such as $(0, 5)$ or $(0, -3)$, has an x-coordinate of $0$, and that is the only condition the equation needs to state.
What Are the Properties of a Line Parallel to the Y-Axis?
Because a line parallel to the y-axis locks the x-coordinate to a constant, it carries a set of properties that set it apart from ordinary sloped lines.
Its equation is $x = a$. The single constant $a$ describes the whole line.
Every point shares the same x-coordinate. The y-coordinate is free to be any real value.
The slope is undefined. Computing it would require dividing by a zero change in x, so it has no numerical slope.
It is not a function. One x-value maps to infinitely many y-values, so it fails the vertical-line test.
It is perpendicular to the x-axis. The line meets the x-axis at a right angle, at the single point $(a, 0)$.
It never crosses the y-axis unless $a = 0$. When $a = 0$ the line is the y-axis; otherwise it runs parallel to it.
Its distance from the y-axis is $|a|$. The line sits $|a|$ units to the right if $a > 0$ and to the left if $a < 0$.
Two such lines are parallel. The distance between $x = a$ and $x = b$ is $|a - b|$.
Examples of the Equation of a Line Parallel to the Y-Axis
Example 1
Write the equation of the line parallel to the y-axis passing through the point $(4, 5)$.
The x-coordinate of the point is $4$. A line parallel to the y-axis keeps x constant, so we ignore the y-value.
Final answer: $x = 4$.
Example 2
A student is asked for the equation of the vertical line through $(-2, 7)$ and writes $y = -2$ - where did it go wrong?
Wrong path. The student sees the number $-2$ and, remembering "$y$ equals something", writes $y = -2$.
Why it breaks. The equation $y = -2$ is a horizontal line every point of which has y-coordinate $-2$ — it is parallel to the x-axis, not the y-axis. Testing the point $(-2, 7)$ gives $7 = -2$, which is false, so the point is not even on that line.
Correct. A line parallel to the y-axis fixes the x-coordinate. The point has x-coordinate $-2$, so the equation is $x = -2$. Check: the point $(-2, 7)$ satisfies $x = -2$. True.
Final answer: $x = -2$.
Example 3
Find the equation of the line parallel to the y-axis and $6$ units to the left of it.
"To the left of the y-axis" means a negative x-value. A distance of $6$ units to the left places the line at $x = -6$.
Final answer: $x = -6$.
Example 4
A line parallel to the y-axis has the same x-intercept as $3x + 5y - 15 = 0$. Find its equation.
First find where $3x + 5y - 15 = 0$ crosses the x-axis by setting $y = 0$: $$3x - 15 = 0$$ $$x = 5$$ So the x-intercept is $(5, 0)$. A line parallel to the y-axis through that x-value is $x = 5$.
Final answer: $x = 5$.
Example 5
Does the point $(7, -12)$ lie on the line $x = 7$? Does $(6, -12)$?
The line $x = 7$ contains every point whose x-coordinate is $7$, for any y-value. The point $(7, -12)$ has x-coordinate $7$, so it lies on the line. The point $(6, -12)$ has x-coordinate $6 \neq 7$, so it does not.
Final answer: $(7, -12)$ lies on the line; $(6, -12)$ does not.
Example 6
Find the distance between the two lines $x = -3$ and $x = 4$.
Both lines are parallel to the y-axis, so they are parallel to each other. The distance between two such vertical lines is the difference in their x-values: $$\text{distance} = |4 - (-3)| = |7| = 7 \text{ units}$$
Final answer: $7$ units.
Where Does the Equation x = a Show Up in the Real World?
A line parallel to the y-axis is the mathematics of perfect verticality - the reference every builder, surveyor, and navigator trusts to mean "straight up."
Construction and surveying. A plumb line, weighted by gravity, hangs along a true vertical. On a site drawing laid over a coordinate grid, that reference edge is exactly a line $x = a$. When a wall drifts even slightly off it, the whole structure carries the error upward.
Screen and pixel coordinates. In digital graphics, a vertical column of pixels shares one x-address; the column is the line $x = a$ in screen coordinates. Drawing a straight vertical bar in a chart is drawing this equation.
Latitude-style reference lines. Grid systems on maps use fixed vertical reference lines, and each one is a constant-x line in the local coordinate frame.
The stakes of getting "vertical" right are old and physical. Builders have used the plumb bob for the same purpose for thousands of years, and the entire idea of a fixed vertical and horizontal reference rests on a line whose x never changes. In coordinate geometry, that line is $x = a$.
Where Do Students Trip Up on Lines Parallel to the Y-Axis?
Mistake 1: Writing y = a instead of x = a
Where it slips in: The moment a student sees the number and reaches for the more familiar "$y =$" template.
Don't do this: Writing $y = 4$ for a line parallel to the y-axis through $(4, 5)$.
The correct way: Lines parallel to the y-axis fix the x-coordinate, so the equation is $x = 4$. A reliable check: the equation of a vertical line always begins with $x$. The rusher who pattern-matches "$y$ equals a number" produces a horizontal line by accident every time.
Mistake 2: Calling the slope zero instead of undefined
Where it slips in: Confusing "no tilt information" with "flat."
Don't do this: Saying the slope of $x = a$ is $0$.
The correct way: A slope of $0$ describes a horizontal line, $y = b$. A vertical line has an undefined slope because computing it requires dividing by $\Delta x = 0$. The second-guesser often knows one of these two facts is true and picks the wrong one under pressure - anchor it with the picture: flat means zero, upright means undefined.
Mistake 3: Trying to force x = a into y = mx + c
Where it slips in: Insisting every line must have a slope-intercept form.
Don't do this: Attempting to write $x = 5$ as $y = mx + c$.
The correct way: A vertical line cannot be expressed as $y = mx + c$ because it has no defined slope $m$ and no y-intercept in the usual sense. Its natural and complete form is simply $x = a$.
Conclusion
The equation of a line parallel to the y-axis is $x = a$, where $a$ is the fixed x-coordinate every point on the line shares.
You need only one number - the x-coordinate of any point on the line - to write its equation.
The slope is undefined (not zero), because finding it would require dividing by a zero change in x.
The y-axis itself is the special case $x = 0$.
The most common mistake is writing $y = a$ instead of $x = a$; the equation of a vertical line always starts with $x$.
To take coordinate geometry further with a teacher, explore Bhanzu's geometry tutor or a high school math tutor, or browse math classes online for guided straight-line practice.
Read More
Practice These to Solidify Your Understanding
Work through these problems in order:
Write the equation of the line parallel to the y-axis through $(-9, 3)$.
A line parallel to the y-axis sits $5$ units to the right of the y-axis. Give its equation.
Find the distance between $x = -2$ and $x = 6$.
Answer to Question 1: $x = -9$. Answer to Question 2: $x = 5$. Answer to Question 3: $8$ units.
Want a live Bhanzu trainer to walk through vertical and horizontal lines with you? Book a free demo class.
Was this article helpful?
Your feedback helps us write better content
