Vector calculator

Use this vector calculator to find the magnitude of a vector, add and subtract vectors, and work out the dot product, the cross product and the angle between two vectors — in 2D or 3D, with full working.

a =

Whole numbers, fractions (1/2) and decimals (0.5). An empty box counts as 0.

Result
|a| = 3

The magnitude of the vector (2, −1, 2) is 3.

Step-by-step working

  1. The magnitude of a vector is the square root of the sum of the squares of its components:

    |a| = √(x² + y² + z²)= √(2² + (−1)² + 2²)= √(4 + 1 + 4) = √9= 3

Formula

|a|=√(x² + y² + z²)

x, y and z are the components of a vector; the subscripts 1 and 2 refer to vectors a and b. The formula changes with the operation.

How we got there

|a| = √9 = 3

If the dot product is zero, the vectors are perpendicular. The magnitude of the cross product equals the area of the parallelogram formed by the two vectors.

How to work with vectors by hand

  1. Magnitude — the square root of the sum of squares

    For a = (2, −1, 2): |a| = √(4 + 1 + 4) = √9 = 3.

  2. Dot product — the sum of the products of components

    For b = (1, 2, 2): a · b = 2 · 1 + (−1) · 2 + 2 · 2 = 4.

  3. The angle — through the cosine

    cos φ = (a · b) / (|a| · |b|) = 4 / (3 · 3) = 4/9, so φ ≈ 63.61°.

Vectors coming up at GCSE or A level? Find a maths tutor for Year 10

Frequently asked questions

Take the square root of the sum of the squares of its components: for a = (3, 4) the magnitude is √(9 + 16) = 5.

Multiply the matching components and add the results: (1, 2, 3) · (4, 5, 6) = 4 + 10 + 18 = 32.

Divide the dot product by the product of the magnitudes — that gives the cosine of the angle. Then use inverse cosine to find the angle itself.

When their dot product is zero. The calculator shows this on a separate line under the result.

It is a vector perpendicular to both vectors, and its magnitude equals the area of the parallelogram they form. It only exists for vectors in 3D: choose ‘Cross product’ and the cross product calculator works out each component.

Vectors going the wrong way?

Book a free introductory lesson with a Mathema tutor. 30 minutes online, no commitment — we find the gap and the plan to close it.