Skip to content
FiftyCalc Free calculators for all 50 states

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

Sample figures

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.

Unit Vector Calculator

x component: enter a number. Prefilled example: 3.

y component: enter a number. Prefilled example: 4.

z component (0 for 2D): enter a number. Prefilled example: 0.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. x component: enter a number.
  2. y component: enter a number.
  3. z component (0 for 2D): enter a number.
  4. 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

  1. M=x2+y2+z2
  2. Ux=xM+0
Symbols used in the formula
SymbolMeaning
xx component
yy component
zz component (0 for 2D)
MMagnitude |v| = √(x² + y² + z²)
UxUnit vector: x ÷ |v|

Worked example

x component3
y component4
z component (0 for 2D)0
Magnitude |v| = √(x² + y² + z²)5
Unit vector: y ÷ |v|0.8
Unit vector: z ÷ |v|0
  1. M=32+42+02=5
  2. Ux=35+0=0.6

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

Related calculators