Connect via MCP →

Enter Calculation

Leave z blank for a 2D vector.

Formula

Advertisement

Results

Unit Vector û
( 0.6, 0.8, 0 )
a vector of length 1 in the same direction
Magnitude |v| 5
Unit x 0.6
Unit y 0.8
Unit z 0

What Is a Unit Vector?

A unit vector is a vector with a magnitude (length) of exactly 1 that points in the same direction as the original vector. Converting a vector into its unit vector is called normalization. Unit vectors are essential in physics, computer graphics, machine learning, and engineering whenever you care about direction but not magnitude.

A vector and its unit vector pointing in the same direction with length one
A unit vector points the same way as the original vector but has length 1.

How to Use This Calculator

Enter the x and y components of your vector, and the z component if you are working in three dimensions (leave z blank or 0 for a 2D vector). The calculator computes the magnitude and divides each component by it to produce the unit vector.

The Formula Explained

First find the magnitude using the Pythagorean theorem extended to multiple dimensions: $$\lVert \vec{v} \rVert = \sqrt{v_x^{2} + v_y^{2} + v_z^{2}}$$ Then divide every component by that magnitude: $$\hat{u} = \left(\frac{v_x}{\lVert \vec{v} \rVert},\ \frac{v_y}{\lVert \vec{v} \rVert},\ \frac{v_z}{\lVert \vec{v} \rVert}\right)$$ The resulting vector always has length 1. A zero vector cannot be normalized because its magnitude is 0.

Advertisement
Right-triangle decomposition of a 2D vector into x and y components for magnitude
The magnitude is the length of the vector, found from its components via the Pythagorean theorem.

Worked Example

Take the vector \(\vec{v} = (3,\ 4,\ 0)\). The magnitude is $$\sqrt{3^{2} + 4^{2} + 0^{2}} = \sqrt{9 + 16} = \sqrt{25} = 5$$ Dividing each component by 5 gives the unit vector $$\hat{u} = \left(\frac{3}{5},\ \frac{4}{5},\ 0\right) = (0.6,\ 0.8,\ 0)$$ You can verify it: \(\sqrt{0.6^{2} + 0.8^{2}} = \sqrt{0.36 + 0.64} = \sqrt{1} = 1\). ✓

FAQ

Can the unit vector have length other than 1? No — by definition a unit vector always has a magnitude of exactly 1 (up to rounding).

What if my vector is (0,0,0)? The zero vector has no direction and a magnitude of 0, so it cannot be normalized; this tool returns zeros in that case.

Does this work for 2D vectors? Yes. Simply leave the z field at 0 and the calculator treats it as a 2D vector.

Last updated: