A unit vector has length 1 and carries only direction. Unit vectors describe directions of forces, surface normals in 3D graphics, and the axes î, ĵ, k̂.
How to use the Unit Vector Calculator
- Dimension
- x
- y
- z
Results update as you type, and everything is calculated in your browser.
How it works
The magnitude is computed with the Pythagorean theorem and each component is divided by it. The zero vector has no direction, so it has no unit vector.
Inputs explained
| Field | What to enter |
|---|---|
| Dimension | Choose one: 2D, 3D |
| x | A number |
| y | A number |
| z | A number |
What each result means
- û – z = [z]÷sqrt([x]^2 + [y]^2 + [z]^2)
- Direction angle (2D) = mod(deg(atan2([y], [x])), 360)
Example values
How the main result changes when x changes and everything else stays at the example values above:
| x | û – x |
|---|---|
| 1.5 | 0.3511 |
| 2.25 | 0.4903 |
| 3 | 0.6 |
| 3.75 | 0.6839 |
| 4.5 | 0.7474 |
| 6 | 0.8321 |
Formula
û = (x/|u|, y/|u|, z/|u|), |u| = √(x² + y² + z²)
Worked example
Inputs — Dimension: 2D; x: 3; y: 4.
Results — û – x = 0.6; û – y = 0.8; Magnitude |u| = 5; Direction angle (2D) = 53.1301 °.
Key terms
- Unit vector
- A vector of length 1.
Frequently asked questions
What is the unit vector of (3, 4)?
(0.6, 0.8).
Why normalise a vector?
To separate direction from size, e.g. for lighting calculations or directions of forces.
Does the zero vector have a unit vector?
No – its length is zero.
What are î, ĵ and k̂?
The unit vectors along the x, y and z axes.