3D Vector Angle Calculator

The angle between two vectors measures how their directions differ, from zero for parallel vectors up to 180 degrees for opposite ones. It comes straight from the dot product: the cosine of the angle equals the dot product divided by the product of the two magnitudes. This calculator takes two 3D vectors, computes the dot product and each magnitude, and returns the angle in both degrees and radians along with the cosine value. It is a staple of geometry, physics, and computer graphics for orientation and lighting.

0.00
0.00
0.00
0.00

Angle between vectors formula

a.b = ax*bx + ay*by + az*bz
|a| = sqrt(ax^2 + ay^2 + az^2)
|b| = sqrt(bx^2 + by^2 + bz^2)
cos(theta) = (a.b) / (|a| * |b|)
theta = arccos( cos(theta) )

The cosine of the angle is the dot product normalized by both magnitudes. Taking the inverse cosine yields the angle, which always lies between zero and 180 degrees.

Notes on the angle between vectors

  • Enter each vector as three comma-separated components.
  • A cosine of zero means the vectors are perpendicular.
  • A cosine of plus one means parallel; minus one means antiparallel.
  • The angle is always reported in the range zero to 180 degrees.
  • The angle is undefined if either vector has zero length.

Vector angle: frequently asked questions

How do you find the angle between two vectors?

The angle theta between two vectors satisfies cos theta equals the dot product of the vectors divided by the product of their magnitudes. Taking the inverse cosine of that ratio gives the angle, which lies between zero and 180 degrees.

What is the formula for the angle between 3D vectors?

For vectors a and b, cos theta = (a dot b) / (|a| times |b|), where a dot b = ax*bx + ay*by + az*bz and each magnitude is the square root of the sum of the squared components. Then theta = arccos of that value.

What does a 90 degree angle mean?

An angle of 90 degrees means the vectors are perpendicular, or orthogonal. This happens exactly when their dot product is zero, since the cosine of 90 degrees is zero.

What does a zero or 180 degree angle mean?

A zero degree angle means the vectors point in the same direction (parallel). A 180 degree angle means they point in exactly opposite directions (antiparallel). The cosine equals plus one and minus one respectively.

What if a vector has zero length?

The angle is undefined if either vector is the zero vector, because a zero-length vector has no direction and the formula would divide by zero. This calculator returns n/a in that case.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.