➡️ Vector Calculator (2D & 3D)
Enter two 2D or 3D vectors to get their magnitudes, sum, difference, dot and cross products, and the angle between them.
|a| (magnitude)
3
|b| (magnitude)
3.6056
a · b (dot product)
8
a + b
(3, 2, 5)
a − b
(-1, 2, -1)
Angle (a, b)
42.3°
a × b (cross product)
(6, 1, -4)
Magnitude is √(x² + y² + …). The dot product a·b = Σaᵢbᵢ relates to the angle by a·b = |a||b|cosθ (zero means perpendicular). The cross product a × b (3D only) is a vector perpendicular to both, with magnitude |a||b|sinθ. 🔒 In your browser.
How the vector calculator (2d & 3d) works
A vector has both size and direction, written as components (x, y) in 2D or (x, y, z) in 3D. The magnitude (length) is √(x² + y² + …). Adding or subtracting vectors works component by component. The dot product a·b = Σaᵢbᵢ is a single number tied to the angle between them by a·b = |a||b|cosθ — it's zero when the vectors are perpendicular. The cross product a × b (3D only) is a new vector perpendicular to both, with magnitude |a||b|sinθ. The tool computes all of these at once and the angle in degrees.
The dot product tells you how much two vectors point the same way (positive), opposite (negative) or at right angles (zero). The cross product gives a perpendicular direction following the right-hand rule and is only defined in three dimensions — in 2D you can only get its magnitude (the scalar z-component). Enter zeros for unused components.
Frequently asked questions
How do I calculate the magnitude of a vector?
Take the square root of the sum of the squares of its components: |v| = √(x² + y² + z²). For (3, 4) the magnitude is √(9 + 16) = 5; for (2, 3, 6) it's √49 = 7.
What is the dot product?
The dot product a·b = a₁b₁ + a₂b₂ + a₃b₃ is a single number. It equals |a||b|cosθ, so it's positive when vectors point similarly, negative when opposite, and exactly zero when they are perpendicular.
What is the cross product?
For two 3D vectors, a × b is a vector perpendicular to both, with magnitude |a||b|sinθ and direction given by the right-hand rule. It's used for normals, torque and rotational quantities. It isn't defined for 2D vectors (only its scalar magnitude is).
How do I find the angle between two vectors?
Rearrange the dot-product formula: θ = arccos( (a·b) ⁄ (|a||b|) ). The tool does this and returns the angle in degrees — 0° means parallel, 90° perpendicular, 180° opposite.
How do I add two vectors?
Add them component by component: (1, 2, 3) + (4, 5, 6) = (5, 7, 9). Subtraction works the same way. Geometrically, addition places them tip-to-tail; the result is the vector from the start of the first to the end of the second.