Premium Math Tools · Geometry

Unit Vector Calculator

Normalize any vector <x, y, z> to length 1, or recover a missing unit-vector component. Watch the geometry update live as you type.

  • Step-by-Step
  • 2D, 3D & n-Dimensions
  • Visual Diagram
  • Direction Angles
  • Free, No Signup

1 Setup

2 Original vector

Try:
Direction angle theta
56.31
Magnitude ||v||
3.6056

Live diagram

x y theta (x, y)

Drag the orange point to change x and y.

Original vector v Unit vector u

3 Unit vector - Result

< x = 0.5547, y = 0.83205 >
x 0.5547
y 0.83205
||u|| 1
Step by step

Detailed solution

Every step recomputes live from the numbers above.

How to Use the Unit Vector Calculator

Using the unit vector calculator takes 3 steps: pick the setup, enter the components, and read the result. The calculator recomputes the moment you type, so there is no submit button to press, and a full step-by-step solution appears below the tool.

01

Choose mode and dimension

Select Normalize a vector to find the unit vector, or Find a missing component to solve for the value that makes the length 1. Set the dimension to 2D or 3D.

02

Enter the components

Type x, y, and z into the input fields. You can paste a preset or drag the orange point on the diagram to set the values.

03

Read and copy the result

The result panel shows the unit vector, the magnitude, and a length check equal to 1. Use the copy button to grab the components.

Entering 2D and 3D Components

Enter a 2D vector by filling the x and y fields after setting the dimension to 2D. Enter a 3D vector by switching to 3D, which reveals the z field for a vector in the form <x, y, z>. The fields accept decimals, negatives, and short expressions such as sqrt(2) or 3^2. The Cartesian coordinate system frames both cases, so a 2D vector sits in the plane while a 3D vector points anywhere in 3D space.

What You Get (Outputs Explained)

The calculator returns 4 outputs for every nonzero vector you enter, listed in the table below.

OutputNotationMeaning
Magnitude||v||The length of the original vector.
Unit vector<x/||v||, ...>The normalized vector with length 1.
i, j, k forma i + b j + c kThe same unit vector in basis notation.
Direction anglesα, β, γThe angles the vector makes with each axis.

Vector magnitude ‖v‖ - what the number means

The vector magnitude ||v|| is the length of the vector, found with ||v|| = sqrt(x^2 + y^2 + z^2). The number tells you how far the arrow reaches from the origin to its tip. A magnitude of 5 means the vector is 5 units long. This is the same value a vector magnitude calculator or a distance calculator returns, and it comes straight from the Pythagorean theorem applied to the components.

Unit vector in component form ⟨x/‖v‖, …⟩

The unit vector in component form lists each original component divided by the magnitude, written <x/||v||, y/||v||, z/||v||>. Each unit vector component sits between -1 and 1, and the squares of all components sum to 1. This form keeps the vector direction unchanged while setting the length to exactly 1.

Same result in i, j, k notation

The same unit vector appears in i, j, k notation, where i = <1, 0, 0>, j = <0, 1, 0>, and k = <0, 0, 1> are the basis vectors. A unit vector <0.6, 0.8> reads as 0.6 i + 0.8 j. The two forms hold the same numbers, so pick whichever notation your course or codebase uses.

Direction angles / direction cosines

The direction angles α, β, and γ are the angles the vector makes with the x, y, and z axes. Their cosines, the direction cosines, equal the unit vector components. For a 2D vector the calculator reports a single direction angle theta = atan2(y, x) measured from the positive x-axis.

What Is a Unit Vector?

A unit vector is a vector of length equal to 1. It marks a pure direction without carrying any size. Dividing any nonzero vector by its magnitude produces the unit vector along the same line. In a Cartesian coordinate system, the 3 unit vectors that build 3D space are <1, 0, 0> for the x-direction, <0, 1, 0> for the y-direction, and <0, 0, 1> for the z-direction. Every vector in 3D space equals a sum of these unit vectors.

Hat Notation (v̂)

Hat notation writes a unit vector with a circumflex, or hat, above the letter, so the unit vector of v is written and read “v-hat.” The hat is the standard signal that a vector has length 1. The basis vectors carry the same mark, as in , , and .

Unit Vector vs Direction Vector

A unit vector and a direction vector describe the same idea from two angles. A direction vector points a chosen way and can have any length. A unit vector is a direction vector scaled to length 1. The table below sets them side by side.

PropertyUnit vectorDirection vector
LengthAlways 1Any positive value
Carries directionYesYes
Carries sizeNoYes
Made byDividing by the magnitudeAny nonzero vector

Unit Vector vs Basis Vector (i, j, k)

A basis vector is a unit vector locked to a coordinate axis, while a unit vector can point any way. The 3 basis vectors i, j, and k each have length 1 and align with the x, y, and z axes. A unit vector like <0.6, 0.8> also has length 1 but points between the axes. Every basis vector is a unit vector, yet most unit vectors are not basis vectors.

Unit Vector Formula (û = v/|v|)

The unit vector formula is û = v / |v|, where is the unit vector, v is the original vector in the form <x, y, z>, and |v| is the magnitude. Applying the formula takes 3 steps.

Normalize

u = v / ||v|| = < x, y, z > / sqrt(x^2 + y^2 + z^2)

Magnitude

||v|| = sqrt(x^2 + y^2 + z^2)

Direction angle (2D)

theta = atan2(y, x)

Missing component

x = +/- sqrt(1 - y^2 - z^2)

Step 1 - Find the Magnitude

Find the magnitude by squaring each component, adding the squares, and taking the square root: |v| = sqrt(x^2 + y^2 + z^2). For v = <8, -3, 5>, the magnitude is sqrt(64 + 9 + 25) = sqrt(98) ≈ 9.8995.

Step 2 - Divide Each Component

Divide each component by the magnitude to get the unit vector components. For the same vector, x = 8 / 9.8995 ≈ 0.8081, y = -3 / 9.8995 ≈ -0.3030, and z = 5 / 9.8995 ≈ 0.5051, so û = <0.8081, -0.3030, 0.5051>.

Step 3 - Verify the Length Is 1

Verify the result by computing its magnitude, which should equal 1. Squaring and adding the components above gives 0.6530 + 0.0918 + 0.2552 = 1.0000, so the length check passes. The calculator runs this unit vector check for you and prints the value next to the result.

Worked Examples

The 4 worked examples below cover a 2D vector, a 3D vector, a vector from two points, and a vector with negative components. Enter any of them in the calculator above to see the same steps run live.

Live worked example

For v = <2, 3>: ||v|| = sqrt(4 + 9) = sqrt(13) ~= 3.6056, so u = <0.5547, 0.83205>.

2D Unit Vector Example ⟨3,4⟩ → ⟨0.6, 0.8⟩

The unit vector of <3, 4> is <0.6, 0.8>. The magnitude is sqrt(3^2 + 4^2) = sqrt(25) = 5, so dividing gives <3/5, 4/5> = <0.6, 0.8>. The length check returns 0.36 + 0.64 = 1.

x = 3 y = 4 |v| = 5
StepValue
Magnitudesqrt(9 + 16) = 5
Divide x3 / 5 = 0.6
Divide y4 / 5 = 0.8
Check0.36 + 0.64 = 1

3D Unit Vector Example ⟨1,1,1⟩ → ⟨0.577…⟩

The unit vector of <1, 1, 1>, the cube diagonal, is <0.5774, 0.5774, 0.5774>. The magnitude is sqrt(1 + 1 + 1) = sqrt(3) ≈ 1.7321, so each component becomes 1 / sqrt(3) ≈ 0.5774. All 3 components match because the vector points equally along every axis.

Unit Vector from Two Points (A → B)

Find the unit vector from point A to point B by subtracting coordinates, then normalizing. For A = (2, 1, 3) and B = (5, 5, 15), the displacement is B - A = <3, 4, 12>. The magnitude is sqrt(9 + 16 + 144) = sqrt(169) = 13, so the unit vector is <3/13, 4/13, 12/13> ≈ <0.2308, 0.3077, 0.9231>.

Unit Vector with Negative Components ⟨-5,12⟩

The unit vector of <-5, 12> is <-0.3846, 0.9231>. The magnitude is sqrt(25 + 144) = sqrt(169) = 13, so the components are -5/13 and 12/13. The negative sign carries through, and the length check still returns 0.1479 + 0.8521 = 1.

Direction Angles & Direction Cosines

Direction angles and direction cosines tie a unit vector to the coordinate axes. The angles measure orientation, and their cosines are the unit vector components themselves.

α x y
AxisDirection angleDirection cosine
xαcos α = x/|v|
yβcos β = y/|v|
zγcos γ = z/|v|

What Are Direction Angles (α, β, γ)?

Direction angles α, β, and γ are the angles a vector makes with the positive x, y, and z axes, each between 0° and 180°. For the cube diagonal <1, 1, 1>, all 3 angles equal 54.74° (0.9553 rad), because the vector leans equally toward every axis.

How Unit Vector Components = Direction Cosines

Each unit vector component equals the cosine of its direction angle, the values known as direction cosines, so cos α = x/|v|, cos β = y/|v|, and cos γ = z/|v|. The unit vector <0.6, 0.8> therefore has direction cosines 0.6 and 0.8, giving angles of 53.13° and 36.87°. The squares of the direction cosines sum to 1, the same rule that defines a unit vector.

Two related vectors build on normalization: the unit normal vector and the unit tangent vector.

Unit Normal Vector

A unit normal vector is a vector of length 1 that points perpendicular to a surface or curve. You find it by taking a normal vector, often from a cross product of two edge vectors, then dividing by its magnitude. A unit normal vector calculator returns this value for lighting, collision, and surface math. In 2D, rotating <x, y> to <-y, x> and normalizing gives a unit normal.

t

Unit Tangent Vector

A unit tangent vector is a vector of length 1 that points along the direction of motion on a curve. For a curve r(t), it equals the derivative r'(t) divided by its magnitude, T(t) = r'(t) / |r'(t)|. A unit tangent vector calculator handles this for paths in 2D and 3D space, and the result feeds curvature and motion calculations.

r(t)

Special Cases & Common Mistakes

4 cases trip people up most often: the zero vector, an already-normalized vector, negative components, and dividing by the wrong magnitude.

The Zero Vector (cannot be normalized)

The zero vector <0, 0, 0> cannot be normalized. Its magnitude is 0, and dividing by zero is undefined, so it has no unit vector. The zero vector also has no direction, which is the reason the rule holds. The calculator flags this case instead of returning a result.

A Vector That Is Already a Unit Vector

A vector that already has length 1 stays the same after normalization. Check by computing the magnitude: if it equals 1, the vector is its own unit vector. The vector <0.6, 0.8> returns <0.6, 0.8> because sqrt(0.36 + 0.64) = 1.

Can Unit Vectors Be Negative?

Yes, unit vectors can have negative components. A negative sign sets the direction along an axis, not the length. The vector <-0.6, 0.8> is a valid unit vector because 0.36 + 0.64 = 1. The length stays positive even when components turn negative.

Dividing by the Wrong Magnitude

Dividing by the wrong magnitude is the most common error and gives a result whose length is not 1. It usually comes from forgetting to square a component, dropping the square root, or mixing 2D and 3D terms. Run the unit vector check after dividing: square the components and confirm the sum is 1.

Why Normalize Vectors?

Normalizing a vector separates direction from size, which matters whenever a calculation needs a pure direction. The 3 fields below rely on it most.

Physics & Engineering (forces, direction)

Physics and engineering use unit vectors to state the direction of a force, velocity, or field while keeping the magnitude separate. A force of 20 newtons (N) along a ramp splits into a unit vector for direction and a scalar for strength. The same split appears before stress analysis, during aerodynamic lift calculations, and for magnetic field lines. The matrix norm even uses unit vectors to measure how much a linear transformation stretches an input.

Game Development & 3D Graphics (movement, lighting, normals)

Game development and 3D graphics normalize vectors to move characters at a steady speed, compute lighting, and store surface normals. A movement vector divided by its magnitude keeps speed constant in every direction. Unit normals drive shading in game engine physics, and quaternion rotations rely on normalized vectors to avoid drift.

Robotics, GPS & Machine Learning

Robotics, GPS, and machine learning normalize vectors to compare direction without size bias. Robotics uses unit vectors for robotic joint angles and end-effector aiming. GPS works with geodetic coordinates and direction vectors for heading. Machine learning normalizes feature vectors for neural network gradients and in spectral clustering, where only the angle between vectors should count.

Properties of Unit Vectors

Unit vectors share 6 defining properties, listed below.

#Property
1The magnitude equals 1 for every unit vector.
2The squares of the components sum to 1.
3Each component lies between -1 and 1.
4The components equal the direction cosines of the vector.
5The dot product of a unit vector with itself equals 1.
6Dividing any nonzero vector by its magnitude returns a unit vector.

Frequently Asked Questions

How do you find the unit vector of a given vector?

Divide the vector by its magnitude. Compute |v| = sqrt(x^2 + y^2 + z^2), then divide each component by that number. For <2, 3>, the magnitude is sqrt(13) ≈ 3.6056, so the unit vector is <0.5547, 0.8321>.

Is the unit vector calculator free?

Yes, the unit vector calculator is free. It runs in your browser with no sign-up, no download, and no usage limit.

Does it work for both 2D and 3D vectors?

Yes. Set the dimension to 2D for a vector <x, y> or 3D for a vector <x, y, z>. The calculator normalizes both and draws the matching diagram.

Can you normalize a zero vector?

No. The zero vector has a magnitude of 0 and no direction, so dividing by zero is undefined. Every nonzero vector has a unit vector.

What's the difference between a unit vector and a normal vector?

A unit vector has length 1 and points in a chosen direction. A normal vector points perpendicular to a surface or curve. A unit normal vector is both, perpendicular and scaled to length 1.

What's the difference between a unit vector and a basis vector?

A basis vector is one of the axis directions i, j, and k. A unit vector can point any way, while a basis vector points along a coordinate axis.

Can a unit vector have negative components?

Yes. A unit vector can have negative components as long as the squares of all components sum to 1. For example, <-0.6, 0.8> is a valid unit vector.

Does it show step-by-step solutions?

Yes. The calculator prints the magnitude calculation, the division of each component, and the length check, and all 3 steps recompute live as you change the input.

Try the Unit Vector Calculator Now

Enter a 2D or 3D vector and watch the unit vector, magnitude, and direction angles update live. For more worked guides on vectors and geometry, visit our blog.

Open the calculator