What is the vertical line test?
The vertical line test is a way to tell from a graph whether it shows a function: if any vertical line crosses the graph more than once, it is not a function. If every vertical line crosses it at most once, each input x has only one output y, so the graph is a function.
Vertical Line Test in a picture
Formal definition and notation
A set of points in the coordinate plane is the graph of a function of x if and only if every vertical line x = a meets the set in at most one point. Two points on one vertical line, (a, b1) and (a, b2) with b1 ≠ b2, would pair one input a with two outputs, which a function does not allow.
| Symbol | Read it as | Meaning |
|---|---|---|
| x = a | x equals a | the equation of a vertical line through the input a |
| (a, b1), (a, b2) | a comma b one, a comma b two | two points on the same vertical line: same input, different outputs |
Key facts
- The test works because a vertical line holds one x-value fixed; the crossings are that input’s outputs.
- Every non-vertical line passes. A vertical line such as x = 4 fails: one input, infinitely many outputs.
- Parabolas that open up or down pass; circles and parabolas that open sideways fail.
- At a jump in a piecewise graph, an open dot and a closed dot on the same vertical line still pass: the open dot is not part of the graph.
- The horizontal line test is different: it checks whether a function is one-to-one (has an inverse function).
How to apply the vertical line test
- 0 crossings
- fine: that x is just not in the domain
- 1 crossing
- fine: that x has exactly one output
- 2 or more
- fail: that x has several outputs, so the graph is not a function
One failing line anywhere is enough. Check carefully near vertical segments, closed and open dots, and the ends of curves.
Try it: pass or fail?
These points pass the test: no two share an x-value. Drag a point straight above or below another one and the set fails, because one input now has two outputs.
Vertical Line Test examples, step by step
Example 1: Points on a grid
Does the graph of the points (−2, 1), (0, 3), (2, 1), (0, −1) pass the vertical line test?
- A vertical line through x = 0 hits (0, 3) and (0, −1).
- That is two points on one vertical line.
Answer: No, it fails at x = 0, so it is not a function.
Example 2: A circle
Does the circle x2 + y2 = 25 pass the vertical line test? Use the line x = 3.
- Substitute x = 3: 9 + y2 = 25.
- y2 = 16, so y = 4 or y = −4.
- The line x = 3 crosses the circle at (3, 4) and (3, −4).
Answer: No. The line x = 3 meets the circle at y = -4 and y = 4, so the circle is not a function.
Example 3: A piecewise graph with a jump
A graph is the line y = x + 1 for x < 2, ending in an open dot at (2, 3), and the line y = 5 for x ≥ 2, starting with a closed dot at (2, 5). Is it a function?
- The only place to worry about is the vertical line x = 2.
- The open dot (2, 3) is not on the graph; only the closed dot (2, 5) is.
- So x = 2 meets the graph once, and every other vertical line meets it once too.
Answer: Yes, it passes the vertical line test and is a function, with f(2) = 5.
Common mistakes
A horizontal line fixes an output. Two inputs sharing an output is allowed in a function.
The input 6 has infinitely many outputs. All lines are functions except vertical ones.
An open circle means that point is left out. Count only points that belong to the graph.
Not to be confused with
The horizontal line test checks whether a function is one-to-one. y = x2 passes the vertical test (a function) but fails the horizontal test (not one-to-one).
Every graph is a relation. The vertical line test sorts relations into functions and non-functions.
Quick check: 3 questions
Which graph fails the vertical line test?
Answer: D. For x = y2, the line x = 4 meets (4, 2) and (4, −2). The line, the V-shaped absolute value graph and the upward parabola each meet every vertical line once.Show answer and explanation
A vertical line meets a graph at (5, 1) and (5, 7). What does this show?
Answer: A. Both points have input 5, with outputs 1 and 7, which breaks the function rule. The second choice swaps input and output, the third ignores the failure, and two points do not make the graph a vertical line.Show answer and explanation
How many times does the vertical line x = 0 cross the circle x2 + y2 = 4?
Answer: C. At x = 0, y2 = 4, so y = 2 or y = −2: two crossings, so the circle fails. 1 counts only the positive root, 0 forgets that the circle reaches x = 0, and 4 confuses the crossings with the right side.Show answer and explanation
Vertical Line Test: frequently asked questions
Why does the vertical line test work?
Every point on a vertical line has the same x-value. If the line crosses a graph at two points, those points share an input but have different outputs. A function allows only one output for each input, so two crossings prove the graph is not a function. One crossing or none never breaks the rule.
Does a horizontal line pass the vertical line test?
Yes. A horizontal line such as y = 3 is a function: every vertical line crosses it exactly once, and each input has the output 3. It is a constant function. Only vertical lines, such as x = 3, fail, because one input is paired with every possible output.
What is the difference between the vertical and horizontal line tests?
The vertical line test asks whether a graph is a function: each input must have one output. The horizontal line test asks whether a function is one-to-one: each output must come from one input. A function that passes both has an inverse that is also a function. The parabola y = x2 passes only the vertical test.
Practice and tools
Sources
- OpenStax, College Algebra 2e, 3.1 Functions and Function Notation
- Common Core State Standards, High School Functions: Interpreting Functions (HSF-IF.A.1)
Updated November 2026·Reviewed by the Effortless Math team·Standards: CCSS HSF-IF.A.1, CCSS 8.F.A.1
Cite this entry
Effortless Math Team. “Vertical Line Test.” Effortless Math Dictionary. Updated November 2026. https://www.effortlessmath.com/math-dictionary/vertical-line-test/
Flashcard
Browse all terms in the Math Dictionary · More functions terms · Random term