Vector Magnitude Calculator

Find the magnitude (length) of a 2D to 6D vector, its unit vector and the Manhattan length, with each step shown. |u| = √(u₁² + u₂² + … + uₙ²), a generalisation of the Pythagorean theorem. Example: with vector 2 3 6, the result is Magnitude |u| = 7.

Last updated · By · Runs in your browser, nothing is uploaded

Result

Step-by-Step Solution

Enter your values above to see the full working.

How do you use the Vector Magnitude Calculator?

Enter a vector with two to six components. The calculator squares and adds the components, takes the square root for the magnitude and divides the vector by its length to give the unit vector. For 2D vectors it also gives the direction angle.

What formula does the Vector Magnitude Calculator use?

|u| = √(u₁² + u₂² + … + uₙ²), a generalisation of the Pythagorean theorem. The unit vector in the same direction is u/|u|, and it has length exactly 1.

Worked example: Vector 2 3 6

For u = (2, 3, 6): 4 + 9 + 36 = 49, so |u| = 7. The unit vector is (2/7, 3/7, 6/7) = (0.2857, 0.4286, 0.8571). The 2D vector (3, 4) has length 5 and points at 53.13°.

With the default values the calculator returns Magnitude |u| = 7; Squared magnitude = 49; Unit vector u/|u| = (0.285714, 0.428571, 0.857143); Manhattan length (sum of |components|) = 11.

Where Is This Calculation Used?

Magnitudes give distances, speeds (the magnitude of velocity) and forces. Normalising to a unit vector separates direction from size, which is used in graphics lighting, physics simulation and cosine similarity.

Speed is the magnitude of velocity, so a velocity of (3, 4) m/s is a speed of 5 m/s. In machine learning the magnitude is called the L2 norm, and the Manhattan length shown here is the L1 norm (the sum of absolute values). The unit vectors i, j and k each have magnitude 1, and magnitudes obey the triangle inequality: |u + v| is never larger than |u| + |v|, with equality only when the vectors point the same way.

What are the most common mistakes with the Vector Magnitude Calculator?

  • Forgetting to take the square root.
  • Adding the components instead of their squares.
  • Trying to normalise the zero vector.

What Is the Tested Example for the Default Values?

This example is computed by the same code that powers the calculator above, so you can compare it with your own numbers or a textbook answer.

Input: Vector2 3 6
Magnitude |u|7
Squared magnitude49
Unit vector u/|u|(0.285714, 0.428571, 0.857143)
Manhattan length (sum of |components|)11
Direction angle (2D only)only for 2D vectors

Where Can You Verify These Formulas?

The definitions and formulas on this page follow standard references. Check them against these sources:

Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.

Frequently Asked Questions

How do you find the magnitude of a vector?

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

What is a unit vector?

A vector of length 1, obtained by dividing a vector by its magnitude.

What is the magnitude of (3, 4)?

5.