acalculator

What is the vector’s magnitude?

Type a vector’s components, or the point where it starts and the point where it ends. The magnitude calculator gives its length, the exact square root form, the unit vector, and in 2D the direction angle.

Your numbers

I know
Read as: 3; 4Numbers separated by commas, 1 to 10 of them.
Magnitude ‖v‖
5

The magnitude of ⟨3, 4⟩ is 5.

Exact magnitude
5
Magnitude squared ‖v‖²
25
Vector v
⟨3, 4⟩
Unit vector v ÷ ‖v‖
⟨0.6, 0.8⟩
Direction angle
53.1301
Components
2

Magnitude ‖v‖: 5. The magnitude of ⟨3, 4⟩ is 5.

How to calculate

Finds the magnitude (length) of a vector from its components or from a start and an end point, in 2D, 3D or up to 10 dimensions, with the exact root, the unit vector and the direction angle.

Example with the default inputs (I know Components, Components of v [3, 4]): The magnitude of ⟨3, 4⟩ is 5.

Method: ‖v‖ = √(v₁² + v₂² + … + vₙ²); from P to Q, v = Q − P. Unit vector v ÷ ‖v‖; in 2D the angle is atan2(y, x).

  • Euclidean length: the square root of the sum of the squared components.
  • From two points, v = Q − P (end minus start), coordinate by coordinate.
  • Up to 10 components. The exact root form is shown when ‖v‖² = p/q has p × q at most 10¹².

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. I know Components, Components of v -2, 9, 5 gives Magnitude ‖v‖ 10.488088, Exact magnitude √110, Magnitude squared ‖v‖² 110, Components 3.Source: OpenStax, Calculus Volume 3, §2.2 Vectors in Three Dimensions (‖v‖ = √(x² + y² + z²); Example 2.19: ⟨−2, 9, 5⟩ has magnitude √110 and ⟨1, −1, 0⟩ has magnitude √2), https://openstax.org/books/calculus-volume-3/pages/2-2-vectors-in-three-dimensions (retrieved 2026-10-02)
  2. I know Components, Components of v 1, 2 gives Magnitude ‖v‖ 2.236068, Exact magnitude √5, Unit vector v ÷ ‖v‖ ⟨0.447214, 0.894427⟩, Direction angle 63.434949.Source: OpenStax, Calculus Volume 3, §2.1 Vectors in the Plane (‖v‖ = √(x² + y²); unit vector v ÷ ‖v‖; Example 2.7: ⟨1, 2⟩ has magnitude √5), https://openstax.org/books/calculus-volume-3/pages/2-1-vectors-in-the-plane (retrieved 2026-10-02)
  3. I know Components, Components of v 3, 4 gives Magnitude ‖v‖ 5, Exact magnitude 5, Magnitude squared ‖v‖² 25, Unit vector v ÷ ‖v‖ ⟨0.6, 0.8⟩, Direction angle 53.130102.Source: OpenStax, Calculus Volume 3, §2.1 Vectors in the Plane (‖v‖ = √(x² + y²); unit vector v ÷ ‖v‖; Example 2.7: ⟨1, 2⟩ has magnitude √5), https://openstax.org/books/calculus-volume-3/pages/2-1-vectors-in-the-plane (retrieved 2026-10-02)
  4. I know Start and end points, Start point P 1, 2, End point Q 4, 6 gives Magnitude ‖v‖ 5, Vector v ⟨3, 4⟩.Source: OpenStax, Calculus Volume 3, §2.1 Vectors in the Plane (‖v‖ = √(x² + y²); unit vector v ÷ ‖v‖; Example 2.7: ⟨1, 2⟩ has magnitude √5), https://openstax.org/books/calculus-volume-3/pages/2-1-vectors-in-the-plane (retrieved 2026-10-02)
  5. I know Components, Components of v 1, -1, 0 gives Magnitude ‖v‖ 1.414214, Exact magnitude √2.Source: OpenStax, Calculus Volume 3, §2.2 Vectors in Three Dimensions (‖v‖ = √(x² + y² + z²); Example 2.19: ⟨−2, 9, 5⟩ has magnitude √110 and ⟨1, −1, 0⟩ has magnitude √2), https://openstax.org/books/calculus-volume-3/pages/2-2-vectors-in-three-dimensions (retrieved 2026-10-02)
  6. I know Components, Components of v 0.5, 0.5 gives Exact magnitude (1/2)√2, Magnitude ‖v‖ 0.707107.Source: OpenStax, Calculus Volume 3, §2.1 Vectors in the Plane (‖v‖ = √(x² + y²); unit vector v ÷ ‖v‖; Example 2.7: ⟨1, 2⟩ has magnitude √5), https://openstax.org/books/calculus-volume-3/pages/2-1-vectors-in-the-plane (retrieved 2026-10-02)

How it works

For a vector v = ⟨v₁, v₂, …, vₙ⟩:

  • Magnitude: ‖v‖ = √(v₁² + v₂² + … + vₙ²).
  • From two points: with start P and end Q, v = Q − P, coordinate by coordinate (q₁ − p₁, q₂ − p₂, …).
  • Magnitude squared: ‖v‖² = v₁² + v₂² + … + vₙ².
  • Exact magnitude: each number is read exactly as typed (0.5 is 1/2), so ‖v‖² is an exact fraction p/q in lowest terms. Then ‖v‖ = √(p × q) ÷ q, and √(p × q) is simplified to k√r, with r having no square factor.
  • Unit vector: v ÷ ‖v‖, each component divided by the magnitude. None for the zero vector.
  • Direction angle (2D only): θ = atan2(y, x) in degrees, moved into the range from 0° up to 360° (add 360° to a negative angle). None for the zero vector.

Rules

  • 1 to 10 components. From two points, P and Q must have the same number of coordinates; otherwise there is no answer.
  • A component of Q − P, or a magnitude, beyond the largest double-precision number has no answer. A magnitude squared that large is left out.
  • The exact form is shown when p × q is at most 10¹²; it is left out above that.

Output format. The magnitude and its square are double-precision numbers (the magnitude is computed with a scaled square root, like Python’s math.hypot). Vectors are written ⟨a, b, c⟩ with each component to 6 significant digits, trailing zeros dropped, and a true minus sign (−). The exact form is written √110, 3√2, (1/2)√2, or a fraction such as 5 or 5/2 when the root is exact. The angle shows up to 4 decimals.

Worked examples by hand

⟨−2, 9, 5⟩. ‖v‖² = 4 + 81 + 25 = 110, so ‖v‖ = √110 ≈ 10.488088.

⟨1, 2⟩. ‖v‖ = √(1 + 4) = √5 ≈ 2.236068. Unit vector ⟨1/√5, 2/√5⟩ = ⟨0.447214, 0.894427⟩. Angle atan2(2, 1) = 63.4349°.

⟨3, 4⟩. ‖v‖ = √(9 + 16) = √25 = 5. Unit vector ⟨0.6, 0.8⟩; angle atan2(4, 3) = 53.1301°.

From P(1, 2) to Q(4, 6). v = ⟨4 − 1, 6 − 2⟩ = ⟨3, 4⟩, so ‖v‖ = 5.

⟨1, −1, 0⟩. ‖v‖ = √(1 + 1 + 0) = √2 ≈ 1.414214.

⟨0.5, 0.5⟩. ‖v‖² = 1/4 + 1/4 = 1/2, so p = 1, q = 2, and ‖v‖ = √2 ÷ 2 = (1/2)√2 ≈ 0.707107.

Other questions people ask

How do I find the magnitude of a vector?

Square each component, add the squares, and take the square root: ‖v‖ = √(x² + y²) in 2D and √(x² + y² + z²) in 3D. For ⟨3, 4⟩ that is √(9 + 16) = √25 = 5.

What is the magnitude of ⟨−2, 9, 5⟩?

√(4 + 81 + 25) = √110, about 10.488. This is Example 2.19 in OpenStax Calculus Volume 3.

How do I find the magnitude from two points?

Subtract the start point P from the end point Q to get the components, v = Q − P, then use the formula. From P(1, 2) to Q(4, 6): v = ⟨3, 4⟩ and ‖v‖ = 5. This is the distance between the two points.

What is a unit vector?

A vector of length 1. Divide each component by the magnitude: ⟨1, 2⟩ ÷ √5 = ⟨0.447214, 0.894427⟩. It points the same way as the vector. The zero vector has no unit vector.

Can a magnitude be negative?

No. It is a square root of a sum of squares, so it is 0 or more. It is 0 only for the zero vector, where every component is 0.

What is the direction angle?

For a 2D vector ⟨x, y⟩, the angle from the positive x axis turning counterclockwise, from 0° up to 360°. ⟨1, 2⟩ points at 63.4349°; ⟨−1, 0⟩ points at 180°.

Is this the same as the Richter magnitude of an earthquake?

No. This page measures the length of a vector in maths and physics. An earthquake magnitude is a logarithm of the size of the shaking, a different idea.