Vector Calculator

Enter vector a, and vector b or c where the operation needs them, with the numbers of each component. You get the exact result, lengths written as √ where they are not whole, and each step of the working.

Free Runs in your browser Checked Tuesday, November 10, 2026

Dimension

Two components for 2D (x, y), three for 3D (x, y, z). Every vector has the same number.

Pick the calculation. Only the vectors it needs are asked for.

Give the components in order: x y for 2D, x y z for 3D. Decimals such as 0.5 and fractions such as 1/2 are allowed.

The same number of components as vector a. Use a minus sign for a negative component.

Result

Result — The answer in exact form. A length is exact where it can be, such as √14, with a decimal approximation.
Check — For the dot and cross product: whether the vectors are perpendicular or parallel.

How it is worked out

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Choose the Dimension: 2D or 3D.
  2. Choose the Operation. Then type the components of vector a in Vector a (components separated by spaces), and of vector b or c where the page asks for it.
  3. Read Result. For the dot and cross product, Check says whether the vectors are perpendicular or parallel.
  4. Go through How it is worked out to see each component.

Dot, cross and triple products

The dot product of two vectors is the sum of the products of their components, a · b = a₁b₁ + a₂b₂ + a₃b₃. It is zero when the vectors are perpendicular. The cross product of two 3D vectors is a vector perpendicular to both, with components (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁). The triple product a · (b × c) is the determinant of the matrix with rows a, b and c.

a · b = a₁b₁ + a₂b₂ + a₃b₃
a × b = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁)
  • The length of a is |a| = √(a · a), and the unit vector a ÷ |a| has length 1.
  • The angle between a and b follows from cos θ = (a · b) ÷ (|a| |b|).
  • The projection of a onto b is ((a · b) ÷ (b · b)) b, and its scalar component is (a · b) ÷ |b|.

Exactness and what the calculator does not cover

Components are read exactly, so the dot, cross and triple products and the projection are exact. A length is kept as √ of a whole or fraction number where that is possible, and the angle is a decimal because the arccosine of most values is not a simple fraction of π.

  • Vectors in 2D and 3D only; the cross product in 2D is the single number a₁b₂ − a₂b₁.
  • Complex components, vectors in four or more dimensions, and matrix operations are not covered; use the matrix calculator for matrices.
  • A zero vector has no direction, so the unit vector, angle and projection onto it are refused.

Worked example: the cross product of (1, 2, 3) and (4, −5, 6)

The first component of a × b is 2 × 6 − 3 × (−5) = 12 + 15 = 27, the second is 3 × 4 − 1 × 6 = 6 and the third is 1 × (−5) − 2 × 4 = −13. So a × b = (27, 6, −13). As a check, a · (27, 6, −13) = 27 + 12 − 39 = 0, so the cross product is perpendicular to a.

The dot product a · b is 4 − 10 + 18 = 12, and the angle between the vectors follows from cos θ = 12 ÷ (√14 × √77), about 0.3655, which is 68.56°.

Result
Cross product a × b (27, 6, −13)
Dot product a · b 12
Length of a √14 ≈ 3.7417
Angle between a and b 68.56° (1.1966 rad)

Frequently asked questions

What does a dot product of zero tell me?

It means the two vectors are perpendicular, so they meet at a right angle. The page writes this as Perpendicular in the check box, whenever the dot product comes out exactly 0.

Why is the cross product not a number in 3D?

The cross product of two 3D vectors is another vector, perpendicular to both. In 2D the same idea gives a single number, a₁b₂ − a₂b₁, and the page shows that number.

How do I type a vector?

Type its components in order, separated by spaces: 1 2 3 for the vector with x = 1, y = 2 and z = 3. Negative components need a minus sign, and decimals use your language's decimal mark.

Why does a length such as √14 appear instead of 3.74?

The square root is kept exact, so the result is √14 and its decimal approximation is shown after it. Only the decimal is rounded, never the calculation itself.

Are the vectors I type sent to a server?

No. The calculation runs in your browser, and nothing you type is sent to us.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.