Calculate the magnitude (length) of a vector from its components or from two endpoints in 2D, 3D, or any number of dimensions.
Vector Magnitude Formula
When you know the vector's components, the magnitude is the square root of the sum of the squared components:
|v| = sqrt(x^2 + y^2 + z^2 + ... )
When you only know the start and end points of the vector, first subtract the coordinates to get the components, then apply the same formula:
|v| = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2)
- |v| is the magnitude (also called the length or norm) of the vector.
- x, y, z are the components of the vector along each axis.
- x1, y1, z1 are the coordinates of the start (initial) point.
- x2, y2, z2 are the coordinates of the end (terminal) point.
The component form is used when the vector is already written as a list of numbers. The two-point form is used when the vector is drawn between two locations; subtracting the start point from the end point gives the components, and the magnitude follows from the same square-root sum. The calculator works the same way for two dimensions, three dimensions, or any custom list of components, since every extra axis just adds one more squared term under the root.
Vector Magnitude by Dimension
The formula extends naturally as you add axes. The table below shows the expanded form for each case.
| Dimension | Components | Magnitude |
|---|---|---|
| 2D | (x, y) | sqrt(x^2 + y^2) |
| 3D | (x, y, z) | sqrt(x^2 + y^2 + z^2) |
| n-D | (a1, a2, ..., an) | sqrt(a1^2 + a2^2 + ... + an^2) |
A few reference vectors and their magnitudes are shown below so you can sanity-check a result.
| Vector | Magnitude |
|---|---|
| (3, 4) | 5 |
| (1, 1) | 1.414 |
| (2, 3, 6) | 7 |
| (1, 2, 2) | 3 |
| (0, 0, 0) | 0 |
Example Problems
Example 1: From components (3D). A vector has components (2, 3, 6). Square each component to get 4, 9, and 36. Add them to get 49. Take the square root of 49, which gives a magnitude of 7.
Example 2: From two points (2D). A vector runs from the start point (1, 2) to the end point (4, 6). Subtract to find the components: 4 - 1 = 3 and 6 - 2 = 4. Square and add: 9 + 16 = 25. The square root of 25 is 5, so the magnitude is 5.
FAQ
What is the magnitude of a vector?
The magnitude is the length of the vector, or how far its end point sits from its start point. It is always a non-negative number and has no direction of its own, even though the vector it comes from does.
Can a vector magnitude be negative?
No. Because each component is squared before the values are added, the sum under the square root is never negative, so the magnitude is always zero or positive. A magnitude of zero means every component is zero (the zero vector).
How do I find the magnitude from two points instead of components?
Subtract the start point coordinates from the end point coordinates to get the vector's components, then square each component, add the results, and take the square root. This calculator does the subtraction for you when you choose the two-point input mode.
