Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Magnitude and Unit Vector


Symbolic visualization of ‖v‖ = √(v₁² + ⋯ + vₙ²), then v̂ = v / ‖v‖ — square, sum and root, divide.

Scenario?The magnitude (or Euclidean norm) of a vector v is the square root of the sum of the squares of its components — the Pythagorean theorem extended to any number of components. Dividing every component by that one number rescales v to length 1 without changing its direction; the result is the unit vector in the direction of v. Only the zero vector cannot be normalized, because its magnitude is zero.
Vector length
vlength3
v1×3
v1
v2
v3
squares1×3
?
?
?
‖v‖
?
Step 1 / 9

Step explanations

1Magnitude ‖v‖ and unit vector v̂
v has 3 components. Its magnitude is ‖v‖ = √(v1² + ⋯ + v3²): square every component, add the squares, take the square root. Dividing each component by that one number then gives the unit vector v̂ = v / ‖v‖, which points the same way as v and has length 1.
One vector in, one non-negative number out. Learn more about the opening scene · what it is








Key Terms

Magnitude — the length of a vector, written v\|\mathbf{v}\| (sometimes v|\mathbf{v}|), computed as v12+v22++vn2\sqrt{v_1^2 + v_2^2 + \cdots + v_n^2}.

Euclidean norm — the formal name for the magnitude; also called the 2\ell^2 norm or 22-norm.

Squared normv2=v12++vn2=vv\|\mathbf{v}\|^2 = v_1^2 + \cdots + v_n^2 = \mathbf{v} \cdot \mathbf{v}, the sum of squares before the root is taken.

Unit vector — a vector of magnitude exactly 11.

Normalization — dividing a non-zero vector by its magnitude to produce the unit vector in the same direction: v^=v/v\hat{\mathbf{v}} = \mathbf{v} / \|\mathbf{v}\|.

Direction — what normalization preserves; two vectors have the same direction when one is a positive multiple of the other.

Zero vector — the only vector with magnitude 00, and the only one that cannot be normalized.

Getting Started with the Visualizer

Set the length of v\mathbf{v}, pick a scenario, then watch the magnitude and the unit vector build one component at a time.

• Use the Scenario pills to choose Magnitude only, which stops at v\|\mathbf{v}\|, or Magnitude, then unit vector, which continues to v^\hat{\mathbf{v}}
• Use the Dimensions stepper to set the length of v\mathbf{v} (1 to 6 components)
• Hover the ? icon for a reminder of what the magnitude is and why normalization keeps the direction
• Press play or step manually through the scene player; the speed selector and step log let you control pace and review
• The components are shown symbolically — the visualizer focuses on the structure of the computation, not on specific numbers

The Three Phases

The visualizer separates the computation into three phases.

Phase 1 — square: each component viv_i is squared, one component per scene, and the square is written into a row beside v\mathbf{v}
Phase 2 — sum and root: all the squares are added and the square root of the total fills the v\|\mathbf{v}\| slot, in a single scene
Phase 3 — normalize: each component viv_i is divided by v\|\mathbf{v}\|, one component per scene, filling the unit vector v^\hat{\mathbf{v}}; this phase runs only in the unit vector scenario

The layout changes between phases 2 and 3. The first two phases read v\mathbf{v} \to squares v\to \|\mathbf{v}\|; the third reads v÷v=v^\mathbf{v} \div \|\mathbf{v}\| = \hat{\mathbf{v}}, because the magnitude has become an input.

The Opening Scene: One Vector, One Number

The player opens with v\mathbf{v} as a row of components, an empty row of squares beside it, and an empty slot for v\|\mathbf{v}\|. At the default length v\mathbf{v} has three components.

Nothing is computed yet. What the scene establishes is the shape of the answer: one vector in, one non-negative number out.
v1×3v1v2v3squares1×3???‖v‖?
Opening scene, frozen

v as a three-component row, an empty row of squares beside it, and an empty slot for ‖v‖. One vector in, one number out - the shape of the answer comes first.

That collapse from many components to a single number is what makes the magnitude a measurement rather than another vector. The squares row is scaffolding: it holds the intermediate values so that the two operations, squaring and summing, stay visibly separate.

There is no precondition on v\mathbf{v} beyond having real components. Any length works, and any vector has a magnitude — including the zero vector, whose magnitude is 00.

Phase 1: Squaring Each Component

The first sweep multiplies every component of v\mathbf{v} by itself, one slot at a time, and writes the square into the row beside it.

The frozen picture below is the second step at length 33: one square already written, one being computed, one still a placeholder.
v1×3v1v2v3squares1×3v1²v2²?‖v‖?
Phase 1, mid-sweep

Components of v being squared one at a time into the row beside them. The sign of each component vanishes here: a negative entry contributes the same square as a positive one.

Squaring is where the sign disappears. A component of 3-3 contributes 99, exactly as +3+3 would, so the magnitude cannot tell v\mathbf{v} from v-\mathbf{v}. That is correct behaviour for a length: an arrow and its reverse are the same size.

Each square depends on one component only, so the steps of this phase are independent and could run in any order. The left-to-right sweep is a presentational choice.

Phase 2: Summing and Taking the Root

The second phase is a single scene. Every square is counted, their sum is formed, and the square root of the total fills the v\|\mathbf{v}\| slot.

The frozen picture below shows the completed sum: all three squares highlighted and the slot reading v12+v22+v32\sqrt{v_1^2 + v_2^2 + v_3^2}.
v1×3v1v2v3squares1×3v1²v2²v3²‖v‖√(v1²+v2²+v3²)
Phase 2, the sum and root

Every square counted and the slot filled with √(v1² + v2² + v3²). This is the Pythagorean theorem in three dimensions.

The sum of squares is the squared magnitude, v2=vv\|\mathbf{v}\|^2 = \mathbf{v} \cdot \mathbf{v}, and it is often the more convenient quantity: comparing two lengths needs no square root, since u<v\|\mathbf{u}\| < \|\mathbf{v}\| exactly when u2<v2\|\mathbf{u}\|^2 < \|\mathbf{v}\|^2.

The root is what returns a length in the same units as the components. Geometrically the whole phase is the Pythagorean theorem: at length 22 the slot is a hypotenuse, at length 33 the diagonal of a box, and at higher lengths the same rule applied once per extra component.

Phase 3: Normalizing to a Unit Vector

In the unit vector scenario the layout changes: v\|\mathbf{v}\| moves from output to input, and the third sweep divides every component of v\mathbf{v} by it, one slot at a time, filling v^\hat{\mathbf{v}}.

The frozen picture below is the second step: one component of v^\hat{\mathbf{v}} already written as v1/vv_1 / \|\mathbf{v}\|, one being computed, one still a placeholder.
v1×3v1v2v3÷‖v‖√(v1²+v2²+v3²)=1×3v1/‖v‖v2/‖v‖?
Phase 3, mid-sweep

The layout has turned around: ‖v‖ is now an input, and each component of v is being divided by it to fill the unit vector. One common divisor, so the direction is untouched.

Every component is divided by the same number, which is the reason the direction survives. Scaling all components by a common positive factor slides the arrow along its own line; it cannot turn it. The new length is v/v=1\|\mathbf{v}\| / \|\mathbf{v}\| = 1.

The completed picture reads v=vv^\mathbf{v} = \|\mathbf{v}\| \, \hat{\mathbf{v}}: a length times a direction. That split is what unit vectors are for. In the dot product formula for an angle, in surface normals, in cosine similarity, the direction is the information and the length is noise, and normalization strips the noise away.

Reading the Scene Player

Each scene combines highlights, arrows, and a caption.

• In phase 1, the active component of v\mathbf{v} is highlighted primary and its square, in the row beside it, accent; one arrow connects them
• In phase 2, every square is highlighted secondary and the v\|\mathbf{v}\| slot accent, with an arrow from each square into the slot
• In phase 3, the active component of v\mathbf{v} is primary, the v\|\mathbf{v}\| slot secondary, and the destination component of v^\hat{\mathbf{v}} accent; arrows flow from both sources into the destination
• The v\|\mathbf{v}\| slot shows the full expression v12+v22+v32\sqrt{v_1^2 + v_2^2 + v_3^2} up to three components and an elided form beyond that
• The step log on the right keeps a record of every completed step across all phases

Choosing Vector Length

The dimension stepper controls the length of v\mathbf{v}, and the squares row and unit vector follow automatically.

• Length 22 is the Pythagorean theorem itself: v=v12+v22\|\mathbf{v}\| = \sqrt{v_1^2 + v_2^2} is the hypotenuse of a right triangle with legs v1v_1 and v2v_2
• Length 33 is the same theorem applied twice, giving the diagonal of a box with sides v1,v2,v3v_1, v_2, v_3
• Longer vectors show that the rule does not change: one square per component, one sum, one root, and one division per component to normalize
• Length 11 is a useful edge case: v=v12=v1\|\mathbf{v}\| = \sqrt{v_1^2} = |v_1|, the absolute value, which is why the magnitude generalizes absolute value

What the Magnitude Is

The magnitude of a vector vRn\mathbf{v} \in \mathbb{R}^n is

v=v12+v22++vn2=vv\|\mathbf{v}\| = \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2} = \sqrt{\mathbf{v} \cdot \mathbf{v}}


It is the length of the arrow from the origin to the point (v1,,vn)(v_1, \ldots, v_n), measured with the Pythagorean theorem. The magnitude is always non-negative, and it is zero only for the zero vector.

Normalizing v\mathbf{v} means dividing it by its own magnitude:

v^=vv,v^i=viv\hat{\mathbf{v}} = \frac{\mathbf{v}}{\|\mathbf{v}\|}, \qquad \hat{v}_i = \frac{v_i}{\|\mathbf{v}\|}


Every component is divided by the same positive number, so the direction is unchanged and the new length is v/v=1\|\mathbf{v}\| / \|\mathbf{v}\| = 1. Any non-zero vector therefore splits into a length and a direction: v=vv^\mathbf{v} = \|\mathbf{v}\| \, \hat{\mathbf{v}}.

For the full treatment, including other norms and the triangle inequality, see the vector magnitude theory page.

Key Properties

The magnitude satisfies the three axioms every norm must satisfy, plus a few identities specific to the Euclidean norm.

Non-negativity: v0\|\mathbf{v}\| \geq 0, with equality only for v=0\mathbf{v} = \mathbf{0}
Scaling: kv=kv\|k\mathbf{v}\| = |k| \, \|\mathbf{v}\| — the absolute value matters, since v-\mathbf{v} has the same length as v\mathbf{v}
Triangle inequality: u+vu+v\|\mathbf{u} + \mathbf{v}\| \leq \|\mathbf{u}\| + \|\mathbf{v}\|
Dot product link: v2=vv\|\mathbf{v}\|^2 = \mathbf{v} \cdot \mathbf{v}
Unit vectors: v^=1\|\hat{\mathbf{v}}\| = 1 for every non-zero v\mathbf{v}, and v^\hat{\mathbf{v}} is the unique unit vector in the direction of v\mathbf{v}
Decomposition: v=vv^\mathbf{v} = \|\mathbf{v}\| \, \hat{\mathbf{v}}, a length times a direction
Distance: uv\|\mathbf{u} - \mathbf{v}\| is the distance between the points u\mathbf{u} and v\mathbf{v}

The squaring in phase 1 is what makes the sign of each component irrelevant: (3)2=32(-3)^2 = 3^2, so a vector and its negative have the same magnitude.

Why It Matters

Magnitude and normalization appear wherever a vector's size and its direction need to be handled separately.

Distance and geometry: lengths of segments, distances between points, and radii are all magnitudes of difference vectors
Angles: cosθ=uvuv\cos\theta = \dfrac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{u}\| \, \|\mathbf{v}\|} needs both magnitudes; with unit vectors the cosine is just the dot product
Direction fields: normals, tangents, and view directions in graphics and physics are normalized so that only the direction carries information
Orthonormal bases: Gram-Schmidt normalizes each vector after making it orthogonal to the previous ones
Machine learning: feature vectors are normalized so that comparisons depend on direction rather than scale, and cosine similarity is a dot product of unit vectors
Numerical stability: iterative algorithms such as power iteration renormalize at each step to keep the numbers from overflowing

Worked Example

Take

v=(122)\mathbf{v} = \begin{pmatrix} 1 \\ 2 \\ 2 \end{pmatrix}


Square each component: 12=11^2 = 1, 22=42^2 = 4, 22=42^2 = 4.

Sum and root:

v=1+4+4=9=3\|\mathbf{v}\| = \sqrt{1 + 4 + 4} = \sqrt{9} = 3


Normalize by dividing each component by 33:

v^=13(122)=(1/32/32/3)\hat{\mathbf{v}} = \frac{1}{3}\begin{pmatrix} 1 \\ 2 \\ 2 \end{pmatrix} = \begin{pmatrix} 1/3 \\ 2/3 \\ 2/3 \end{pmatrix}


Check: v^=1/9+4/9+4/9=9/9=1\|\hat{\mathbf{v}}\| = \sqrt{1/9 + 4/9 + 4/9} = \sqrt{9/9} = 1.

A two-component example is the classic 33-44-55 triangle: for v=(3,4)\mathbf{v} = (3, 4), v=9+16=5\|\mathbf{v}\| = \sqrt{9 + 16} = 5 and v^=(0.6,0.8)\hat{\mathbf{v}} = (0.6, 0.8). Set the visualizer to length 33 or 22 and step through to see the same computation symbolically.

Common Mistakes

A few mistakes recur.

Forgetting the square rootv12++vn2v_1^2 + \cdots + v_n^2 is the squared magnitude v2\|\mathbf{v}\|^2, not the magnitude
Adding components instead of squaresv1+v2+|v_1| + |v_2| + \cdots is a different norm (the 1\ell^1 norm), not the Euclidean length
Dropping the absolute value when scalingkv=kv\|k\mathbf{v}\| = |k| \, \|\mathbf{v}\|, so 2v=2v\|-2\mathbf{v}\| = 2\|\mathbf{v}\|, never 2v-2\|\mathbf{v}\|
Normalizing by the squared norm — dividing by v2\|\mathbf{v}\|^2 instead of v\|\mathbf{v}\| gives a vector of length 1/v1/\|\mathbf{v}\|, not 11
Normalizing the zero vector — its magnitude is 00, and division by zero is undefined; the zero vector has no direction
Expecting the components of a unit vector to be at most 1 in some other sense — each v^i1|\hat{v}_i| \leq 1 does hold, but a unit vector's components can be any values whose squares sum to 11