Vector Magnitude Calculator

Find the magnitude of a 2D or 3D vector, its unit vector components and its direction angles from each axis.

Magnitude |v| 13
|v| = √(x² + y² + z²) · unit vector = v / |v|
Unit vector (0.23076923, 0.30769231, 0.92307692)
|v| = √(x² + y² + z²) · unit vector = v / |v|
Angle in the xy-plane from the x-axis 53.1301 °
|v| = √(x² + y² + z²) · unit vector = v / |v|
Unit vector x 0.2307692308
Unit vector y 0.3076923077
Unit vector z 0.9230769231
Angle from the z-axis 22.6199 °
Magnitude ignoring z 5

Everything you type here is processed on your own device. No input is sent to a server, logged, or stored.

What the Vector Magnitude Calculator does

Use this vector magnitude calculator to find the magnitude of a 2D or 3D vector, its unit vector components and its direction angles from each axis. Fill in all 3 fields and the result updates as you type — there is no Calculate button to press and no page reload. It is most often used for normalising a direction vector in graphics or game code. There are more free online tools on FreeToolStation.org.

How to use it

  1. Enter the x and y components of your vector.
  2. Enter the z component, or leave it at zero for a 2D vector.
  3. Read the magnitude and the unit vector.
  4. Use the direction angles if you need the vector expressed as a bearing or in spherical coordinates.

How it works

A vector's magnitude is its length, found by Pythagoras extended to as many dimensions as you have: square each component, add them, take the square root. The default values here give a magnitude of exactly 13, because (3, 4, 12) is one of the Pythagorean quadruples where the arithmetic comes out whole — 9 + 16 + 144 = 169.

Dividing a vector by its own magnitude produces the unit vector: same direction, length exactly 1. That operation is called normalising, and it is one of the most common lines of code in graphics and physics, because once a direction is separated from a length the two can be handled independently — point this way, go this far. The zero vector is the one case that fails, since it has no direction to preserve and the division is by zero.

The direction angles describe where the vector points. The xy-plane angle uses atan2 rather than plain arctangent, which matters: atan2 looks at the signs of both components and returns the correct angle in all four quadrants, where arctan(y/x) collapses opposite directions onto the same answer. The angle from the z-axis is the polar angle of spherical coordinates, and together the two angles locate any direction in space.

When to use it

  • Normalising a direction vector in graphics or game code.
  • Finding the speed from a 3D velocity vector.
  • Converting a vector into a bearing and elevation.
  • Checking the length of a displacement between two points.

Common mistakes to avoid

  • Adding the components instead of their squares. |(3,4)| is 5, not 7.
  • Using arctan(y/x) for the direction, which gives the same angle for (1,1) and (−1,−1). Use atan2.
  • Normalising a vector that might be zero without checking first, which produces NaN and quietly poisons every calculation downstream.

Frequently asked questions

What is the magnitude of the vector (3, 4, 12)?

Exactly 13. Squaring and adding gives 9 + 16 + 144 = 169, and √169 = 13.

What does normalising a vector mean?

Dividing it by its own length so the result has magnitude 1 while keeping the same direction. It lets you treat direction and distance as separate quantities.

Can a magnitude be negative?

No. It is a length, built from a sum of squares and a positive square root, so it is always zero or greater. Only the zero vector has magnitude zero.

Related tools

See all math & statistics calculators →