Dot, cross, length

Vector operations calculator

Educational tool; results are estimates for learning, verify with your textbook or instructor.

Pencils, a calculator, and vector notes on a desk.
Pencils and a calculator for vector arithmetic you can also do by hand. Source

This tool computes standard Euclidean operations on two vectors $\mathbf{u}$ and $\mathbf{v}$ in $2$ or $3$ dimensions. You can ask for the dot product, a $3$D cross product, a magnitude, or a unit vector in the same direction.

The output is meaningful when the components are coordinates in the usual orthonormal basis, so length and angle have their school meanings. A dot product then equals $|\mathbf{u}||\mathbf{v}|\cos\theta$. A cross product then points along a direction orthogonal to both vectors, with length $|\mathbf{u}||\mathbf{v}|\sin\theta$.

This is not a computer algebra system for abstract vector spaces. It does not handle $n$ components, it does not compute a line integral, and it does not prove Stokes theorem. It is arithmetic on two arrows you typed.

Vector u

Vector v

How to use the calculator

Choose $2$D or $3$D. In $2$D the third boxes hide. Enter components for $\mathbf{u}$ and $\mathbf{v}$. The default pair is $\langle 1,0,0\rangle$ and $\langle 0,1,0\rangle$, whose dot product is $0$ and whose cross product is $\langle 0,0,1\rangle$.

Pick an operation and press Compute. Dot product needs both vectors. Cross product needs $3$D. Magnitude and unit vector each use one vector, named in the menu.

How to read the output

A dot product is a single number. Zero means the vectors are orthogonal (or one of them is zero). A large positive value means they point in a similar direction. A negative value means they form an obtuse angle.

A cross product is a vector. It is orthogonal to both inputs when both are nonzero and not parallel. Its direction follows the right hand rule used in most multivariable courses. If you only needed an area of a parallelogram, read the magnitude of that cross product.

A unit vector has length $1$ and the same direction as the source vector. Use it when a later formula wants a direction and not a size.

Common pitfalls

Cross product is not defined as a $3$ vector in $2$D on this page. Switch the dimension menu to $3$D, even if the third components are zero.

The zero vector has no unit vector. The page will say so. Do not invent a direction for a vector with no length.

Components are just numbers. If your data came from a basis that is not orthonormal, the school formulas for angle and length do not apply without a Gram matrix. This tool does not know a custom inner product. The four properties, and a weighted product that disagrees with the dot product, are on inner product spaces.

Related reading

Vector language in calculus is mapped on multivariable and vector calculus and on linear algebra. Circulation and curl use these operations: see Stokes theorem intuition and the Stokes theorem, vector, and vector field glossary entries.

Nearby tools: the divergence and curl calculator estimates divergence and curl of a field, the 2 by 2 matrix calculator checks a small matrix, and the 2 by 2 eigenvalue calculator checks stretch factors. A 3 by 3 determinant is the 3 by 3 matrix calculator. Elimination of a system is the reduced row echelon form calculator. Stretch factors of that larger matrix are the 3x3 eigenvalue calculator. A whole list of vectors, turned into an orthogonal basis, is the Gram Schmidt calculator. This page still does not know a custom inner product.

Disclaimer. Educational estimate only. This page is not a computer algebra system and not a proof. See the site disclaimer and the FAQ on calculators versus understanding.

Common questions

What does a zero dot product mean?

The vectors are orthogonal, or at least one of them is the zero vector. For nonzero vectors, the angle between them is a right angle in the usual Euclidean geometry.

Why is cross product only in 3D here?

The usual cross product that returns another 3 vector is a 3D construction. In 2D people sometimes report a signed scalar instead. This page keeps the vector form and asks you to switch to 3D.

When does a unit vector fail?

When the source vector is zero. Division by length would be division by zero. A direction is not defined in that case.

Can I read an angle from the output?

From a dot product, yes in principle: cosine of theta is the dot product divided by the product of the lengths. Compute those three pieces, then take arccos yourself. The page does not print theta.

Want a tool that matches a new explainer, or a check that a page and a calculator disagree? Write a short note.

Suggest a topic or tool