Math

Unit vector calculator

A unit vector points in the same direction as a given vector but has a length of exactly 1. Enter a 2D or 3D vector to normalize it: the unit vector calculator divides each component by the vector’s length and shows the result as decimals and as exact fractions or radicals, along with the length and the angle to each axis.

Runs in your browser. Nothing you type is sent to us.

Unit vector (û)

⟨0.230769, 0.307692, 0.923077⟩

û = ⟨3/13, 4/13, 12/13⟩

Magnitude |v|
13
Length of û (check)
1
Angle with the x-axis
76.6576°
Angle with the y-axis
72.0798°
Angle with the z-axis
22.6199°

Key facts

  • Unit vector û = v ÷ |v|: divide every component by the vector’s length.
  • For v = ⟨3, 4, 12⟩, |v| = 13, so û = ⟨3/13, 4/13, 12/13⟩ ≈ ⟨0.231, 0.308, 0.923⟩.
  • For v = ⟨3, 4⟩, |v| = 5 and û = ⟨0.6, 0.8⟩.
  • The components of a unit vector are its direction cosines: the cosines of the angles it makes with the x, y and z axes.
  • The zero vector has no direction, so it cannot be normalized.

Why normalize a vector?

Many formulas only care about direction. Normalizing strips away the length so that a vector says "which way" and nothing else. Unit vectors appear in lighting calculations in 3D graphics, in directional derivatives, in physics (the direction of a force or field) and whenever you need to scale a direction to a specific length: multiply the unit vector by that length.

How to use the unit vector calculator

  1. Choose 2D or 3D.
  2. Enter the components of your vector.
  3. Read the unit vector in decimals, its exact form, the original length, a check that the result has length 1 and the angle to each axis.

Formula for unit vectors

|v| = √(v₁² + v₂² + v₃²)
û = ⟨v₁ ÷ |v|, v₂ ÷ |v|, v₃ ÷ |v|⟩

Worked examples: unit vectors

Example 1: a 3D vector

v = ⟨3, 4, 12⟩. |v| = √(9 + 16 + 144) = √169 = 13. û = ⟨3/13, 4/13, 12/13⟩ ≈ ⟨0.2308, 0.3077, 0.9231⟩.

Example 2: a 2D vector

v = ⟨3, 4⟩. |v| = 5, so û = ⟨3/5, 4/5⟩ = ⟨0.6, 0.8⟩.

Example 3: a radical answer

v = ⟨1, 1⟩. |v| = √2, so û = ⟨1/√2, 1/√2⟩ = ⟨√2/2, √2/2⟩ ≈ ⟨0.7071, 0.7071⟩. The calculator writes the exact form with a rationalized denominator.

Example 4: a vector of a given length

To get a vector of length 10 in the direction of ⟨3, 4⟩, multiply its unit vector by 10: 10 × ⟨0.6, 0.8⟩ = ⟨6, 8⟩.

Direction cosines and angles

The components of û are cos α, cos β and cos γ, where α, β and γ are the angles between v and the x, y and z axes. For ⟨3, 4, 12⟩, γ = arccos(12/13) ≈ 22.62°, so the vector leans close to the z-axis. The squares of the direction cosines always add up to 1.

Standard unit vectors

NameVectorDirection
i⟨1, 0, 0⟩x-axis
j⟨0, 1, 0⟩y-axis
k⟨0, 0, 1⟩z-axis

Any vector can be written as a combination of these: ⟨3, 4, 12⟩ = 3i + 4j + 12k.

Pitfalls with unit vectors

  • Dividing by the sum of the components instead of the length.
  • Forgetting to square negative components (their squares are positive).
  • Normalizing the zero vector, which has no direction.

Where unit vectors are used

In 3D graphics, surface normals and light directions are stored as unit vectors so that a single dot product gives the cosine of the lighting angle. In physics, a unit vector gives the direction of a force or field while a separate number gives its strength. In navigation, a heading is a unit vector that you scale by speed and time to get a displacement.

For the length on its own, use the vector magnitude calculator. To compare directions, the dot product calculator gives cos θ directly when both vectors are unit vectors.

Unit vectors, hats and a famous video game hack

A unit vector has length 1 and keeps only direction. You get one by normalizing: divide a vector by its magnitude. The standard basis vectors are written î, ĵ and k̂, a notation descended from William Rowan Hamilton’s quaternion units i, j and k of 1843. The components of a unit vector are its direction cosines, the cosines of the angles it makes with each axis.

Normalizing vectors is so common in 3D graphics that programmers once invented a famous shortcut for it. Lighting needs unit-length surface normals, and dividing by a square root was slow on 1990s hardware. The source code of id Software’s Quake III Arena (1999), released publicly in 2005, contained the fast inverse square root, which estimated 1 ÷ √x using bit manipulation and the mysterious constant 0x5F3759DF, followed by one step of Newton’s method. Modern processors have dedicated instructions for this, but the trick is still a celebrated piece of programming history. Unit vectors also describe directions in physics, navigation headings and robot motion, and they appear in the normal vector of every plane equation. In US high schools, vectors are part of the advanced Common Core N-VM standards. For the length step, use the vector magnitude calculator; for a perpendicular normal, the cross product calculator; and for angles, the dot product calculator.

How this calculator works

  • Enter vectors as comma- or space-separated components, in 2D or 3D.
  • Shows each step with your numbers, plus exact radical forms where the inputs are whole numbers.
  • û = v ÷ |v|: each component is divided by the magnitude.
  • Checks that the result has length 1 and, for 2D vectors, gives the direction angle. The zero vector has no direction and is rejected.

Frequently asked questions

How do you find a unit vector?

Divide each component of the vector by its length. For ⟨3, 4⟩ the length is 5, so the unit vector is ⟨0.6, 0.8⟩.

What is the length of a unit vector?

Exactly 1.

What is the unit vector of ⟨1, 1⟩?

⟨√2/2, √2/2⟩, about ⟨0.7071, 0.7071⟩.

Can every vector be normalized?

Every vector except the zero vector, which has no direction.

What are i, j and k?

The standard unit vectors along the x, y and z axes: ⟨1, 0, 0⟩, ⟨0, 1, 0⟩ and ⟨0, 0, 1⟩.

What are direction cosines?

The components of the unit vector, which equal the cosines of the angles between the vector and each axis.

How do I make a vector of a specific length?

Normalize it, then multiply the unit vector by the length you want.

Is a unit vector the same as a normal vector?

Not necessarily. A normal vector is perpendicular to a surface; it is often normalized to a unit normal, but it can have any length.

Sources

  1. Wolfram MathWorld: Unit vector
  2. OpenStax: Calculus Volume 3, section 2.1 Vectors in the Plane
  3. Math is Fun: Vectors

Updated November 25, 2026. Formulas checked against published sources and worked examples.

Cite this page: CalcRoster. "Unit vector calculator." calcroster.com/unit-vector-calculator/. Updated November 25, 2026.

Results are estimates for general information. They are not financial, medical or legal advice. Check important decisions with a qualified professional.