Angle Between Two Vectors Calculator
Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 12/5/2026
The angle θ between two vectors u and v is found from cos θ = (u · v) / (‖u‖ × ‖v‖), then θ = arccos(cos θ). For u = (1, 2, 3) and v = (4, 5, 6): dot product 32, magnitudes 3.742 and 8.775, cos θ ≈ 0.9746, so θ ≈ 12.93°.
Explanation
Two vectors starting from the same point form an angle between 0° and 180°. You do not need a protractor to measure it: the dot product is enough. It has two expressions. The first uses coordinates: u · v = ux × vx + uy × vy + uz × vz. The second is geometric: u · v = ‖u‖ × ‖v‖ × cos θ, where ‖u‖ and ‖v‖ are the lengths (magnitudes) of the vectors and θ the angle between them. Setting the two equal gives cos θ = (u · v) / (‖u‖ × ‖v‖), and the inverse cosine does the rest. The sign of the dot product alone classifies the angle: positive means acute, zero means the vectors are orthogonal, negative means obtuse. When the cosine is exactly 1 or −1, the vectors are collinear, pointing the same way or opposite ways. The calculation works in the plane, with the z components left at 0, as well as in space. Two technical details are handled. First, the angle is undefined if either vector is zero, since you would divide by a zero magnitude: the calculator says so instead of showing a meaningless result. Second, for collinear vectors, floating-point rounding can produce a cosine very slightly above 1, which would break the inverse cosine, so the value is clamped to [−1, 1]. This angle is used in physics for the work done by a force, in computer graphics for surface lighting, in navigation, and in data analysis, where cosine similarity compares two documents. For the intermediate steps, see the dot product calculator and the vector magnitude calculator.
Example: u = (1, 2, 3) and v = (4, 5, 6)
Inputs
Components of u: 1, 2, 3. Components of v: 4, 5, 6.
Calculation
u · v = 1 × 4 + 2 × 5 + 3 × 6 = 32. ‖u‖ = √14 ≈ 3.7417; ‖v‖ = √77 ≈ 8.7750. cos θ = 32 / (3.7417 × 8.7750) ≈ 0.97463. θ = arccos(0.97463) ≈ 0.2257 rad.
Result
The angle between u and v is about 12.93°: the two vectors point in almost the same direction.
Frequently asked questions
Why is the angle always between 0° and 180°?
Because the inverse cosine returns a value in that range, and the angle between two vectors is not oriented. For a signed angle in the plane, from −180° to 180°, you also need the sign of the determinant.
How can I quickly tell whether two vectors are perpendicular?
Their dot product must be zero. For example, (2, 1, 0) and (−1, 2, 5) give 2 × (−1) + 1 × 2 + 0 × 5 = 0: they are orthogonal.
What is cosine similarity?
It is the cosine computed here, used in data analysis to compare two lists of values, such as the word frequencies of two texts. Close to 1, the two profiles are alike; close to 0, they have nothing in common.