Skip to content
Math

Unit Vector Calculator

Enter your vector components and this calculator instantly finds the unit vector in the same direction. It shows the magnitude, each normalized component, the direction angles in both degrees and radians, and a full step-by-step breakdown of the math. Switch between 2D and 3D mode; the result updates as you type.

Your details

Choose whether your vector lives in a 2D plane or 3D space.
The horizontal (x-axis) component of your vector.
The vertical (y-axis) component of your vector.
The depth (z-axis) component. Only used in 3D mode.
Unit for the direction angles displayed in the results.
Unit vector xNormalized successfully
0.6

x-component of the normalized vector

Magnitude |v|5
Unit vector y-0.8
Unit vector z0
Angle with x-axis (alpha)53.1301
Angle with y-axis (beta)143.1301
Angle with z-axis (gamma)90
Verify: unit vector magnitude1
x0.6
y-0.8
z0

Unit vector found - magnitude of result is exactly 1.

  • The original vector has magnitude 5.0000, which is how much each component is scaled down to produce the unit vector.
  • Each component is divided by 5.0000: the unit vector is (0.6000, -0.8000, 0.0000).
  • The angle between this unit vector and the positive x-axis is 53.1301 deg (53.13 deg).
  • In 3D, direction cosines alpha, beta, and gamma satisfy cos²(alpha) + cos²(beta) + cos²(gamma) = 1, which you can verify from the components above.

Next stepUnit vectors are used in dot products to find angles between vectors, in cross products to find perpendicular directions, and as basis vectors in coordinate systems.

Formula

u^=vv,v=x2+y2+z2,u^=(xv,yv,zv)\hat{u} = \dfrac{\mathbf{v}}{|\mathbf{v}|}, \quad |\mathbf{v}| = \sqrt{x^2 + y^2 + z^2}, \quad \hat{u} = \left(\dfrac{x}{|\mathbf{v}|},\, \dfrac{y}{|\mathbf{v}|},\, \dfrac{z}{|\mathbf{v}|}\right)

Worked example

For vector v = (3, -4, 0): magnitude = sqrt(9 + 16 + 0) = sqrt(25) = 5. Unit vector = (3/5, -4/5, 0/5) = (0.6, -0.8, 0). Check: sqrt(0.36 + 0.64 + 0) = sqrt(1) = 1. Direction angle with x-axis: arccos(0.6) = 53.13 deg.

What is a unit vector?

A unit vector is a vector that has a magnitude (length) of exactly 1. It points in the same direction as the original vector but is scaled so its length equals 1. Unit vectors are written with a hat notation, such as u-hat, to distinguish them from ordinary vectors. They are useful whenever you need direction information without caring about magnitude: for example, a surface normal in 3D graphics is always a unit vector, and the direction cosines of a flight path are the components of the corresponding unit vector.

How to find a unit vector

To normalize a vector v with components (x, y, z), you first compute the magnitude |v| = sqrt(x^2 + y^2 + z^2). Then divide each component by that magnitude: unit vector = (x / |v|, y / |v|, z / |v|). The resulting vector always has magnitude 1. In 2D the process is identical, just drop the z term. If the original vector is the zero vector (all components are 0), it has no direction and cannot be normalized. A quick sanity check: square all components of your unit vector and sum them; the result must equal 1.

Direction angles and direction cosines

The direction angles of a 3D vector are the angles alpha, beta, and gamma that the vector makes with the positive x-, y-, and z-axes respectively. The cosines of these angles, called direction cosines, are exactly the components of the unit vector: cos(alpha) = ux, cos(beta) = uy, cos(gamma) = uz. A fundamental identity holds: cos^2(alpha) + cos^2(beta) + cos^2(gamma) = 1, which is just a restatement of the unit vector having magnitude 1. This calculator reports all three direction angles and lets you switch between degrees and radians.

Applications of unit vectors

Unit vectors appear throughout science and engineering. In physics, force, velocity, and field equations often separate magnitude from direction by writing the vector as a scalar times a unit vector. In computer graphics, surface normals are unit vectors that determine how light reflects off a surface. In navigation, bearing and heading are encoded in unit vectors. In machine learning, cosine similarity compares two vectors by computing the dot product of their unit forms. Any time you see a formula with a hat over a letter, that is a unit vector.

Standard basis unit vectors

NameComponentsDirectionUse
i-hat(1, 0, 0)Positive x-axisHorizontal / East
j-hat(0, 1, 0)Positive y-axisVertical / North
k-hat(0, 0, 1)Positive z-axisDepth / Up
-i-hat(-1, 0, 0)Negative x-axisHorizontal / West
-j-hat(0, -1, 0)Negative y-axisVertical / South
-k-hat(0, 0, -1)Negative z-axisDepth / Down

The three standard Cartesian basis vectors are the simplest unit vectors. Every vector in 3D space is a linear combination of these.

Frequently asked questions

What happens if I enter the zero vector?

The zero vector (0, 0, 0) has no direction and cannot be normalized. Division by zero would occur when you try to divide each component by the magnitude, which is zero. Mathematically, the unit vector for the zero vector is undefined. This calculator leaves the result blank when all components are zero.

Does the order I enter the components matter?

Yes. The components label your vector along specific axes: x is the first axis, y the second, z the third. Swapping components gives a different vector pointing in a different direction. However, the magnitude is the same regardless of order, since squaring eliminates sign differences and addition is commutative.

How do I check my answer manually?

Square each component of the unit vector and sum them. If the normalization is correct, the sum is 1 (or very close to 1 due to floating-point rounding). This calculator shows a verification row labeled "Verify: unit vector magnitude" that should display 1.000000.

Can a vector component be negative?

Yes. Negative components simply mean the vector points partly in the negative direction along that axis. The normalization process works the same way: divide each component (positive or negative) by the magnitude. The resulting unit vector component will carry the same sign as the original component.

What is the difference between a unit vector and a normalized vector?

They are the same thing. "Normalizing" a vector means scaling it to have magnitude 1, producing the unit vector in that direction. The word "normalize" comes from "normal" in the sense of standard or unit-length, not from the statistical normal distribution.

What are direction cosines?

Direction cosines are the cosines of the three angles (alpha, beta, gamma) that a vector makes with the positive x-, y-, and z-axes. They are identical to the components of the unit vector in that direction. The identity cos^2(alpha) + cos^2(beta) + cos^2(gamma) = 1 always holds, because the unit vector has magnitude 1.

Sources

Written by Dr. Rajiv Menon, PhD Applied Mathematician · Bengaluru, India

Applied mathematician bridging algebraic theory and computational tools for students, engineers, and everyday problem-solvers.

Search 3,500+ calculators

Loading search…