Angle Between Vectors Calculator
Enter the x, y and z components of two vectors and get the angle between them in degrees — built straight from the dot product and the vector magnitudes.
Works in 2D and 3D
Enter all three components for a 3D vector, or leave the z components at 0 to work with plain 2D vectors in the x–y plane.
Result in degrees
The angle always comes back between 0° and 180° — the smallest rotation that takes one direction onto the other.
What is the angle between two vectors?
Direction, not length
The angle between two vectors is how far apart their directions are, ignoring how long each one is. This angle between vectors calculator takes the x, y and z components of two vectors A and B and returns the angle between them in degrees, using the dot product and the magnitudes of the vectors. It is the number behind questions like "are these two directions perpendicular?", "how aligned are these forces?", or "what is the angle between these two edges?" in geometry, physics, graphics, and machine learning.
Enter the components of vectors A and B to get the angle between their directions in degrees instantly — anywhere from 0° to 180°.
The angle comes from the dot product of the two vectors divided by the product of their magnitudes, then fed through the inverse cosine.
θ = arccos( (A·B) / (|A| × |B|) )The dot product is A·B = ax·bx + ay·by + az·bz, and the magnitude of a vector is the square root of the sum of its squared components. Dividing the dot product by the two magnitudes gives the cosine of the angle, always between -1 and 1, and the inverse cosine turns that cosine back into an angle between 0° and 180°.
Suppose A = (1, 0, 0) and B = (0, 1, 0) — the x-axis and the y-axis.
Take the dot product
A·B = 1×0 + 0×1 + 0×0 = 0 — the components never overlap.
Find the magnitudes
The magnitudes are |A| = √(1² + 0² + 0²) = 1 and |B| = √(0² + 1² + 0²) = 1.
Divide and take the inverse cosine
cosθ = 0 / (1 × 1) = 0, so θ = arccos(0) = 90°. The two vectors are perpendicular.
The angle answers a single question: how far apart do the two vectors point? An angle of 0° means the vectors are parallel and point the same way — they are scalar multiples of each other, like (2, 0, 0) and (5, 0, 0). An angle of 90° means they are perpendicular (orthogonal): their dot product is zero and neither has any "shadow" along the other. An angle of 180° means they are anti-parallel — they lie along the same line but point in opposite directions, like (1, 2, 3) and (-1, -2, -3). Everything in between measures partial alignment: angles below 90° mean the vectors broadly agree in direction (positive dot product), while angles above 90° mean they broadly oppose each other (negative dot product). Because the formula divides out both magnitudes, the result depends only on direction, never on how long the vectors are — doubling a vector leaves the angle unchanged.
The formula is exact, but a couple of practical points are worth keeping in mind.
Needs two nonzero vectors and returns 0°–180°
The angle is only defined when both vectors have a nonzero length: the zero vector (0, 0, 0) has no direction, so dividing by its magnitude is undefined and the calculator returns no result. The output is always the unsigned angle between 0° and 180° — it tells you how far apart the directions are but not which way you would rotate from one to the other. For a signed or counter-clockwise angle in a plane you need an oriented method such as atan2.