Vectors describe quantities that have both a size and a direction — velocity, force, and displacement are all classic examples. This calculator takes two vectors, A and B, in 2D or 3D, and computes every common operation on them at once: addition, subtraction, scalar multiplication, the dot product, the cross product, magnitude, and the angle between them.

How the Vector Calculator works

Every operation on this page works directly on the vectors' components. Addition and subtraction combine matching components (x with x, y with y, z with z); scalar multiplication multiplies every component by the same number k. The dot product multiplies matching components and adds the results into a single number, while the cross product (3D only) combines components in a specific pattern to produce a new vector perpendicular to both inputs.

Magnitude and angle are both derived from these building blocks: magnitude is the Pythagorean length of a vector's components, and the angle between two vectors falls directly out of rearranging the dot-product formula.

Inputs and what they mean

Vector A and vector B are entered as their x, y (and z, in 3D mode) components — not as a magnitude-and-direction pair. Switching between 2D and 3D changes whether the z-component fields are shown and whether the cross product returns a full 3D vector or a single signed 2D scalar. The scalar k is only used for the 'A scaled by k' result on the Add/Subtract tab; it doesn't affect any of the other computed values.

Limits and edge cases

The angle between two vectors is undefined when either vector has zero magnitude — there's no direction to measure from a point with no length, so the calculator flags this case explicitly rather than showing a misleading number. The cross product's full vector form only exists in 3D; in 2D, what's usually called the 'cross product' is really the z-component of that same formula, reduced to a single signed number that indicates orientation (clockwise vs. counterclockwise) and doubles as the signed area of the parallelogram the two vectors span.

This calculator works with any consistent unit for the vector components (meters, feet, unitless coordinates, etc.) — just use the same unit for every component you enter.