angle between two vectors calculator

Vector Angle Calculator (2D or 3D)

Enter vector components below. For 2D vectors, set the z-values to 0.

Formula: θ = cos-1[(A · B) / (|A||B|)]
Vector A
Vector B
Enter vector values and click Calculate Angle.

What this angle between two vectors calculator does

This calculator finds the angle between two vectors using the dot product formula. It works for both 2D and 3D vector inputs and returns the result in degrees and radians. If you are studying algebra, calculus, linear algebra, physics, engineering, or computer graphics, this is one of the most common vector operations you will use.

In short: if you want to quickly find the vector angle, check whether vectors are perpendicular, or verify directional similarity, this tool gives you the exact answer.

How the vector angle formula works

Core equation

The angle θ between vectors A and B is:

θ = cos-1[(A · B) / (|A||B|)]

  • A · B is the dot product.
  • |A| and |B| are vector magnitudes.
  • The output angle is in the range 0° to 180°.

Dot product in 3D

For A = (Ax, Ay, Az) and B = (Bx, By, Bz):

A · B = AxBx + AyBy + AzBz

Magnitude formula

|A| = √(Ax2 + Ay2 + Az2) and similarly for |B|.

Step-by-step example

Let A = (1, 2, 0) and B = (3, 1, 0):

  • Dot product: A · B = (1)(3) + (2)(1) + (0)(0) = 5
  • |A| = √(12 + 22) = √5
  • |B| = √(32 + 12) = √10
  • cos(θ) = 5 / (√5 × √10) = 5 / √50
  • θ ≈ 45.00°

This tells us the vectors point in somewhat similar directions, separated by about 45 degrees.

Interpreting your result

  • : vectors point in exactly the same direction.
  • 90°: vectors are perpendicular (orthogonal).
  • 180°: vectors point in opposite directions.

If your result is very close to 90° (like 89.999°), that usually means rounding effects.

Common mistakes to avoid

  • Using a zero vector (magnitude = 0). The angle is undefined in that case.
  • Forgetting to include the z-component in 3D problems.
  • Mixing degrees and radians while interpreting output.
  • Not clamping floating-point values near -1 or 1 before applying arccos.

Where this is used

An angle between vectors calculator is useful in:

  • Physics (forces, velocity, work)
  • Machine learning (cosine similarity)
  • Computer graphics (lighting and shading)
  • Robotics and navigation (directional alignment)
  • Data science and high-dimensional geometry

Quick FAQ

Can this calculator handle 2D vectors?

Yes. Just enter 0 for both z-components.

Why do I sometimes get exactly 0° or 180°?

That means the vectors are collinear: same direction (0°) or opposite direction (180°).

Is this a dot product calculator too?

Yes. The result section also shows the dot product and each vector magnitude so you can check all intermediate values.

Final thoughts

If you need to find angle between vectors quickly and accurately, this tool is a practical solution. It gives clear numeric output, supports common 2D/3D cases, and helps you verify vector direction relationships instantly.

🔗 Related Calculators