This calculator finds the unit vector in the direction of a 3D vector. Enter the x, y and z components; you get the three components of the unit vector û = v ÷ |v| and the length |v| of the original vector.
Formula
|v| = √(x² + y² + z²) and û = (x ÷ |v|, y ÷ |v|, z ÷ |v|).
- x, y, z: the components of v
- |v|: the magnitude (length) of v
- û: the unit vector, length 1, same direction as v
Worked Example
Take v = (2, 3, 6).
- |v| = √(4 + 9 + 36) = √49 = 7.0000
- ûx = 2 ÷ 7 = 0.2857
- ûy = 3 ÷ 7 = 0.4286
- ûz = 6 ÷ 7 = 0.8571
- Check: 0.2857² + 0.4286² + 0.8571² ≈ 1
How to read the result
A unit vector keeps only the direction. Use it to give a direction to a force or velocity of known size (multiply û by the size), to find direction cosines (the components of û are cos α, cos β and cos γ), or to project another vector onto this direction with a dot product.
Limits and common mistakes
- The zero vector has no direction, so it has no unit vector; the calculator shows Cannot compute.
- For a 2D vector, enter z = 0.
- Rounded components squared add to 1 only approximately.
Frequently Asked Questions
What is the unit vector of (3, 4, 0)?
(0.6, 0.8, 0), because the length is 5.
Is a unit vector always length 1?
Yes, by definition.
What are direction cosines?
The components of the unit vector: the cosines of the angles v makes with the x, y and z axes.
Does scaling v change its unit vector?
Not for a positive scale. A negative scale flips the unit vector.
Formula used
in x | x component | - | 2 | - in y | y component | - | 3 | - in z | z component | - | 6 | - out ux | Unit vector x | - | x / sqrt(x^2 + y^2 + z^2) | 4 out uy | Unit vector y | - | y / sqrt(x^2 + y^2 + z^2) | 4 out uz | Unit vector z | - | z / sqrt(x^2 + y^2 + z^2) | 4 out m | Length of v | - | sqrt(x^2 + y^2 + z^2) | 4
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
- Coordinate Rotation Calculator (2D)2.0981
- Convert to Spherical Coordinates Calculator1.7321
- Angle Between Two Planes Calculator63.6122 °
- Vector Cross Product Calculator (3D)-3.000