Vector Magnitude and Direction Calculator

MAGNITUDE AND DIRECTION
Type a vector and press Work it out.
The length, the angle, and the check
Your vector
Write it however the question does: 3i + 4j, <3, 4>, (3, 4) or just 3, 4. Three components for a 3D vector: 2i - 3j + 6k. Components may be fractions or decimals. Holding deletes one character after another.
The length is a square root, so it is given exactly — √13, not 3.6055512755 — with the decimal underneath.
Tap a box, then use the keys
The angle is measured anticlockwise from the positive x-axis. It is worked out with atan2, not with tan−1(y/x), because the second and third quadrants come out wrong otherwise — the page shows you the difference when it matters.
How the length and the angle are found

This vector magnitude calculator gives the length and the direction of a vector, with the length left as an exact square root and the angle worked out so the quadrant is right.

Type 3i + 4j and you get 5 at 53.13°. Type <-3, 4> and you get 5 at 126.87° — not the −53.13° your calculator's tan button will hand you.

A Vector Magnitude Calculator Answers Two Questions, and Only Two

A vector is an arrow. How long it is, and which way it points. Everything on this page is one of those two things.

Length comes straight from Pythagoras. The components are the two sides of a right-angled triangle and the vector is the hypotenuse, so squaring, adding and rooting is the whole method. Three components in space simply means a third square joins the sum.

Direction is the angle measured anticlockwise from the positive x-axis. That part is where the trouble lives.

Vector Magnitude Is Usually a Surd, So Leave It as One

3i + 4j is the textbook example precisely because it works out neatly: √(9 + 16) = √25 = 5. Almost nothing else does.

Take the vector (2, 3): its magnitude is √13. Not 3.6056. Not 3.60555128. √13, which is exact, shorter to write, and the form an exam expects when it asks for an exact answer. Round it and the error travels into every line that follows.

Reducing the surd is the other place marks go astray. The magnitude of (2, 4) is √20, and √20 is not a finished answer — 20 has a square factor, so it becomes 2√5. This page pulls out the largest square factor every time, so what you copy down is already in the form a marker wants.

Where the Tan Button Lies to You

Here is the mistake this topic is known for.

To find the direction of (−3, 4) you would reach for θ = tan⁻¹(y/x) = tan⁻¹(4 ÷ −3) and your calculator returns −53.13°. That angle points down and to the right. The vector points up and to the left. They are 180° apart.

Why? Tangent repeats every 180°, so tan⁻¹ cannot tell a direction from its exact opposite. The ratio 4 ÷ −3 is the same as −4 ÷ 3, and those are two different vectors. Nothing in the ratio records which one you meant.

What fixes it is looking at the signs of x and y separately, which is what the function atan2 does and what this page uses. Feed it x = −3 and y = 4 and it returns 126.87°, because a negative x with a positive y can only be quadrant 2.

Signs of x and yQuadrantFix the tan answer by
both positive 1 nothing
x negative, y positive 2 adding 180°
both negative 3 adding 180°
x positive, y negative 4 adding 360°

Learn the table if you like. Sketching the arrow first is faster and harder to get wrong, and it is what this page does for you in the working.

Three Dimensions Need Three Angles

A vector in space cannot be pinned down by one angle. It takes three: one to each axis, written α, β and γ.

Divide each component by the magnitude and you get the direction cosines, and the inverse cosine of each gives its angle. For 2i − 3j + 6k the magnitude is a tidy 7, and the angles come to 73.40°, 115.38° and 31.00°.

A free check comes with this. Those three cosines, squared, always add to exactly 1. If yours do not, one of your angles is wrong, and you have found that out in a single line rather than by redoing everything.

The Zero Vector Is Not an Error

Enter (0, 0) and the length is 0 and the direction is undefined.

Undefined, not 0°. An arrow of no length does not point anywhere, so there is no angle to report. Tools that quietly return 0° for this are wrong, and a question that produces a zero vector usually means something in the physics cancelled out — which is the interesting part, not a failure.

How to Use This Vector Magnitude Calculator

Write the vector the way your question does. 3i + 4j, <3, 4>, (3, 4) and plain 3, 4 are all read the same way, and three components give a 3D vector. Fractions and decimals are fine and stay exact: (1/2, 1/3) comes back as (1/6)√13 rather than 0.6009.

Results come back as a surd with the decimal under it, the direction in degrees and radians, and the quadrant. When the tan button would have given a different answer, the page says so and prints both, because knowing you were about to be wrong is worth more than the right number on its own.

Before anything appears the answer is checked: the surd is squared back to see that it reproduces |v|² exactly, the surd is re-factored to confirm nothing square is left inside it, and the angle is used to rebuild the original components. For a 3D vector the direction cosines are squared and must total 1. The number of checks that passed is printed with the working. The length itself is exactly what the distance formula computes, with one of the two points pinned at the origin.

Vector Magnitude and Direction Calculator FAQ

How do you find the magnitude of a vector?
Square each component, add them, and take the square root. For 3i + 4j that is the square root of 9 + 16, which is 5. In three dimensions a third square joins the sum.
What is the magnitude of the vector 3i + 4j?
5. The components 3 and 4 form a right-angled triangle whose hypotenuse is 5, which is why this example appears in every textbook.
How do you find the direction of a vector?
The direction is the angle measured anticlockwise from the positive x-axis. Its tangent is y divided by x, but the inverse tangent alone is not enough: you also need the signs of x and y to fix the quadrant.
Why does tan inverse give the wrong angle?
Tangent repeats every 180 degrees, so it cannot tell a direction from its exact opposite. For the vector (−3, 4) the tan button returns −53.13 degrees when the true direction is 126.87 degrees. Using atan2, which reads the signs of both components, fixes it.
Should the magnitude be left as a square root?
Yes, unless it comes out whole. The magnitude of (2, 3) is the square root of 13, and rounding it to 3.6056 carries an error into every later line. Exams marking exact answers expect the surd.
How do you simplify a surd like the square root of 20?
Take out the largest square factor. 20 is 4 times 5, and the square root of 4 is 2, so the square root of 20 is 2 times the square root of 5. This page always reduces the surd before showing it.
How do you find the direction of a 3D vector?
A vector in space needs three angles, one to each axis. Divide each component by the magnitude to get the direction cosines, then take the inverse cosine of each. The three cosines squared always add to 1.
What is the magnitude of the zero vector?
Zero, and it has no direction at all. That is not a failure of the arithmetic: a vector of no length cannot point anywhere, so the direction is undefined rather than zero degrees.

Square, add, root — then look at the signs before you trust the angle.