Vector Calculator

Free online Vector Calculator supporting 2D and 3D vector addition, subtraction, dot product, cross product, magnitude, unit vector, angle, and projection.

821.4K usesUpdated · 2026-04-29Runs locally · zero upload

How to Use Vector Calculator

The Vector Calculator performs all common vector operations in one place, with step-by-step calculation details shown for every result.

  1. Select Dimension — Choose 2D for two-dimensional vectors (x, y) or 3D for three-dimensional vectors (x, y, z) in the Vector Calculator.
  2. Choose Operation — Pick the vector operation from the dropdown: addition, subtraction, dot product, cross product, magnitude, unit vector, angle, or projection.
  3. Enter Vector A — Input the x, y, (and z) components of the first vector.
  4. Enter Vector B or Scalar — For binary operations provide Vector B components; for scalar multiplication enter the scalar value. The Vector Calculator hides irrelevant inputs automatically.
  5. Read Results — The Vector Calculator displays the result, its magnitude (for vector outputs), and the step-by-step breakdown.

Formula & Theory — Vector Calculator

The Vector Calculator implements standard linear-algebra vector formulas:

Addition:     A + B = (ax+bx, ay+by, az+bz)
Subtraction:  A - B = (ax-bx, ay-by, az-bz)
Scalar mult:  kA    = (k·ax, k·ay, k·az)
Dot product:  A · B = ax·bx + ay·by + az·bz
Cross product: A × B = (ay·bz - az·by, az·bx - ax·bz, ax·by - ay·bx)
Magnitude:    |A|   = √(ax² + ay² + az²)
Unit vector:  Â     = A / |A|
Angle:        θ     = arccos((A · B) / (|A|·|B|))
Projection:   proj_B(A) = (A·B / |B|²) · B
Symbol Meaning
A, B Input vectors
k Scalar multiplier
θ Angle between A and B (degrees)
 Unit vector in direction of A

The Vector Calculator uses exact floating-point arithmetic. Angles are clamped to the range [−1, 1] before arccos to avoid numerical errors near 0° and 180°.

Cross Product Note

The cross product is only geometrically meaningful in 3D. In 2D mode, the Vector Calculator returns the z-component of the 3D cross product, which equals the signed area of the parallelogram formed by A and B.

Use Cases for Vector Calculator

The Vector Calculator is useful in a variety of situations across physics, engineering, and mathematics:

  • Physics — Forces, velocities, and accelerations are vectors. Use the Vector Calculator to find net force (addition), work done (dot product), or torque (cross product).
  • Computer Graphics & Game Development — Normal vectors, lighting models, and collision detection all require the cross product and dot product operations provided by the Vector Calculator.
  • Navigation & GPS — Bearing calculations, displacement vectors, and velocity decomposition are standard applications of the Vector Calculator in geospatial contexts.
  • Machine Learning — Cosine similarity (derived from the dot product and magnitudes) is computed by the Vector Calculator's angle function, making it useful for NLP and recommendation systems.
  • Structural Engineering — Moment of a force about a point is the cross product of the position vector and force vector — a direct Vector Calculator application.

Whether you are solving a physics problem, building a 3D application, or studying linear algebra, the Vector Calculator provides accurate results and clear step-by-step explanations.

Frequently asked questions about Vector Calculator

What operations does the Vector Calculator support?

The Vector Calculator supports addition, subtraction, scalar multiplication, dot product, cross product, magnitude, unit vector, angle between two vectors, and projection of one vector onto another — for both 2D and 3D vectors.

How do I compute the cross product in the Vector Calculator?

Select '3D' dimension and choose 'Cross Product (A × B)'. Enter components for vectors A and B. The Vector Calculator returns the resulting 3D vector perpendicular to both inputs. In 2D mode, the cross product returns the scalar z-component.

What is a unit vector and how does the Vector Calculator compute it?

A unit vector has magnitude 1 and points in the same direction as the original vector. The Vector Calculator divides each component by the magnitude |A| = sqrt(x^2 + y^2 + z^2).

How does the Vector Calculator find the angle between two vectors?

The Vector Calculator uses the formula theta = arccos((A·B) / (|A||B|)), applying the dot product and magnitudes to find the angle in degrees.

Is my data stored?

No. All calculations happen in your browser; nothing is sent to a server.