Vector Magnitude Calculator – Find the Length of a Vector
The magnitude of a vector — also called its length or norm — describes how far a vector extends from the origin, independent of the direction it points. This calculator finds that length instantly for both two-dimensional (2D) and three-dimensional (3D) vectors, and shows the formula and step-by-step arithmetic behind the result.
The Vector Magnitude Formula
A vector's magnitude comes directly from the Pythagorean theorem. For a 2D vector v = (x, y):
|v| = √(x² + y²)
Each component represents a leg of a right triangle, and the magnitude is the hypotenuse — the straight-line distance from the origin to the point (x, y). In 3D space, a third component extends the same idea:
|v| = √(x² + y² + z²)
Because every component is squared before being summed, the sign of each component never affects the result — a vector and its exact opposite (e.g. (3, 4) and (-3, -4)) always share the same magnitude.
Unit Vectors and the Zero Vector
A unit vector is any vector whose magnitude equals exactly 1. Unit vectors are used throughout physics and graphics to represent pure direction without scale — for example, (0.6, 0.8) is a unit vector because √(0.6² + 0.8²) = 1. The calculator automatically flags this case with a badge next to the result.
The zero vector — where every component equals 0 — has a magnitude of 0 and no defined direction. It is a valid, well-defined input rather than an error, and the calculator marks it clearly when detected.
Why Vector Magnitude Matters
Computing a vector's length is fundamental across many fields. In physics, the magnitude of a velocity vector gives speed, and the magnitude of a force vector gives the strength of a push or pull regardless of its direction. In engineering, resultant forces and displacements are summarized by their magnitude before further analysis. In computer graphics and game development, magnitude is the first step in normalizing a vector — dividing each component by the magnitude to produce a unit vector that preserves direction only. In pure mathematics, this calculation defines the Euclidean norm used throughout linear algebra.
Working with Negative and Decimal Components
The calculator accepts any real number for each component — positive, negative, zero, or decimal. Because squaring removes the sign, negative components behave predictably: the vector (-3, -4) produces the same magnitude as (3, 4), which is 5. Mixed-sign vectors such as (1, 2, 2) resolve the same way, giving a magnitude of 3.
How to Use This Calculator
Choose 2D or 3D mode using the toggle at the top, then enter the X, Y, and (in 3D mode) Z components of your vector. Results update instantly as you type. Adjust the decimal precision field to control how many decimal places are shown, from 0 up to 10. Use the Show Steps button to reveal the full substituted formula, and the Copy button to place the magnitude on your clipboard. The Share button copies a link to this tool so you can send it to someone else.
Accuracy and Limitations
All calculations use JavaScript's 64-bit floating-point arithmetic (IEEE 754 double precision), which provides roughly 15–16 significant decimal digits — more than enough for typical physics, engineering, and graphics use cases. Unit vector and zero vector detection use a small numerical tolerance to account for floating-point rounding, so values extremely close to 1 or 0 are still classified correctly.