Uni-Sine
MathematicsVectors and matrices

Vector calculator

A vector calculator works out a vector's magnitude (its length) and direction, adds two vectors together, and finds the dot product, the cross product and the angle between them. In our Vector Calculator you type each vector's components, or drag its arrow on the grid, and every result updates as you go, in 2D or 3D.

It has three modes: Single for one vector, Two Vectors for adding and comparing a pair in 2D, and 3D for vectors with x, y and z components.

Try it

Vectors Calculator

Visualise magnitude, direction and operations

Go to its page

How to use the vector calculator

  1. Under Mode, choose Single, Two Vectors or 3D.
  2. In Vectors, type the x and y components of vector a, and of vector b if you have two. In 3D mode each vector also has a z component.
  3. Or drag the tip of an arrow on the grid. Turn on Snapping under Display to land on whole numbers.
  4. Read the Results: the magnitude and direction in Single mode; the dot product, angle and resultant in Two Vectors mode; the magnitudes, dot product, angle and cross product in 3D.
  5. Open Formulas to see each formula with your numbers worked through, including the unit vector in 2D.

Angles are in degrees unless you turn off Degrees under Display. The 3D view can be rotated, so it doubles as a 3D vector plotter. For practice, Practice and help sets random vector questions with hints and worked solutions.

Magnitude and direction of a vector

A 2D vector with components (x, y) has a magnitude given by Pythagoras, and a direction measured anticlockwise from the positive x-axis:

|\vec{v}| = \sqrt{x^2 + y^2}
\theta = \tan^{-1}\left(\frac{y}{x}\right)Then adjust for the quadrant the vector points into

Example 1: magnitude and direction

Find the magnitude and direction of (6, 8).

|\vec{v}| = \sqrt{6^2 + 8^2} = \sqrt{100} = 10

The direction is tan⁻¹(8/6) = 53.13°. In Single mode, type x = 6 and y = 8: the Results show |a| = 10 and θ = 53.13°.

Example 2: a vector pointing left

For (−4, 3), the magnitude is √(16 + 9) = 5. But tan⁻¹(3/−4) gives −36.87°, which points the wrong way: the vector points up and to the left, into the second quadrant. Add 180° to get 143.13°, which is what the calculator shows. Always sketch the vector to check the quadrant.

Vector addition calculator: the resultant

To add vectors, add their components: (a₁, a₂) + (b₁, b₂) = (a₁ + b₁, a₂ + b₂). The sum is called the resultant. On a diagram, place b so it starts where a ends; the resultant goes from the start of a to the end of b.

Example 3: adding two vectors

Add a = (3, 4) and b = (5, −2).

\vec{r} = (3 + 5,\ 4 + (-2)) = (8,\ 2)
0123456781234aba + bAOR
Head to tail: b starts where a ends, and the resultant a + b joins the start to the finish

The resultant has magnitude √(8² + 2²) = √68 ≈ 8.25 and direction tan⁻¹(2/8) = 14.04°. In Two Vectors mode, type both vectors: the Results give |r| = 8.25 and θr = 14.04°, and Formulas shows r = a + b = (8, 2).

Subtracting vectors

The calculator adds vectors but has no subtract button. To find a − b, type −b instead of b, which means changing the sign of each of its components, and read the resultant. For a = (3, 4) and b = (5, −2), type b as (−5, 2): the resultant is (−2, 6), which is a − b.

Dot product and the angle between two vectors

The dot product multiplies matching components and adds them: a · b = a₁b₁ + a₂b₂. It is a number, not a vector, and it gives the angle between the vectors:

\cos\theta = \frac{\vec{a} \cdot \vec{b}}{|\vec{a}||\vec{b}|}

For a = (3, 4) and b = (5, −2), a · b = 15 − 8 = 7, and the angle is 74.93°. If the dot product is 0, the vectors are perpendicular: (2, 3) and (−6, 4) give 2 × (−6) + 3 × 4 = 0, and the calculator shows θ = 90°. Our dot product calculator guide goes further, with 3D examples.

3D vector calculator: magnitude and cross product

In 3D mode each vector has three components, and the magnitude is √(x² + y² + z²). The calculator also gives the dot product, the angle between the vectors and the cross product, which is a vector perpendicular to both.

Example 4: two 3D vectors

Take a = (1, 2, 2) and b = (3, 0, 4).

  • Magnitudes: |a| = √(1 + 4 + 4) = 3 and |b| = √(9 + 0 + 16) = 5.
  • Dot product: 1 × 3 + 2 × 0 + 2 × 4 = 11, so cos θ = 11 ÷ 15 and θ = 42.83°.
  • Cross product: a × b = (2 × 4 − 2 × 0, 2 × 3 − 1 × 4, 1 × 0 − 2 × 3) = (8, 2, −6).

Type both into 3D mode and the Results match. The cross product calculator guide explains the cross product formula and the right-hand rule.

Check you have the magnitude formula:

practice
Pick an answer, then check it.
What is the magnitude of the vector (2, −3, 6)?

What the calculator gives in each mode

ResultSingleTwo Vectors3D
MagnitudeYesFor a, in FormulasYes, for both
Direction angleYesFor the resultant, and for a in FormulasNo
Resultant a + bNoYesNo
Dot productNoYesYes
Angle betweenNoYesYes
Cross productNoNoYes
Unit vectorIn FormulasIn Formulas, for aNo

Common mistakes

  • Getting the direction in the wrong quadrant. tan⁻¹ only gives angles between −90° and 90°. Sketch the vector and add 180° when it points left.
  • Adding magnitudes instead of components. |a + b| is usually not |a| + |b|. Add the components, then find the magnitude.
  • Dropping a negative when squaring. (−3)² is 9, not −9.
  • Treating the dot product as a vector. It is a single number. The cross product is the one that gives a vector.
  • Subtracting in the wrong order. a − b and b − a point in opposite directions.

Practise vectors in a short timed paper

Vectors come up in Geometry, Algebra 2 & SAT Math and College Linear Algebra practice, and in GCSE Maths Higher and A-level Maths: Mechanics in the UK. Each daily paper is a short timed paper of 8 questions worth 25 to 35 marks, and the papers mix topics.

Common questions

How do you find the magnitude of a vector?
Square each component, add them, and take the square root. For (6, 8) that is √(36 + 64) = 10. In 3D, include the z component too.
How do you add two vectors?
Add the matching components: (3, 4) + (5, −2) = (8, 2). The result is called the resultant.
How do you find the direction of a vector?
Use θ = tan⁻¹(y ÷ x), then check the quadrant: add 180° if the vector points left. The angle is measured anticlockwise from the positive x-axis.
Can the calculator subtract vectors?
Not directly. To find a − b, type b with the signs of its components changed, and the resultant is a − b.
What is the difference between the dot product and the cross product?
The dot product gives a number and tells you the angle between the vectors. The cross product, for 3D vectors, gives a new vector at right angles to both.
What does a dot product of zero mean?
The vectors are perpendicular, at 90° to each other, as long as neither is the zero vector.

Revision cards

Say the answer first, then flip the card to check it.

Where to go next

  • Solve it

    Vectors Calculator

    Visualise magnitude, direction and operations

    Open the tool
  • Test it

    Geometry, Algebra 2 & SAT Math

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
  • Test it

    College Linear Algebra

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · Vectors and matricesUnit vector: definition, formula and how to find oneWhat a unit vector is, how to find the unit vector in the direction of any vector in 2D or 3D, the i, j, k unit vectors, and worked examples.