Updated: 09/15/2017 by Computer Hope
Diagram of X-axis, Y-axis, and Z-axis.

With a two and three-dimensional plane, a y-axis or vertical axis refers to a two- or three-dimensional object's vertical height. In the illustration, the y-axis plane moves up and down and intersects with the x-axis and z-axis.

An example of what uses the y-axis is a computer mouse. Moving the mouse up or down increases and decreases the y-axis value, allowing the computer to know where the mouse cursor is on the screen.

JavaScript y-axis mouse position

Below is a JavaScript that shows the mouse's x-axis and y-axis positions as you move your mouse pointer in the screen area.


If you're on a smartphone or tablet, tap your finger to get the position of the tap.

Mouse x-axis position.
Mouse y-axis position.

Other examples of a y-axis

Below are a few other examples of how the y-axis is used on a computer.

  • Help position and keep track of the mouse cursor on the screen.
  • A character or another object in a computer game moving up and down on the screen has a y-axis value determining its location.
  • With a chart, the y-axis is the data expressed vertically. The higher a data point is represented vertically, the greater the value of the data which corresponds with that point on the x-axis.
  • In computer graphics, if you want to draw a vertical line, use the y-axis to determine the start and end points of the line. Drawing a two-dimensional object requires only the x-axis and y-axis. However, a 3D object requires a z-axis.
  • Other input devices like a joystick also use a y-axis to control objects like a tank or airplane.

Absolute coordinates, Axis, x-axis, z-axis