Vector Magnitude Calculator
Find the length and direction of a 2D or 3D vector.
Leave blank for a 2D vector
Results update as you type.
How it works
A vector describes a quantity that has both size and direction, such as a velocity, a force, or a displacement, and its magnitude is simply how long that arrow is regardless of which way it points. This vector magnitude calculator takes the x and y components of a two-dimensional vector, plus an optional z component for a three-dimensional one, and returns the exact length together with the direction angle measured counter-clockwise from the positive x axis. The magnitude is found by squaring each component, adding those squares together, and taking the square root of the total, which is the Pythagorean theorem generalised beyond a flat triangle. For a vector with components 3 and 4, the magnitude is exactly 5, the classic 3-4-5 result. Physics students resolving forces, game developers normalising movement, engineers combining stresses, and anyone converting between component form and polar form rely on this calculation constantly. Because the components can be negative, the calculator handles vectors pointing in any of the four quadrants and reports a direction angle between minus 180 and 180 degrees.
|v| = √(x² + y² + z²)
The magnitude of a vector is the square root of the sum of the squares of its components, which is a direct extension of the Pythagorean theorem into two or three dimensions. Each component measures displacement along one perpendicular axis, and because the axes are at right angles, the straight-line length of the vector is the hypotenuse of that right-angled box. The 2D direction angle is the arctangent of y over x.
Source:Euclidean vector norm (Pythagorean theorem)
We review all our tools from time to time to ensure accuracy.
Worked example
How to use this calculator
- 1
Enter your values
Enter x component and y component.
- 2
Adjust the options
Adjust z component (optional) if they apply — sensible defaults are already set.
- 3
Read your result
Magnitude updates instantly as you type — no button to press.
Frequently asked questions
What is the magnitude of a vector?
The magnitude of a vector is its length, an always non-negative number that tells you how large the quantity is while ignoring direction. It is computed by squaring each component, summing those squares, and taking the square root. For a velocity vector, the magnitude is the speed; for a force vector, it is the strength of the push or pull in newtons.
How do I find the magnitude in three dimensions?
Add a third squared term for the z component before taking the square root, so the formula becomes the square root of x squared plus y squared plus z squared. Enter a value in the optional z field and the calculator switches automatically from the 2D form to the 3D form. Leaving z blank treats the vector as lying flat in the xy plane.
What does the direction angle mean?
The direction angle tells you which way a 2D vector points, measured in degrees counter-clockwise from the positive x axis. A value of 0 points right, 90 points straight up, 180 points left, and negative angles point downward. The calculator uses the atan2 function so the angle is correct in all four quadrants, unlike a plain arctangent which cannot tell opposite directions apart.
Can components be negative?
Yes. Negative components simply mean the vector points in the negative direction along that axis, for example leftward or downward. Squaring removes the sign when computing magnitude, so the length is always positive, but the signs still matter for the direction angle. The calculator accepts any real numbers, positive, negative, or zero, for every component.
How is this related to the Pythagorean theorem?
The magnitude formula is the Pythagorean theorem applied to the right-angled box formed by the vector's components. In two dimensions the vector is the hypotenuse of a right triangle whose legs are x and y, so its length is the square root of x squared plus y squared. In three dimensions the same idea extends to a rectangular box with three perpendicular edges.