gizmobench

Dot Product Calculator

Enter two vectors to calculate their scalar dot product. Each component product is printed before the sum, and the page can show the angle when both vector lengths are nonzero.

3Da = (2, -1, 3)b = (1, 4, -2)
a = (2, -1, 3)        b = (1, 4, -2)

a . b = (2)(1) + (-1)(4) + (3)(-2)
      = 2 - 4 - 6
      = -8

|a|   = 3.741657
|b|   = 4.582576
angle = 117.8118 deg
Vector a
Vector b
Product
Angle in

Separate the components with commas or spaces. Whole numbers, decimals and fractions such as 1/3 are all read exactly, and the answer comes back written the way the question was.

a · b
-8scalar
|a|
3.741657decimal
|b|
4.582576decimal
Angle
117.8118°decimal

a dot b is the number -8. The length of a is 3.741657, the length of b is 4.582576, and the angle between them is 117.8118°.

Three cases worth knowing

Each one is computed by the calculator above. Select a heading to load it.

  • right-handed order
    (0, 0, 1)
  • b × a
    (0, 0, -1), the sign flipped
  • dot in any dimension
    11
A cross product is a vector; a dot product is a number. a × b is a third vector, at right angles to both, and its length is the area of the parallelogram that a and b span. a · b is a single number: positive when the two point the same way, zero when they are square to each other, negative when they oppose. Only the cross product needs three dimensions. The dot product works at any equal length, which is why the angle above is available for two-dimensional vectors and for twelve-dimensional ones.

Common questions

How is a dot product calculated?
Multiply matching components and add the products. For (1,2) and (3,4), the dot product is 1×3 + 2×4 = 11.

Exact arithmetic on the components you enter, kept as integers or fractions wherever the inputs are, with every determinant term written out. The cross product is three-dimensional only and follows the right-hand rule in the order you typed, which is why swapping the operands flips every sign. The dot product takes any two vectors of equal length; the magnitude and the angle are decimals and are labelled as such.