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
How to find vector magnitude
- Enter the x component. The default is 3.
- Enter the y component. The default is 4.
- Enter z for 3D work, or leave z at 0 for a plane vector. The default z is 0.
- Read magnitude |v| = √(x² + y² + z²). Defaults 3, 4, 0 give length 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 vector | v / |v| when |v| > 0 |
| Default example | (3, 4, 0) has magnitude 5 |
| Zero vector | Magnitude 0; unit vector is undefined |
| 2D usage | Set z = 0 to work in the plane |
| Privacy | Arithmetic 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.