Skip to main content

Vector Magnitude Calculator

Find the Euclidean length of a vector from components x, y, and optional z. Nonzero vectors also return the unit vector in the same direction.

Rated 4.8 out of 5 based on 302 reviews

Results

How to find vector magnitude

  1. Enter the x component. The default is 3.
  2. Enter the y component. The default is 4.
  3. Enter z for 3D work, or leave z at 0 for a plane vector. The default z is 0.
  4. Read magnitude |v| = √(x² + y² + z²). Defaults 3, 4, 0 give length 5.
  5. When length is positive, also read the unit vector components x/|v|, y/|v|, and z/|v|.

Vector magnitude

Euclidean length of a 2D or 3D component vector

Formula|v| = √(x² + y² + z²)
Unit vectorv / |v| when |v| > 0
Default example(3, 4, 0) has magnitude 5
Zero vectorMagnitude 0; unit vector is undefined
2D usageSet z = 0 to work in the plane
PrivacyArithmetic runs in this tab. CZNull does not receive the numbers.

What vector magnitude measures

Magnitude is the straight-line length of the arrow from the origin to (x, y, z). It is always nonnegative. The classic plane example (3, 4) has length 5, the same 3-4-5 triangle that appears in Pythagoras homework.

How this page computes length and the unit vector

The engine uses |v| = √(x² + y² + z²) via Math.hypot for stable floating-point behavior. If |v| > 0, unit components are each component divided by |v|. If every component is zero, magnitude is 0 and the unit vector row states that it is undefined.

Unit vector meaning

A unit vector keeps direction and forces length 1. Physics displacement directions and graphics normals often need that normalized triple. Scaling a nonzero vector by 1/|v| is exactly what the unit rows show.

Use cases

Velocity length from components, force magnitude checks, and normalizing a direction before lighting or camera math. Spherical coordinates and cross products are not on this form.

Limits

Up to three Cartesian components. No 4D. No unit conversion between meters and feet. Non-finite inputs fail in the status line. See the disclaimer.

Vector magnitude questions

What magnitude do components 3, 4, and 0 give?
5. That is the plane 3-4-5 length with z unused.
How do I compute a 2D magnitude on this form?
Enter x and y, and set z to 0. The formula still holds with a zero third term.
What happens for the zero vector?
Magnitude is 0. The page reports that the unit vector is undefined because you cannot divide by zero.
Is magnitude allowed to be negative?
No. Euclidean length is nonnegative. Individual components may be negative; they still square in the formula.
Does this page add two vectors?
No. Use the vector addition calculator for component-wise sums or differences.
How is this different from distance between two points?
Magnitude treats the vector as rooted at the origin. Distance between two points uses the same hypot idea on the difference of their coordinates.