Skip to main content

Vector Calculator

Magnitude, unit vector, dot, cross and angle between — 2D or 3D.

The formula behind it

a·b = |a||b|cos θ · a×b = |a||b|sin θ · n̂
a·b
dot product — a scalar; measures how much the vectors align
a×b
cross product (3D) — a perpendicular vector; magnitude = parallelogram area
θ
angle between the vectors, from cos θ = a·b ÷ (|a||b|)
â
unit vector — a's direction at length 1

Vectors carry magnitude and direction. The dot product compresses a pair into one number (alignment), the cross product into a perpendicular vector (plane orientation). Between them you can reconstruct angles, areas, projections and work done — the daily vocabulary of physics and 3D graphics.

How to use this calculator

  1. 1

    Choose 2D or 3D — the dimension toggle relabels the inputs.

  2. 2

    Enter both vectors as comma-separated components (e.g. 3, 4 or 1, 2, 2).

  3. 3

    Read magnitudes, the unit vector, dot and cross products, the angle, and sum/difference.

  4. 4

    Check the steps — every formula is written with your numbers substituted.

  5. 5

    Use |a × b| as the parallelogram area, or the 2D scalar cross for clockwise/counter-clockwise tests.

Worked examples

Perpendicular test, a=(3,4), b=(−4,3)

Dot = 3×(−4) + 4×3 = 0 → cos θ = 0 → θ = 90°. A zero dot product is the algebraic definition of perpendicularity — no protractor needed.

3D cross product, a=(1,0,0), b=(0,1,0)

a × b = (0·0−0·1, 0·0−1·0, 1·1−0·0) = (0,0,1) — the unit z-vector. The right-hand rule confirms: x cross y is z.

Frequently asked questions

Explore more categories

Command Palette

Search for a command to run...