Boneyard Tools

Vector Calculator

Work with 2D and 3D vectors in one place. Pick a dimension, type the components of vector A and B, choose an operation, and read the result vector or scalar instantly. It covers addition, subtraction, scaling, dot and cross products, magnitude, the unit vector, the angle between vectors, distance, and projection.

How to use the vector calculator

  1. Choose 2D or 3D, then type each component of vector A, and vector B if your operation needs a second vector.
  2. Pick the operation you want, such as dot product, cross product, magnitude, or angle.
  3. Read the result vector or scalar below, along with the magnitude and angle cards.

Examples

Dot product of two 3D vectors

A = [1, 2, 3], B = [4, 5, 6]
32

Cross product of the x and y axes

A = [1, 0, 0], B = [0, 1, 0]
[0, 0, 1]

Magnitude of a 2D vector

A = [3, 4]
5

Frequently asked questions

What is the difference between the dot and cross product?

The dot product returns a single number that measures how much two vectors point the same way, and works in 2D or 3D. The cross product returns a new vector perpendicular to both inputs and is only defined for 3D vectors.

How do you find the magnitude of a vector?

The magnitude, or length, is the square root of the sum of the squared components. For the 2D vector [3, 4] it is sqrt(3² + 4²) = 5. The same idea extends to three components in 3D.

How is the angle between two vectors calculated?

It comes from the dot product: cos(theta) = (A · B) / (|A| |B|). The calculator returns the angle in both radians and degrees. Both vectors must be non-zero, since a zero vector has no direction.

Why does normalizing or the angle fail for a zero vector?

A vector of all zeros has length zero and points in no direction, so it has no unit vector and no angle to another vector. The calculator reports that clearly instead of dividing by zero and returning misleading numbers.

What does vector projection give me?

Projecting A onto B returns the part of A that lies along B, as a new vector. It is computed as ((A · B) / (B · B)) times B, and the vector you project onto must be non-zero.

Is my data sent anywhere?

No. Every calculation runs entirely in your browser, so the numbers you enter never leave your device.

Related tools