Angle Between 2 Vectors Calculator
Enter the components of two vectors. For 2D vectors, leave the z components as 0. The calculator uses the dot product formula to find the angle between them in degrees.
Vector a
Vector b
Vectors point in directions, and the angle between them tells you how closely those directions line up. This Angle Between 2 Vectors Calculator takes two vectors, applies the classic dot product formula, and returns the angle between them in degrees, with every intermediate step shown so you can check the math yourself.
Whether you are working through a physics problem about force and displacement, a geometry assignment, or a computer graphics project that needs to know how two surfaces are oriented, finding the angle between vectors is one of the most useful operations in vector math. Doing it by hand means computing a dot product, two square roots, a division, and an inverse cosine — easy to get right, but also easy to mistype on a calculator. This tool handles all of it in one click and lays out the working: the dot product, both magnitudes, the value of cos θ, and the final angle in both degrees and radians.
What This Calculator Does
This calculator accepts two vectors in either two or three dimensions. You type in the x, y, and z components of vector a and vector b, and it computes the angle between them using the relationship cos θ = (a · b) / (|a| × |b|). The headline result is the angle in degrees, rounded to two decimal places. Beneath it, the calculator shows the full breakdown: the dot product of the two vectors, the magnitude (length) of each vector, the value of cos θ, and the equivalent angle in radians.
It handles the edge cases properly too. If you enter a zero vector (all components zero), which has no direction and therefore no defined angle, the calculator tells you that instead of returning a nonsense number. Values that would push cos θ slightly outside the range −1 to 1 due to floating-point rounding are clamped, so the inverse cosine always computes cleanly.
How to Use the Angle Between 2 Vectors Calculator
Using the calculator takes less than a minute. First, enter the components of your first vector in the fields labeled x (a1), y (a2), and z (a3). If your vectors are two-dimensional, simply leave both z fields as 0 — the formula works exactly the same for 2D vectors when the third component is zero. Next, enter the components of your second vector in the x (b1), y (b2), and z (b3) fields. Then press Calculate.
The angle appears at the top of the results box in large type, followed by the step-by-step breakdown. If you made a typo or entered a zero vector, a red error message explains the problem. Pressing Reset clears the form so you can start a new calculation. Negative components are fine — vectors pointing in negative directions are handled the same as any others.
The Formula Behind the Calculation
The angle θ between two vectors a and b comes from the geometric definition of the dot product:
cos θ = (a · b) / (|a| × |b|)
Each piece is straightforward. The dot product multiplies matching components and adds the results: a · b = a1×b1 + a2×b2 + a3×b3. The magnitude of a vector is its length, found with the Pythagorean theorem extended to three dimensions: |a| = √(a1² + a2² + a3²). Dividing the dot product by the product of the two magnitudes always gives a number between −1 and 1, which is the cosine of the angle. Taking the inverse cosine (arccos) of that value gives the angle θ itself.
Why does this work? Think of two arrows starting at the same point. When they point in exactly the same direction, the dot product equals the product of the lengths, so cos θ = 1 and θ = 0°. When they are perpendicular, the dot product is 0, so cos θ = 0 and θ = 90°. When they point in opposite directions, cos θ = −1 and θ = 180°. Everything in between maps smoothly, which is why this one formula covers every possible pair of vectors.
Worked Example 1: Two Simple 2D Vectors
Let a = (3, 4, 0) and b = (4, 3, 0). Step 1 — the dot product: a · b = (3 × 4) + (4 × 3) + (0 × 0) = 12 + 12 + 0 = 24. Step 2 — the magnitudes: |a| = √(3² + 4² + 0²) = √(9 + 16) = √25 = 5, and |b| = √(4² + 3² + 0²) = √(16 + 9) = √25 = 5. Step 3 — the cosine: cos θ = 24 / (5 × 5) = 24 / 25 = 0.96. Step 4 — the angle: θ = arccos(0.96) = 16.26°. Enter these values into the calculator and it returns exactly 16.26°.
Worked Example 2: Two 3D Vectors
Let a = (1, 2, 3) and b = (4, 5, 6). Step 1 — the dot product: a · b = (1 × 4) + (2 × 5) + (3 × 6) = 4 + 10 + 18 = 32. Step 2 — the magnitudes: |a| = √(1 + 4 + 9) = √14 = 3.7417, and |b| = √(16 + 25 + 36) = √77 = 8.7750. Step 3 — the cosine: cos θ = 32 / (3.7417 × 8.7750) = 32 / 32.832 = 0.9746. Step 4 — the angle: θ = arccos(0.9746) = 12.93°. The calculator confirms 12.93°, with 0.2257 radians shown in the breakdown.
Worked Example 3: Perpendicular Vectors
Let a = (1, 0, 0) and b = (0, 1, 0). Step 1 — the dot product: (1 × 0) + (0 × 1) + (0 × 0) = 0. Step 2 — the magnitudes: |a| = 1 and |b| = 1. Step 3 — the cosine: cos θ = 0 / 1 = 0. Step 4 — the angle: θ = arccos(0) = 90°. This confirms the useful rule that a zero dot product always means the vectors are perpendicular, and the calculator returns exactly 90.00°.
Reading Your Result
The angle is always reported between 0° and 180°, because that is the smaller of the two angles formed when two vectors meet at their tails. A result near 0° means the vectors point in nearly the same direction. A result near 90° means they are nearly perpendicular — orthogonal, in mathematical language. A result near 180° means they point in nearly opposite directions.
The breakdown rows let you audit each stage. If your angle looks wrong, check the dot product and magnitudes first: the most common cause of a surprise result is a mistyped component, which shows up immediately in these intermediate values. The radians row is handy when your next step involves calculus or physics formulas that expect angles in radians rather than degrees.
Common Mistakes to Avoid
The most frequent mistake is mixing up the order of components — entering the x value of one vector into the y field of the other. Double-check that each component lands in its own labeled field. Another common error is forgetting that angles above 180° cannot appear: the formula always returns the smaller angle, so if you expected 200°, the calculator will show the equivalent 160°.
People also sometimes enter a zero vector by accident (all fields left blank or zero) and wonder why there is an error. A vector of length zero has no direction, so asking for “the angle it makes with another vector” is meaningless — the calculator is correct to refuse. Finally, remember that for 2D problems the z components must actually be zero; if you leave placeholder text or stray values in those fields, the answer will be slightly off.
Frequently Asked Questions
1. What is the angle between two vectors?
It is the smaller angle (from 0° to 180°) formed when the two vectors are placed tail to tail. It is computed from the dot product using the formula cos θ = (a · b) / (|a| × |b|).
2. Can I use this calculator for 2D vectors?
Yes. Enter your x and y components and leave both z fields as 0. The formula works identically for 2D vectors when the third component is zero.
3. Why does the calculator show both degrees and radians?
Degrees are easier to read at a glance, while many physics and calculus formulas require angles in radians. Showing both saves you a conversion step.
4. What does a zero dot product mean?
A dot product of zero means cos θ = 0, so the angle is exactly 90°. The vectors are perpendicular (orthogonal) to each other.
5. Why do I get an error for a zero vector?
A vector with all zero components has no direction, so the angle between it and another vector is undefined. The calculator flags this instead of returning a misleading number.
6. Can the angle be greater than 180°?
No. By convention, the angle between two vectors is the smaller of the two possible angles, so it always falls between 0° and 180°.
7. Do negative components cause problems?
No. Negative components are handled normally — they simply mean the vector extends in the negative direction along that axis, and the formula accounts for that automatically.
8. What is the dot product in simple terms?
The dot product multiplies matching components of two vectors and adds the results. It measures how much the two vectors point in the same direction.
9. What is the magnitude of a vector?
The magnitude (or length) of a vector is found by squaring each component, adding them, and taking the square root: |a| = √(a1² + a2² + a3²).
10. Why is the angle formula sometimes written with arccos?
Because cos θ = (a · b) / (|a| × |b|) gives the cosine of the angle, you apply the inverse cosine (arccos) to recover θ itself. This calculator performs that step automatically.
11. How accurate is the result?
The angle is rounded to two decimal places, which is more than enough for schoolwork, engineering estimates, and graphics programming. The intermediate values are shown to four decimal places for verification.
12. What does an angle near 0° or 180° tell me?
Near 0° means the vectors point in almost the same direction (parallel). Near 180° means they point in almost opposite directions (anti-parallel).
13. Can I compare vectors of different lengths?
Yes. Dividing by the product of the magnitudes normalizes the calculation, so vectors of any length can be compared — the angle depends only on direction, not size.
14. Is the order of the vectors important?
No. The dot product and magnitudes are symmetric, so swapping vector a and vector b gives exactly the same angle.
15. Where is this calculation used in real life?
It is used in physics (work done by a force), engineering (stress analysis), computer graphics (lighting and surface normals), navigation, and machine learning (measuring similarity between data points).
Final Thoughts
The angle between two vectors is one of those ideas that shows up everywhere once you know to look for it — from the work a force does on a moving object to the way light falls on a 3D model. This calculator gives you the answer in degrees with the full working laid out, so you can trust the result and show your steps. Enter your components, check the dot product and magnitudes in the breakdown, and you will have your angle in seconds.