Vector Calculator
Add, subtract, dot-product and cross-product 2D or 3D vectors. Results come with the magnitude and the full component-wise working.
What is a vector?
A vector is a quantity with both magnitude (size) and direction. In coordinate form we write it as a list of components — ⟨x, y⟩ in 2D or ⟨x, y, z⟩ in 3D — that describe the displacement along each axis. Its magnitude (length) is the distance from the origin to the point with those coordinates.
Vector operations, piece by piece
Each card explains one operation this tool performs on your two vectors — what it returns (vector or scalar), what the result means geometrically, and how the components combine.
Add & subtract — componentwise
Combine matching components separately. The tip-to-tail construction in the plane matches the arithmetic exactly.
Dot product — alignment as a single number
Multiply matching components and add them. The result is a scalar proportional to how aligned the two vectors are — zero when they are perpendicular.
Cross product — a perpendicular vector (3D only)
Returns a new vector perpendicular to both inputs, following the right-hand rule. Its length equals the area of the parallelogram the two vectors span, so it's zero exactly when they are parallel.
Magnitude — length by Pythagoras
The magnitude is the distance from the origin to the tip of the vector — the Pythagorean theorem extended to any number of components.
Features of this calculator
- Toggle between 2D and 3D component inputs
- Supports addition, subtraction, dot product and cross product (3D)
- Reports the resulting vector (or scalar for dot product) plus its magnitude
- Recovers the angle between vectors from the dot product when possible
- Shows every component-wise step of the working
Frequently asked questions
+When should I use the dot product vs the cross product?
Use the dot product when you need a scalar — the angle between two vectors, a projection length, or to check perpendicularity. Use the cross product (3D only) when you need a vector perpendicular to two others, such as a surface normal or a torque.
+What if I get the zero vector as a result?
The zero vector ⟨0, 0, 0⟩ has no direction and magnitude 0. A zero cross product means the two vectors are parallel; a zero dot product means they are perpendicular.
+Is the cross product commutative?
No — it's anti-commutative: a × b = −(b × a). Swapping the operands reverses the direction of the resulting vector.
+How do I turn a vector into a unit vector?
Divide each component by the vector's magnitude: v̂ = v / ‖v‖. The result points the same way as v but has length 1.