Strip a vector down to pure direction — divide by its own magnitude, and length one is all that's left.
10 min read5 worked examples
What a unit vector is
A unit vector is any vector with magnitude exactly $1$. Unit vectors carry pure directional information — no sense of length or scale, only "which way." The vectors $\mathbf{i}$, $\mathbf{j}$ and $\mathbf{k}$ are themselves unit vectors, each of magnitude $1$ along its own axis; but a unit vector can point in any direction, not just along an axis.
Given any non-zero vector $\mathbf{a}$, the unit vector in the same direction as $\mathbf{a}$, written $\hat{\mathbf{a}}$, is found by dividing $\mathbf{a}$ by its own magnitude:
This works identically in 2D and 3D — the formula never refers to the number of components, only to the magnitude, so it applies unchanged regardless of dimension.
Proofâ really does have magnitude 1
1
Dividing a vector by a positive scalar $k$ scales its magnitude by the same factor: $|k\mathbf{a}| = k|\mathbf{a}|$ for $k>0$.
Scalar multiplication scales every component, and hence the magnitude, by |k|.
2
Here $\hat{\mathbf{a}} = \dfrac{1}{|\mathbf{a}|}\,\mathbf{a}$, a scalar multiple of $\mathbf{a}$ with $k=\dfrac{1}{|\mathbf{a}|}>0$.
Since |a| is a positive number (a is non-zero), 1/|a| is a valid positive scalar.
Apply the scaling rule from step 1 with k = 1/|a|.
4
Since $k>0$, $\hat{\mathbf{a}}$ points in exactly the same direction as $\mathbf{a}$ — only its length has changed.
A positive scalar multiple never reverses direction.
▪ proven
The zero vector is the one exception
The formula $\hat{\mathbf{a}}=\mathbf{a}/|\mathbf{a}|$ breaks down for the zero vector, since $|\mathbf{0}|=0$ and division by zero is undefined. The zero vector has no direction to speak of, so it simply has no associated unit vector.
Worked example 1
Finding a unit vector in 2D
Find the unit vector in the direction of $\mathbf{a} = 5\mathbf{i}-12\mathbf{j}$.
MethodFind the magnitude, then divide every component by it
Confirms the scaled vector really does have magnitude 20.
▪ solved
The general pattern
To find the vector of any magnitude $m$ in the direction of $\mathbf{a}$, compute $m\hat{\mathbf{a}} = m\left(\dfrac{\mathbf{a}}{|\mathbf{a}|}\right)$ — find the unit vector first, then scale. This single two-step process (unit vector, then scale) solves every "vector of magnitude ... in the direction of ..." question, in 2D or 3D alike.
Worked example 4
Finding an unknown component of a unit vector · Challenge
Given that $\mathbf{u} = \dfrac{1}{7}(3\mathbf{i}+p\mathbf{j}+6\mathbf{k})$ is a unit vector, where $p>0$, find the exact value of $p$.
MethodUse the defining property |u| = 1 to form an equation in p
1
Since $\mathbf{u}$ is a unit vector, $|\mathbf{u}|=1$, so $|\mathbf{u}|^2=1$.
Squaring avoids working with a square root directly.
The negative root p = −2 is rejected by the given condition.
▪ solved
Look deeper — a different kind of equation
Unlike a "find t given the magnitude" question with an arbitrary target magnitude, a unit-vector condition always sets the sum of squares of the components (before dividing) equal to the square of whatever overall scale factor sits outside the bracket — here $7^2=49$. Spotting this shortcut saves re-deriving the magnitude formula from scratch each time.
The angle a vector makes with each axis
Every non-zero 3D vector makes some angle with each of the three coordinate axes — call these the vector's direction angles, $\alpha$ (to the x-axis), $\beta$ (to the y-axis) and $\gamma$ (to the z-axis). Since $\mathbf{i}$, $\mathbf{j}$, $\mathbf{k}$ are themselves unit vectors along those axes, the angle between $\mathbf{a}$ and, say, the x-axis can be found from the dot product $\mathbf{a}\cdot\mathbf{i} = |\mathbf{a}||\mathbf{i}|\cos\alpha = |\mathbf{a}|\cos\alpha$ — but $\mathbf{a}\cdot\mathbf{i}$ is simply $\mathbf{a}$'s x-component, since the dot product with $\mathbf{i}$ just picks that component out. This gives a clean formula for each angle, straight from the components of $\mathbf{a}=x\mathbf{i}+y\mathbf{j}+z\mathbf{k}$:
The direction angles α, β, γ that a vector $\mathbf{a}$ makes with the x-, y- and z-axes respectively.
Worked example 5
Finding the angle to each axis
(a) Find, to 1 decimal place, the angles that $\mathbf{a}=\mathbf{i}+2\mathbf{j}+2\mathbf{k}$ makes with each of the x, y and z axes. (b) The vector $\mathbf{b}=6\mathbf{i}-2\mathbf{j}-3\mathbf{k}$ makes an obtuse angle with one of the axes. Identify which axis, and find that angle to 1 decimal place.
MethodFind |a|, then apply cosα = x/|a| (and similarly for β, γ)
Confirms the three angles via the direction-cosine identity.
4
(b) $|\mathbf{b}| = \sqrt{6^2+(-2)^2+(-3)^2}=\sqrt{49}=7$. The y- and z-components are negative, so $\cos\beta=-\tfrac27$ and $\cos\gamma=-\tfrac37$ are both negative.
A negative component means a negative cosine for that axis's angle.
5
The most negative cosine gives the largest (most obtuse) angle: $\cos\gamma=-\tfrac37$ is more negative than $\cos\beta=-\tfrac27$, so the angle to the z-axis is the obtuse one, with $\gamma = \arccos\left(-\tfrac37\right) = 115.4°$.
arccos is a decreasing function, so the most negative cosine corresponds to the largest angle.
▪ solved
Why a negative component means an obtuse angle
Since $\cos(\text{angle})=(\text{component})/|\mathbf{a}|$ and $|\mathbf{a}|$ is always positive, the sign of $\cos\alpha,\cos\beta,\cos\gamma$ matches the sign of the corresponding component exactly. A negative cosine corresponds to an angle between $90°$ and $180°$ — so whenever a component is negative, the vector leans away from that axis's positive direction, and the angle to it is obtuse.
Common mistake
Dividing only the first component by the magnitude, and leaving the rest unchanged. Every single component — all two of them in 2D, all three in 3D — must be divided by $|\mathbf{a}|$; skipping components produces a vector that isn't parallel to the original one at all, let alone a unit vector.
Check yourself
Find the unit vector in the direction of $\mathbf{c}=6\mathbf{i}+2\mathbf{j}-3\mathbf{k}$, and hence find the vector of magnitude $35$ in the same direction as $\mathbf{c}$. (Hint: find |c| first, divide to get ĉ, then scale ĉ by 35.)