Vector Calculator

Add vectors, compute dot and cross products, and find magnitudes for 2D or 3D vectors — all in one place. This free online math calculator runs entirely in your browser — no signup, no data sent anywhere.

· Reviewed by the CalculatorHive editorial team

Inputs

Results

A + B
A · B (dot product)
A × B (cross product, 3D)
|A| (magnitude)
|B| (magnitude)

How It Works (Formula & Method)

Sum: add corresponding components. Dot product: A · B = sum of the products of corresponding components — a scalar that measures alignment (zero means perpendicular). Cross product (3D only): a vector perpendicular to both inputs, with magnitude equal to the parallelogram area formed by A and B. Magnitude: the Euclidean length, √(sum of squared components).

Worked Example

Below is a worked example using the calculator's default values. The same numbers are pre-filled in the form above so you can press Calculate and see the result without typing anything.

Inputs used:

  • Vector A (comma-separated): 1,2,3
  • Vector B (comma-separated): 4,5,6

With these inputs, the calculator computes the metrics shown in the Results panel. Change any value and press Calculate again to see how the result responds — the live widget and the chart both update instantly.

About the Vector Calculator

Vectors are mathematical objects that carry both magnitude and direction. They are the language of physics (force, velocity, acceleration), engineering (mechanical systems), computer graphics (positions and normals), and machine learning (features and embeddings). This calculator handles the most common operations on 2D and 3D vectors.

How to Use This Calculator

Enter both vectors as comma-separated components (e.g., 3,4 for a 2D vector or 1,2,3 for a 3D vector). Both vectors must have the same number of components. The calculator returns the component-wise sum, scalar dot product, magnitude of each, and (for 3D vectors) the cross product.

Tips & Considerations

  • A · B = |A| × |B| × cos(θ), so the angle between two vectors can be recovered as arccos((A·B) / (|A|·|B|)).
  • A × B follows the right-hand rule: point fingers along A, curl toward B, your thumb points along A×B.
  • A unit vector is a vector divided by its magnitude — it has length 1 and pure direction.
  • The cross product is anticommutative: A × B = −(B × A).

Frequently Asked Questions

Why is there no 2D cross product?

The cross product is fundamentally 3D. In 2D, you can compute the scalar a_x·b_y − a_y·b_x, which represents the z-component of the 3D cross when you embed the 2D vectors in the xy-plane.

What does a zero dot product mean?

The two vectors are perpendicular (orthogonal).

Can I use vectors with more than 3 dimensions?

Sum and dot product work in any dimension. Cross product is only defined for 3D (and 7D).

What does the Vector Calculator compute?

The Vector Calculator takes 2 input values and returns 5 results. Vector addition, dot product, cross product, and magnitude for 2D and 3D vectors.

Ad placement