Skip to content
Math

Vector Calculator

Enter two vectors in 2D or 3D and choose an operation. The calculator instantly returns the result along with a full worked solution showing every step of the math. Supports magnitude, vector addition and subtraction, dot product, cross product (3D), unit vector normalization, and the angle between two vectors.

Your details

Choose whether your vectors live in 2D or 3D space.
Select the vector operation you want to perform.
The x (horizontal) component of vector a.
The y (vertical) component of vector a.
The z (depth) component of vector a.
The x (horizontal) component of vector b.
The y (vertical) component of vector b.
The z (depth) component of vector b.
Result
11

Numeric result of the selected scalar operation.

Result x-
Result y-
Result z-
|a| (magnitude)5
|b| (magnitude)2.236068
Operationa · b = 11
|a| (magnitude)5
|b| (magnitude)2.236068
Result11

The dot product a · b = 11.

  • A positive dot product means the angle between the vectors is less than 90 degrees.
  • The angle between the vectors is approximately 10.3 degrees.

Next stepIn physics, the dot product of force and displacement equals the work done.

What are vectors and why do operations on them matter?

A vector is a quantity that has both a magnitude (size) and a direction, in contrast to a plain scalar like temperature or speed. In 2D space a vector is written as (x, y) representing two perpendicular components, and in 3D space it gains a third component (x, y, z). Vectors appear everywhere in science and engineering: velocity, force, electric fields, and magnetic flux are all vectors. The standard operations - addition, subtraction, dot product, cross product, magnitude, and normalization - let you combine, compare, and transform these quantities in geometrically meaningful ways. For example, the work done by a force on an object equals the dot product of the force vector and the displacement vector, while the torque produced by that force equals the cross product.

How to use this calculator

Select 2D or 3D to match your problem, then choose the operation from the dropdown. Enter the components for vector a (and vector b where required). The result updates immediately, and the "Show your work" panel walks through every arithmetic step with your actual numbers. For scalar results like the dot product or angle, only the scalar output is shown. For vector results like addition or cross product, the x, y, and z components of the resulting vector are displayed alongside its magnitude. The insight panel interprets the result - for instance, noting when vectors are perpendicular (dot product zero) or parallel (cross product zero).

Dot product vs. cross product: when to use each

The dot product (a · b = ax*bx + ay*by + az*bz) collapses two vectors into a single number and captures how much they point in the same direction. It works in any dimension. If the dot product is zero, the vectors are perpendicular. The cross product (a × b), defined only in 3D, produces a new vector perpendicular to both inputs. Its magnitude equals the area of the parallelogram with a and b as sides. The dot product is used for work, projections, and testing orthogonality. The cross product is used for torque, surface normals in 3D graphics, and angular momentum.

Unit vectors and normalization

Normalizing a vector means dividing each of its components by its magnitude, producing a unit vector with length 1 that points in the same direction. Unit vectors simplify many formulas: the dot product of two unit vectors equals the cosine of the angle between them directly, without dividing by any magnitudes. In computer graphics, surface normal vectors are almost always stored as unit vectors so lighting calculations stay numerically stable. The formula is: unit(a) = a / |a| = (ax/|a|, ay/|a|, az/|a|).

Quick reference: vector operation results and what they mean

OperationOutput typeKey property
Magnitude |a|Scalar (>=0)Length of the vector in space
Addition a + bVectorCommutative: a + b = b + a
Subtraction a - bVectorGives displacement from b to a
Dot product a · bScalar0 when perpendicular; |a||b| when parallel
Cross product a × bVector (3D)Perpendicular to both; magnitude = area of parallelogram
Unit vector a / |a|VectorAlways has magnitude 1; pure direction
Angle between a and bScalar (deg)Uses arccos of normalized dot product
Scalar projectionScalarNegative when vectors form obtuse angle

Summary of each vector operation, its output type, and a key property.

Frequently asked questions

What is the difference between a vector and a scalar?

A scalar is a single number with magnitude only, like 5 kg or 30 degrees Celsius. A vector has both magnitude and direction, like 5 m/s to the northeast. In component form, a vector is written as an ordered tuple of numbers such as (3, 4) in 2D or (1, 2, -3) in 3D. Operations on vectors like dot product can produce scalars, while operations like cross product and addition produce new vectors.

When is the cross product zero?

The cross product a × b is the zero vector when the two vectors are parallel or anti-parallel, meaning one is a scalar multiple of the other. This includes the case where either vector is the zero vector. In practice, a cross product near zero tells you the vectors point in nearly the same (or opposite) direction and form a very thin or degenerate parallelogram.

What does a negative dot product mean?

A negative dot product means the angle between the two vectors is greater than 90 degrees. In physical terms, if the force and displacement vectors have a negative dot product, the force is doing negative work - it is opposing the motion. A dot product of zero means the vectors are exactly perpendicular, and a positive dot product means the angle is less than 90 degrees.

Can I use this calculator for 3D vectors in physics problems?

Yes. Select "3D (x, y, z)" and enter all three components for each vector. The calculator handles all standard 3D operations: magnitude, addition, subtraction, dot product, cross product, unit vector, angle, and scalar projection. For torque calculations use the cross product (r × F), and for work calculations use the dot product (F · d).

Why is the cross product only defined in 3D?

The cross product produces a vector perpendicular to both inputs. In 3D space there is exactly one direction perpendicular to two given non-parallel vectors (up to sign), so the result is unique. In 2D space, perpendicularity would require a third dimension that does not exist in the plane. There is a 2D "cross product" that returns the scalar az component of the 3D result, sometimes used to find the signed area of a parallelogram, but this calculator returns the full 3D vector form.

Sources

Written by Dr. Rajiv Menon, PhD Applied Mathematician · Bengaluru, India

Applied mathematician bridging algebraic theory and computational tools for students, engineers, and everyday problem-solvers.

Search 3,500+ calculators

Loading search…