BYTETOOLS

Vector Calculator

Add, subtract and scale 2D or 3D vectors, compute dot and cross products, magnitudes, unit vectors and the angle between vectors instantly online.

Vector A

Vector B

32
A · B (dot)
12.933154°
Angle between
3.741657
|A|
8.774964
|B|

Results

A + B = (5, 7, 9)

A − B = (-3, -3, -3)

2·A = (2, 4, 6)

A × B = (-3, 6, -3)

unit(A) = (0.267261, 0.534522, 0.801784)

unit(B) = (0.455842, 0.569803, 0.683763)

What is the Vector Calculator?

The ByteTools Vector Calculator handles the full toolkit of 2D and 3D vector operations in one place: addition, subtraction, scalar multiplication, dot product, cross product, magnitudes, unit vectors and the angle between two vectors.

  • 2D and 3D modes with component-wise input
  • Dot product, cross product and scalar multiplication
  • Magnitudes, unit vectors and the angle between vectors
  • Angle reported in degrees with safe numerical clamping
  • Zero-vector cases explained instead of erroring
  • 100% private — runs entirely in your browser

How to use the Vector Calculator

  1. 1

    Choose 2D or 3D vectors.

  2. 2

    Enter the components of vector A and vector B.

  3. 3

    Set the scalar k if you want the k·A result.

  4. 4

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

  5. 5

    Copy all results with one click.

About the Vector Calculator

The ByteTools Vector Calculator handles the full toolkit of 2D and 3D vector operations in one place: addition, subtraction, scalar multiplication, dot product, cross product, magnitudes, unit vectors and the angle between two vectors. Enter the components of A and B and every result updates live.

All results come from plain component arithmetic — the dot product is the sum of componentwise products, the cross product follows the standard determinant pattern, and the angle uses cos θ = (A·B)/(|A||B|) with the value safely clamped so floating-point noise can never break the arccos. In 2D, the cross product is reported as the scalar z-component, matching the convention used in physics.

It is built for linear algebra and physics students, game developers and engineers. Everything is computed 100% locally in your browser — nothing is uploaded, and the full result set can be copied with one click.

Frequently asked questions

How do you calculate the dot product of two vectors?

Multiply matching components and add them up: (1, 2, 3) · (4, 5, 6) = 1×4 + 2×5 + 3×6 = 32. The dot product measures how much the vectors point the same way — it is positive for acute angles, zero for perpendicular vectors and negative for obtuse angles.

How do you calculate the cross product?

For 3D vectors, A × B = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁). For (1, 2, 3) × (4, 5, 6) that gives (−3, 6, −3). The result is perpendicular to both inputs, and its length equals the area of the parallelogram the two vectors span.

How do you find the angle between two vectors?

Use cos θ = (A · B) ÷ (|A| |B|), then take the arccosine. For (1, 2, 3) and (4, 5, 6): cos θ = 32 ÷ (√14 × √77) ≈ 0.9746, so θ ≈ 12.93°. The calculator does this automatically and clamps the cosine so rounding can never produce an invalid arccos input.

What is a unit vector?

A vector of length 1 pointing in the same direction as the original, found by dividing each component by the magnitude. Unit vectors isolate direction from size, which is why they are used for surface normals, movement directions in games, and basis directions in physics.

Is there a cross product in 2D?

Strictly, the cross product only exists in 3D (and 7D). In 2D, the useful equivalent is the scalar a₁b₂ − a₂b₁ — the z-component you would get by embedding the vectors in 3D. Its sign tells you the turning direction and its magnitude is the parallelogram area, so this tool reports exactly that in 2D mode.

Related tools