Angle Between Two Vectors Calculator

This calculator finds the angle between two vectors in two or three dimensions using the dot product formula, the standard method used in physics, engineering, computer graphics and data science whenever you need to know how much two directions differ. Choose whether you are working in 2D or 3D, then enter the x, y (and z) components of vector A and vector B, for example forces, velocities or surface normals. The calculator works out the dot product of the two vectors and their magnitudes (lengths), divides one by the other to get the cosine of the angle, then takes the arccos to return the actual angle. Results appear as the angle in degrees and radians, the dot product, and a plain-English relationship such as parallel, perpendicular, acute or obtuse, so you can see at a glance how the vectors are oriented to each other. A working panel below shows every step, the dot product, both magnitudes, their product, cos(theta) and the final theta, so you can check the arithmetic or learn the method rather than just read off a number. Because the angle depends only on direction, not size, scaling a vector up or down never changes the result. Watch for the zero vector: if either vector has no length, the angle is mathematically undefined and the calculator flags this rather than showing a false answer.

Advertisement
Standard formula  Dot product method: theta = arccos((A · B) / (|A| × |B|)).

1. Dimensions

2. Vector A

ax
ay
az

3. Vector B

bx
by
bz
One or more vectors has zero magnitude. The angle is undefined when a vector has no length.

Angle Between the Vectors

Angle (Degrees)
12.93°
degrees
Angle (Radians)
0.2257
rad
Dot Product
32.0000
A · B
Relationship
Acute angle
vector orientation

Working

Dot product (A · B)32.0000
Magnitude |A|3.7417
Magnitude |B|8.7750
|A| × |B|32.8329
cos(theta) = dot / (|A||B|)0.974632
theta = arccos(cos theta)12.9332° / 0.2257 rad

Vector Properties

Vector A components(1.0000, 2.0000, 3.0000)
Vector B components(4.0000, 5.0000, 6.0000)
|A| (magnitude of A)3.7417
|B| (magnitude of B)8.7750
Unit vector same direction?No
Angle12.9332° (0.2257 rad)
Result: Enter vector components above to calculate the angle.

How to Find the Angle Between Two Vectors

The angle between two vectors is found using the dot product formula. For vectors A and B, the formula is:

theta = arccos( (A · B) / (|A| × |B|) )

where A · B is the dot product and |A| and |B| are the magnitudes of the vectors. The result is always between 0 and 180 degrees (0 and pi radians).

Step-by-Step Method (3D Example)

For vectors A = (1, 2, 3) and B = (4, 5, 6):

StepCalculationResult
Dot product(1×4) + (2×5) + (3×6)4 + 10 + 18 = 32
Magnitude |A|sqrt(1² + 2² + 3²) = sqrt(14)3.7417
Magnitude |B|sqrt(4² + 5² + 6²) = sqrt(77)8.7750
Product |A|×|B|3.7417 × 8.775032.8327
cos(theta)32 / 32.83270.97463
Angle thetaarccos(0.97463)12.93 degrees (0.2257 rad)

This matches the calculator default output above.

Dot Product Formula

For 2D vectors A = (ax, ay) and B = (bx, by):

A · B = axbx + ayby

For 3D vectors A = (ax, ay, az) and B = (bx, by, bz):

A · B = axbx + ayby + azbz

Special Cases

AngleDot ProductRelationship
0 degreesPositive maximum (= |A||B|)Parallel (same direction)
90 degrees0Perpendicular (orthogonal)
180 degreesNegative maximum (= -|A||B|)Anti-parallel (opposite directions)

2D Example

For vectors A = (3, 4) and B = (1, 0):

A · B = 3×1 + 4×0 = 3. |A| = sqrt(9+16) = 5. |B| = 1. cos(theta) = 3/5 = 0.6. theta = arccos(0.6) = 53.13 degrees.

Applications

The angle between vectors is used in physics (force components, work = F·d×cos(theta)), computer graphics (lighting calculations, surface normals), machine learning (cosine similarity between document vectors), and engineering (structural analysis, navigation).

Related Calculators

Sources and method: Dot product and angle formula from standard linear algebra. Anton, H. and Rorres, C. (2014). Elementary Linear Algebra. 11th ed. Wiley. Stewart, J. (2015). Calculus. 8th ed. Cengage. Formula: theta = arccos((A · B) / (|A||B|)) where the result is in the range [0, pi] radians.

This calculator computes the angle between two vectors using exact floating-point arithmetic. Results are rounded to four decimal places for display. The formula is valid for any non-zero vectors in 2D or 3D space. If either vector has zero magnitude, the angle is mathematically undefined.