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.
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.
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.