Ma · Mathematics

How Do You Normalize a Vector and Find Its Magnitude?

Published By the 9to5Science editorial team

At a glance

  1. 1. Find the magnitude

    Square each component, add the squares, and take the square root.

  2. 2. Check for zero

    A zero vector has no direction, so it cannot be normalized.

  3. 3. Divide by magnitude

    For a nonzero vector, divide every component by its magnitude.

  4. 4. Verify the result

    The normalized vector points the same way and has magnitude one.

A vector’s magnitude is its length, while normalizing a vector means rescaling it to have length 1 without changing its direction. These operations are related, but they are not the same: first find the magnitude, then divide the vector by it.

This article uses the standard Euclidean length in ordinary Cartesian coordinates. If a problem specifies a different norm or an inner product, use that definition of length instead.

Magnitude of a vector

For a vector with components v=(v1,v2,…,vn)\mathbf{v}=(v_1,v_2,\ldots,v_n), its Euclidean magnitude (also called its norm) is

∥v∥=v12+v22+⋯+vn2.\|\mathbf{v}\|=\sqrt{v_1^2+v_2^2+\cdots+v_n^2}.

In three dimensions, if v=(x,y,z)\mathbf{v}=(x,y,z), this becomes

∥v∥=x2+y2+z2.\|\mathbf{v}\|=\sqrt{x^2+y^2+z^2}.

The magnitude is a nonnegative scalar, not a vector. It measures how long the vector is, regardless of which direction it points. The notation ∥v∥\|\mathbf{v}\| is common; some texts also write ∣v∣|\mathbf{v}|.

How to normalize a vector

For any nonzero vector v\mathbf{v}, its normalized vector, or unit vector, is

v^=v∥v∥.\widehat{\mathbf{v}}=\frac{\mathbf{v}}{\|\mathbf{v}\|}.

Dividing a vector by a scalar means dividing each component by that scalar. The result has the same direction as the original, but its magnitude is 1. You can check this directly:

∥v^∥=∥v∥v∥∥=∥v∥∥v∥=1.\left\|\widehat{\mathbf{v}}\right\| =\left\|\frac{\mathbf{v}}{\|\mathbf{v}\|}\right\| =\frac{\|\mathbf{v}\|}{\|\mathbf{v}\|}=1.

The formula requires ∥v∥≠0\|\mathbf{v}\|\ne 0. The zero vector has no direction and would require division by zero, so it has no normalized version.

Worked example

Normalize v=(3,−4,12)\mathbf{v}=(3,-4,12).

First find its magnitude:

∥v∥=32+(−4)2+122=9+16+144=169=13.\|\mathbf{v}\|=\sqrt{3^2+(-4)^2+12^2} =\sqrt{9+16+144} =\sqrt{169}=13.

Now divide each component by 13:

v^=113(3,−4,12)=(313,−413,1213).\widehat{\mathbf{v}} =\frac{1}{13}(3,-4,12) =\left(\frac{3}{13},-\frac{4}{13},\frac{12}{13}\right).

Check its magnitude:

∥v^∥=(313)2+(−413)2+(1213)2=169169=1.\left\|\widehat{\mathbf{v}}\right\| =\sqrt{\left(\frac{3}{13}\right)^2+\left(-\frac{4}{13}\right)^2+\left(\frac{12}{13}\right)^2} =\sqrt{\frac{169}{169}}=1.

The negative second component stays negative. Normalization changes the vector’s length, not its direction or the signs of its components.

Recovering a vector from its direction and magnitude

A nonzero vector can be written as its magnitude times its unit direction:

v=∥v∥v^.\mathbf{v}=\|\mathbf{v}\|\widehat{\mathbf{v}}.

For the example, multiplying the unit vector by 13 gives back (3,−4,12)(3,-4,12). This is useful when a problem gives a direction and a length separately. For instance, a vector of magnitude 5 in the direction of (3,4)(3,4) is

5(35,45)=(3,4).5\left(\frac{3}{5},\frac{4}{5}\right)=(3,4).

Common mistakes

  • Treating magnitude and normalization as the same thing. Magnitude is a number; normalization produces a vector.
  • Dividing by the squared magnitude. Divide by ∥v∥\|\mathbf{v}\|, not by ∥v∥2\|\mathbf{v}\|^2. The latter generally will not produce a unit vector.
  • Forgetting to square negative components. For example, (−4)2=16(-4)^2=16, not −16-16.
  • Trying to normalize the zero vector. Its magnitude is zero, so the normalization formula is undefined.
  • Assuming normalization always means Euclidean length. In spaces with a specified alternative norm, the unit vector is defined relative to that norm.

Magnitude is not the same as component-wise absolute value

For a vector, the magnitude combines all components using the norm formula. It is not usually found by taking the absolute value of each component and adding them. For example, the Euclidean magnitude of (3,4)(3,4) is 32+42=5\sqrt{3^2+4^2}=5, whereas the sum of the absolute component values is 7. That sum is a different quantity, called the L1L^1 norm.

Use the norm specified in your problem. When no alternative is stated in standard Cartesian geometry, the Euclidean magnitude is the expected interpretation.

References

  1. Introduction to Linear Algebra, Gilbert Strang

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.