Vector Magnitude Calculator
Enter the x, y, and z components of a vector to get its magnitude — the straight-line length from the origin to its tip — and see how the formula extends Pythagoras into three dimensions.
Any 3D vector
Enter the x, y, and z components and the vector magnitude calculator returns the length |v| = √(x² + y² + z²) instantly.
2D? Set z to 0
For a flat 2D vector, leave the z component at 0 — the formula reduces to √(x² + y²), the familiar hypotenuse.
What is vector magnitude?
The length of a vector
The magnitude of a vector is its length — the straight-line distance from the origin to the point the vector reaches. The vector magnitude calculator takes the three components of a 3D vector, x, y, and z, and returns that length as a single non-negative number. It ignores direction entirely: a vector pointing any which way has the same magnitude as long as its length is the same. This is the quantity behind speeds from velocity vectors, distances in 3D space, and force strengths in physics and engineering.
Enter the x, y, and z components of a vector to get its magnitude — its length — instantly.
The magnitude is the square root of the sum of the squared components. Each component is squared, the squares are added, and the square root of that total is the length.
|v| = √(x² + y² + z²)Because every component is squared before being added, signs do not matter: a component of −4 contributes the same 16 as +4. That is why the magnitude is always zero or positive. Use the same units for all three components and the magnitude comes back in those units.
Suppose a vector has components x = 3, y = 4, and z = 0.
Square each component
3² = 9, 4² = 16, and 0² = 0 — the squared components.
Add the squares
9 + 16 + 0 = 25 — the sum of the squared components.
Take the square root
√25 = 5 — the magnitude of the vector. The classic 3-4-5 triangle, now in vector form.
The magnitude tells you how long the vector is, nothing more and nothing less. A magnitude of 5 for the vector (3, 4, 0) means its tip sits exactly 5 units from the origin, no matter which direction it points. Two key facts follow from the formula. First, the magnitude is always greater than or equal to zero — it can only be exactly zero for the zero vector (0, 0, 0), and is positive for everything else. Second, this is the Pythagorean theorem extended to 3D: in two dimensions the length of (x, y) is √(x² + y²), the hypotenuse of a right triangle, and adding a z-axis simply adds another squared term under the root. The same pattern generalises to any number of dimensions. If you only need a 2D length, leave z at 0 and the third term drops out.
The formula is exact, but a couple of practical points are worth keeping in mind.
Consistent units and a length, not a direction
The magnitude is a single number — the vector's length — and tells you nothing about its direction; for that you need the components themselves or the unit vector. Keep all three components in the same units, or the result will be meaningless. The magnitude is always zero or positive, so a result can never be negative; if you expected a sign, you are after a component, not the magnitude.