Angle Between Two Vectors Calculator

Calculate the angle between two 2D, 3D, or 4D vectors in degrees and radians. Get the dot product, magnitudes, cosine similarity, and step-by-step work. Private—runs locally in your browser.

Vectors & Settings

Vector a: Components

Vector b: Components

Enter vectors to see results…
Show steps will appear here after you calculate.

Formula: θ = arccos((a·b)/(||a||·||b||)) for non-zero vectors. We clamp the ratio to [-1,1] to avoid NaN from rounding. Press Enter in any field to compute.

Preview (2D)

In 2D mode, shows a, b, and the measured angle. 3D and 4D results are calculated numerically.

Advertisement

Release update v1.1

v1.1 (May 21, 2026)

  • Added 4D vector support for component and two-point inputs.
  • Added step-by-step work for dot products, magnitudes, formula substitution, and arccos.
  • Added two-point vector entry so each vector can be built from an initial and terminal point.
  • Updated the page structure, title, and explanatory sections around calculator-focused search intent.

How to Use the Angle Between Two Vectors Calculator

  1. Choose 2D, 3D, or 4D vectors.
  2. Select whether you want to enter vector components or build each vector from two points.
  3. Enter the components of vector a and vector b, or enter the initial and terminal points for each vector.
  4. Click Calculate.
  5. Read the angle in degrees and radians.
  6. Use the step-by-step work to check the dot product, magnitudes, and cosine value.

Angle Between Two Vectors Formula

For nonzero vectors a and b, the angle θ is found from the dot-product identity:

cos θ = (a · b) / (||a|| ||b||)

θ = arccos((a · b) / (||a|| ||b||))

The result is between and 180°. The calculator clamps the cosine value to [-1, 1] before taking arccos to avoid floating-point rounding errors.

Step-by-Step Example in 2D

Let a = (3, 1) and b = (2, 4).

Dot product: a · b = 3·2 + 1·4 = 10

Magnitudes: ||a|| = √(3² + 1²) = √10 and ||b|| = √(2² + 4²) = √20

Substitute: cos θ = 10 / (√10 · √20) = 1 / √2 ≈ 0.7071

Take arccos: θ = arccos(0.7071) ≈ 0.7854 rad = 45°

Step-by-Step Example in 3D

Let a = (1, 2, 3) and b = (4, -5, 6).

First compute the dot product:

a · b = 1·4 + 2·(-5) + 3·6 = 4 - 10 + 18 = 12

Now compute the magnitudes:

||a|| = √(1² + 2² + 3²) = √14

||b|| = √(4² + (-5)² + 6²) = √77

Then substitute into the formula:

cos θ = 12 / (√14 · √77)

θ = arccos(12 / √1078) ≈ 68.58°

Angle Between Vectors from Two Points

If your vectors are given by points, subtract the initial point from the terminal point first.

For example, if vector a goes from A(1, 2) to B(4, 6), then a = B - A = (4 - 1, 6 - 2) = (3, 4).

In 3D or 4D, use the same idea: subtract each starting coordinate from the matching ending coordinate. A 4D vector from A(x1, y1, z1, w1) to B(x2, y2, z2, w2) is (x2 - x1, y2 - y1, z2 - z1, w2 - w1).

What the Result Means

  • : vectors point in the same direction.
  • 90°: vectors are perpendicular; the dot product is 0.
  • 180°: vectors point in opposite directions.
  • Acute angle: positive dot product.
  • Obtuse angle: negative dot product.
  • Cosine similarity: a normalized alignment score from -1 to 1.

Common Mistakes

  • Using a zero vector: If ||a|| = 0 or ||b|| = 0, the angle is undefined.
  • Forgetting to subtract points: Points are positions; vectors from points require terminal minus initial point.
  • Mixing units: Convert components to the same unit system before comparing directions.
  • Rounding too early: Keep extra precision until the final angle, especially for nearly parallel or opposite vectors.

Related Vector Calculators

For more vector work, use the related tools above to find vector projections, dot products, cross products, and 2D or 3D distances.

FAQ

How do you compute the angle between two vectors?

Use θ = arccos((a·b)/(||a||·||b||)) for nonzero vectors.

Can this calculator use points instead of components?

Yes. Choose Two points, enter the initial and terminal point for each vector, and the calculator converts each pair into a vector.

Does this work for 3D and 4D vectors?

Yes. Choose 3D or 4D to enter the matching number of components per vector or coordinates per point.

Is cosine similarity the same as the angle?

No. Cosine similarity is cos θ. The angle is found by taking arccos of that value.

5 Fun Facts about Vector Angles

Cosine works in any dimension

The same dot-over-magnitudes formula compares 2D arrows, 3D forces, or 1,536-D text embeddings—angle is dimension-agnostic.

Universal trick

Scaling can’t fool it

Multiply either vector by a positive number and the angle stays identical. That’s why cosine similarity ignores “loudness” and keeps only direction.

Scale-proof

Cross = sine detector

In 3D, ||a×b|| = ||a||·||b||·sin θ. Tiny cross magnitude? Nearly parallel. Max cross magnitude? Near 90° and the parallelogram area is huge.

Area insight

Sign reveals turning

In 2D, the scalar “cross” aₓbᵧ − aᵧbₓ is positive if you rotate counter-clockwise from a to b, negative if clockwise—a quick left/right test.

Orientation check

Slerp rides the angle

Smooth rotations (spherical linear interpolation) literally move along the angle between directions. Flight sims and VR cameras use this for buttery turns.

Smooth spins

Explore more tools