HomeMath › Vector Magnitude Calculator

Vector Magnitude Calculator

Find the magnitude (length) of a vector from its components. Enter x and y for a 2D vector, or add z for a 3D vector, to get |v|, the squared magnitude |v|², and the unit vector.

Example: with x component 3 · y component 4 · z component 12 → Magnitude |v|: 13.

  • Squared magnitude169 (|v|²)
  • Unit vector(0.2308, 0.3077, 0.9231)

Computed by the calculator below using its default values. Change any input to see your own numbers.

Magnitude |v|
Squared magnitude
Unit vector

|v| = √(x²+y²+z²). The squared magnitude skips the square root, which is handy in physics and machine-learning formulas where you compare lengths without needing the actual distance.

Why it is a Pythagorean sum

Magnitude generalizes the Pythagorean theorem. In 2D the components x and y are the legs of a right triangle and |v| is the hypotenuse, so |v| = √(x²+y²). In 3D the same logic stacks: the diagonal across the x-y plane combines with z to give |v| = √(x²+y²+z²). Every component contributes its square, never its raw value, which is why a small extra dimension can still add noticeable length.

When to keep the square

The squared magnitude |v|² avoids the square root entirely. Comparing which of two vectors is longer, minimizing distance in least-squares fitting, or computing kinetic energy all work fine on the squared value, and it is cheaper and exact for integer inputs. Reach for the actual magnitude only when you need the length in real units.

How it’s calculated

|v| = √(x²+y²+z²) with components taken as exact Cartesian coordinates. The squared magnitude is x²+y²+z². The unit vector divides each component by |v|; for the zero vector it is undefined because there is no direction to normalize.

A right-handed Cartesian frame; a 2D vector is handled as a 3D vector with z = 0.

Magnitudes of sample vectors

VectorMagnitude |v|
(3, 4)5
(5, 12)13
(3, 4, 12)13
(1, 2, 2)3
(2, 10, 11)15

Computed with |v| = √(x²+y²+z²).

Common mistakes

  • Adding the components instead of their squares — (3, 4) has magnitude 5, not 7.
  • Taking the square root of the sum before squaring each term.
  • Dropping the z component and treating a 3D vector as 2D.
  • Confusing |v| with |v|²: the squared magnitude of (3, 4) is 25, the magnitude is 5.

Frequently asked questions

What is the magnitude of a vector formula?

|v| = √(x²+y²+z²). Square each component, add the squares, and take the square root. In 2D just leave out the z term.

How do I find the magnitude of a 2D vector?

Use |v| = √(x²+y²). For example (3, 4) gives √(9+16) = √25 = 5, the length of the vector.

What is the squared magnitude used for?

It is |v|² = x²+y²+z², the magnitude without the square root. It is used to compare lengths and in physics and statistics formulas where the root cancels or is not needed.

Is magnitude the same as the norm?

Yes. The magnitude, length, and Euclidean norm of a vector all refer to the same quantity, |v|.