Linear algebra · Vectors

2D & 3D Vector Calculator

Calculate vector sums, differences, magnitudes, dot and cross products, angles, projections, and parallelism in two or three dimensions.

Formula shown Runs locally Reviewed Aug 11, 2026
Follow us on Google
Equation guide

Two vectors with matching dimension in R² or R³

Magnitude

|a|=√(a₁²+a₂²+a₃²)

Dot product

a·b=Σaᵢbᵢ=|a||b|cos θ

Cross and projection

a×b ⟂ a,bprojb(a)=(a·b/|b|²)b
Vectors · 2D and 3D

Compare two vectors and their direction

Vector a
Vector b

Inputs and displayed decimal results use at most three decimal places. Exact internal values are retained during calculation.

a · b = |a||b| cos θ

Enter corresponding components for two vectors of the same dimension.

Using the model

Symbols, assumptions and limitations

Interpretation notes

Both vectors must have the selected dimension. Angles and projections require nonzero vectors. In 2D, the cross product is represented by its perpendicular z-component.

Worked examples

See the method in practice

01

Perpendicular vectors

Vectors (1,0) and (0,1) have dot product 0, angle 90°, and 2D cross component 1.

02

Parallel vectors

Vectors (1,2,3) and (2,4,6) have a zero cross product and are parallel.

Questions

Frequently asked

What does a zero dot product mean?

For two nonzero vectors, it means they are perpendicular.

Why does the 2D cross product have three components?

The two vectors are embedded in the xy-plane, so their cross product points along the z-axis.

When is projection undefined?

Projection onto the zero vector is undefined because its formula divides by the squared magnitude of that vector.

Sources & review

Equations and examples are checked against the references below. Results are educational and should be independently verified for safety-critical work.

OpenStax Calculus Volume 3 — Vectors

Written by the STEM Hub editorial team · Reviewed August 11, 2026 · Review methodology