Vector calculator

Enter two vectors with two or three components. You get their sum and difference, dot and cross product, lengths, the angle between them, the projection of a onto b and whether they are orthogonal or parallel.

Two or three components separated by commas or spaces, for example 1, 2, 3. Fractions like 1/2 work.
Must have as many components as a.
Angle between a and b12.933154°
Dot product a · b32
Cross product a × b(-3, 6, -3)
Angle in radians
0.22572613
Sum a + b
(5, 7, 9)
Difference a − b
(-3, -3, -3)
Length |a|
√14 ≈ 3.7416574
Length |b|
√77 ≈ 8.7749644
Parallelogram area |a × b|
√54 ≈ 7.3484692
Projection of a onto b
(128/77, 160/77, 192/77)
Scalar projection of a onto b
3.6467384
Unit vector of a
(0.26726124, 0.53452248, 0.80178373)
Relation
Neither parallel nor orthogonal

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Type vector a and vector b with two or three components each.
  2. The angle, dot product and cross product are shown first, then the other quantities.

How it works

All component arithmetic uses exact fractions, so a = (1/2, 1/3) works without rounding. Lengths are √(a·a). A square root of a whole number is shown as a radical with its decimal, like √14 ≈ 3.7416574. The angle comes from arccos of the dot product over the product of lengths, limited to the range −1…1 to protect against rounding.

Worked example

a = (1, 2, 3), b = (4, 5, 6):

  • a · b = 4 + 10 + 18 = 32.
  • a × b = (2·6 − 3·5, 3·4 − 1·6, 1·5 − 2·4) = (−3, 6, −3).
  • |a| = √14, |b| = √77, so the angle is arccos(32/√1078) ≈ 12.93°.
  • Projection of a onto b = 32/77 · (4, 5, 6) = (128/77, 160/77, 192/77).

Tips

  • If the dot product is 0 the vectors are perpendicular; if the cross product is the zero vector they are parallel.
  • For matrices and systems of equations see the matrix calculator and the linear system solver.

Frequently asked questions

What is the dot product?

For a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃) it is a₁b₁ + a₂b₂ + a₃b₃, also equal to |a||b|cos θ. It is zero exactly when the vectors are perpendicular.

What is the cross product?

In 3D, a × b = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁). It is perpendicular to both vectors, and its length equals the area of the parallelogram they span. For 2D vectors the tool gives the single number a₁b₂ − a₂b₁, the signed area.

How is the angle between vectors found?

θ = arccos(a·b / (|a||b|)). The result is between 0° and 180°.

What is the projection of a onto b?

It is the part of a that points along b, ((a·b)/(b·b))·b. The scalar projection is the signed length of that part, (a·b)/|b|.

Are results exact?

Sums, products, the dot and cross products and the projection are exact fractions. Lengths, the angle and the unit vector involve square roots and are shown as decimals, with the exact radical for whole-number lengths.

More in Math

All tools in this category: Math ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.