➡️ Vector Calculator

Enter two vectors (comma-separated, 2D or 3D) to compute their dot product, cross product (3D only), magnitudes, the angle between them, and their sum and difference.

Dot for the angle, cross for the perpendicular

Both products come straight from the components, and the angle follows from the dot product once the magnitudes are known:

A · B = a₁b₁ + a₂b₂ + a₃b₃        |A| = √(A · A)
cos θ = (A · B) / (|A| |B|)
A × B = (a₂b₃ − a₃b₂,  a₃b₁ − a₁b₃,  a₁b₂ − a₂b₁)

The defaults (1, 2, 3) and (4, 5, 6) give a dot product of 4 + 10 + 18 = 32, magnitudes of 3.7417 and 8.775, and an angle of 12.93°. The cross product is (−3, 6, −3), which points at right angles to both.

What each row is telling you

The cosine is clamped to −1 to 1 before the angle is taken, so rounding drift between near-identical vectors cannot push it out of range. A zero-length vector has no direction, so its angle reads undefined rather than 0.

Frequently asked questions

What is the dot product of (1, 2, 3) and (4, 5, 6)?

32. Multiply the matching components and add: 1x4 = 4, 2x5 = 10 and 3x6 = 18.

How do I tell whether two vectors are perpendicular?

Their dot product is zero. (1, 2, 3) and (2, -1, 0) give 2 - 2 + 0 = 0, and the angle row confirms 90 degrees.

What does the cross product actually give you?

A third vector at right angles to both, its length equal to the area of the parallelogram they form. For the defaults that is (-3, 6, -3), 7.3485 long.