Mihsaba›Math›Vector Calculator

Vector Calculator

Calculate two 3D vector magnitudes, dot product, cross product and its magnitude, plus the angle between nonzero vectors.

Share this free calculator

Send this tool to someone who needs the calculation.

How to use

This vector calculator works with two 3D vectors A and B. It reports each magnitude, the dot product A·B, the cross product A×B and its magnitude, and the angle between the vectors when both are nonzero. A 2D vector can be represented by setting z=0.

  1. Enter the x, y and z components of A.
  2. Enter the components of B.
  3. Calculate the magnitudes, dot product, cross product and angle.

How it is calculated

A·B=ΣAᵢBᵢ; |A|=√ΣAᵢ²; θ=acos((A·B)/(|A||B|))

Example

Example: A=(1,2,3), B=(4,5,6). A·B=32, A×B=(-3,6,-3), |A×B|=√54≈7.3485 and the angle is about 12.93°.

Important notes

If either vector is zero, its direction is undefined and so is the angle between the vectors; the calculator does not invent a zero-degree angle. The magnitude of A×B equals the area of the parallelogram spanned by A and B.

Worked examples and interpreting results

Vector A=(3,4,0) has length 5 and B=(0,0,2) has length 2. Their dot product is zero, so they are perpendicular even though neither vector is zero.

Worked examples and interpreting results
CaseCalculationResult
Length of vector A√(3² + 4² + 0²)5
Dot product3×0 + 4×0 + 0×20
Angle between vectorsacos(0 ÷ (5×2))90 °

How to check the result

The angle involving a zero vector is undefined because the denominator is zero. A dot product returns a scalar; a cross product in three dimensions returns a vector. The operations are not interchangeable.

Frequently asked questions

When are vectors perpendicular?

When A·B=0, provided neither vector is zero.

What does the cross product give?

A vector perpendicular to A and B following the right-hand rule.

Can I use 2D vectors?

Yes. Set both z components to zero.

What is the difference between dot and cross products?

The dot product returns a scalar measuring alignment and is zero for perpendicular vectors. The cross product returns a vector perpendicular to both and, in its familiar vector form, is defined in three dimensions.