Vertical Line Test

Definitionnoun phrase

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.

In Spanish
prueba de la línea vertical
Also called
VLT, vertical line rule
Grade level
Algebra 1
Grade 8Algebra 1Algebra 2CCSS HSF-IF.A.1CCSS 8.F.A.1SATACTPSATACCUPLACERHiSET

Vertical Line Test in a picture

The vertical line test on two graphsLeft: an upward parabola; a dashed vertical line crosses it once, so it passes and is a function. Right: a parabola opening to the right; the vertical line x = 0 crosses it at (0, 2) and (0, negative 2), so it fails and is not a function.Passes: a functionevery vertical line hitsat most onceFails: not a functionx = 0 hits twice:(0, 2) and (0, −2)Slide a vertical line across the graph.Two or more crossings anywhere means oneinput has more than one output.
A vertical line fixes one input. If it ever hits the graph twice, that input has two outputs and the graph is not a function.

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

How to apply the vertical line test
Imagine a vertical line sweeping across the whole graph from left to right.
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?

Interactive

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.

This interactive needs JavaScript. The worked examples below show the same ideas step by step.

Vertical Line Test examples, step by step

Example 1: Points on a grid

Warm-up

Does the graph of the points (−2, 1), (0, 3), (2, 1), (0, −1) pass the vertical line test?

  1. A vertical line through x = 0 hits (0, 3) and (0, −1).
  2. 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

Core

Does the circle x2 + y2 = 25 pass the vertical line test? Use the line x = 3.

  1. Substitute x = 3: 9 + y2 = 25.
  2. y2 = 16, so y = 4 or y = −4.
  3. 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

Test-style

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?

  1. The only place to worry about is the vertical line x = 2.
  2. The open dot (2, 3) is not on the graph; only the closed dot (2, 5) is.
  3. 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

✗ Mistakey = x2 fails because the horizontal line y = 4 hits it at x = −2 and x = 2.
✓ InsteadUse vertical lines. Each one meets y = x2 once, so it is a function.

A horizontal line fixes an output. Two inputs sharing an output is allowed in a function.

✗ MistakeThe vertical line x = 6 is a function because it is a straight line.
✓ InsteadIt fails: the vertical line x = 6 itself meets every point of the graph, such as (6, 0) and (6, 1).

The input 6 has infinitely many outputs. All lines are functions except vertical ones.

✗ MistakeA closed dot at (1, 2) and an open dot at (1, 4) fail the test.
✓ InsteadThe open dot is not on the graph, so x = 1 meets it only at (1, 2): it passes.

An open circle means that point is left out. Count only points that belong to the graph.

Not to be confused with

Vertical Line Testvs.Horizontal line test

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).

Vertical Line Testvs.Relation

Every graph is a relation. The vertical line test sorts relations into functions and non-functions.

Quick check: 3 questions

Question 1 of 3

Which graph fails the vertical line test?

Show answer and explanation

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.

Question 2 of 3

A vertical line meets a graph at (5, 1) and (5, 7). What does this show?

Show answer and explanation

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.

Question 3 of 3

How many times does the vertical line x = 0 cross the circle x2 + y2 = 4?

Show answer and explanation

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.

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

  1. OpenStax, College Algebra 2e, 3.1 Functions and Function Notation
  2. 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

TermVertical Line Testsweep a vertical line
DefinitionIf any vertical line hits a graph more than once, it is not a function. A circle fails; y = x2 passes.
Study the full deck

Browse all terms in the Math Dictionary · More functions terms · Random term