Skip to content
CalcWorld

Browse all tools

Dot Product Calculator

The dot product calculator multiplies matching components of two vectors and adds the results: A · B = a₁b₁ + a₂b₂ + a₃b₃. For (2, −1, 3) and (4, 5, −2) that is 8 − 5 − 6 = −3.

Sources: OpenStax Calculus Volume 3, Wikipedia Updated

Enter two vectors of equal length as comma-separated numbers (2D or 3D).

Dot product formula

For two vectors with the same number of components, the dot product is the sum of the products of matching components: A · B = a₁b₁ + a₂b₂ + … + aₙbₙ. The result is a single number, not a vector.

OpenStax Calculus Volume 3 also gives the geometric form, A · B = |A| × |B| × cos θ, which links the number to the angle between the vectors.

Bars for the component products 2 × 4 = 8, −1 × 5 = −5 and 3 × −2 = −6, which add up to −3. The vector lengths are 3.7417 and 6.7082, so the angle is 96.9°.
Two negative products outweigh the positive one, so the sum is negative and the angle is over 90°.

How to calculate the dot product of two vectors

Take A = (2, −1, 3) and B = (4, 5, −2).

  1. Multiply matching components: 2 × 4 = 8, −1 × 5 = −5 and 3 × (−2) = −6.
  2. Add the products: 8 + (−5) + (−6) = −3.
  3. For the angle, divide by both lengths: |A| = √14 = 3.7417 and |B| = √45 = 6.7082, so cos θ = −3 ÷ 25.0998 = −0.1195 and θ = 96.87°.

The lengths in step 3 are what the vector calculator reports as magnitudes, worked out like the distance between two points with one more coordinate.

What the sign of the dot product tells you

A negative dot product, like −3 here, means the angle between the vectors is more than 90°. Zero means they are perpendicular, and a positive result means the angle is less than 90°.

Why both vectors need the same length

Each component is paired with the matching one in the other vector, so a 2D vector has nothing to pair with a 3D vector's third component. Enter the same number of comma-separated values in both boxes. To change a vector between forms first, use the vector coordinate converter.

Where the dot product is used

In physics, the work done by a force is the force vector dotted with the displacement, and the dot product projects one vector onto another. In computer graphics it tests whether a surface faces a light, using the surface's normal vector. More vector tools are on the algebra calculators page.

Dot Product Calculator: FAQ

What does a dot product of zero mean?

The vectors are perpendicular, at 90° to each other, as long as neither is the zero vector. (1, 2) · (2, −1) = 2 − 2 = 0.

Is the dot product a vector?

No, it is a single number, which is why it is also called the scalar product. The cross product is the one that gives a vector; see the vector cross product calculator.

How do you find the angle from the dot product?

cos θ = (A · B) ÷ (|A| × |B|). For the example, −3 ÷ (3.7417 × 6.7082) = −0.1195, and θ = 96.87°.

Sources