Unit Vector Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter the components of a vector (z = 0 for a 2D vector) to get its magnitude and the unit vector with the same direction.
Result
Unit vector: x ÷ |v|
Unit vector: y ÷ |v|
- Unit vector: z ÷ |v|
- Magnitude |v| = √(x² + y² + z²)
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- x component: enter a number.
- y component: enter a number.
- z component (0 for 2D): enter a number.
- Read the result: Unit vector: x ÷ |v|; the panel also shows Magnitude |v| = √(x² + y² + z²), Unit vector: y ÷ |v| and Unit vector: z ÷ |v|.
How this calculator works
A unit vector has length 1. Dividing a vector v by its magnitude gives the unit vector û = v ÷ |v| with the same direction, where |v| = √(x² + y² + z²) is the Euclidean norm.
The zero vector has no direction, so it has no unit vector and the calculator shows dashes. The components of a unit vector are also the cosines of the angles it makes with the x, y and z axes (its direction cosines).
The formula
| Symbol | Meaning |
|---|---|
| x component | |
| y component | |
| z component (0 for 2D) | |
| Magnitude |v| = √(x² + y² + z²) | |
| Unit vector: x ÷ |v| |
Worked example
| x component | 3 |
|---|---|
| y component | 4 |
| z component (0 for 2D) | 0 |
| Magnitude |v| = √(x² + y² + z²) | 5 |
|---|---|
| Unit vector: y ÷ |v| | 0.8 |
| Unit vector: z ÷ |v| | 0 |
Unit vector: x ÷ |v| 0.6
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What is the unit vector of (3, 4)?
Its magnitude is 5, so the unit vector is (0.6, 0.8).
What is the unit vector of (1, 2, 2)?
Its magnitude is 3, so the unit vector is (1/3, 2/3, 2/3) ≈ (0.3333, 0.6667, 0.6667).