Dot Product Calculator

Enter two vectors of the same dimension to get their dot product, their magnitudes and the angle between them.

Dot product (a · b)
|a|
|b|
Angle between

How to Calculate a Dot Product

Enter two vectors of the same length.

1

Enter the two vectors

Type the components separated by commas or spaces. Both vectors must have the same number of components.

2

Read the dot product

The dot product is the sum of the products of matching components — a single number (a scalar).

3

See magnitudes and angle

The magnitudes and the angle between the vectors are computed too; a dot product of zero means the vectors are perpendicular.

Frequently Asked Questions

How do you calculate the dot product?
To calculate the dot product, multiply matching components of the two vectors and add the results. For (1, 2, 3) · (4, 5, 6) that is 1·4 + 2·5 + 3·6 = 4 + 10 + 18 = 32. The result is a single number rather than a vector, which is why it is also called the scalar product. Both vectors must have the same number of components for the sum to be defined.
What does the dot product tell you?
The dot product measures how much two vectors point in the same direction, since a · b = |a||b| cos θ. A positive value means the angle between them is under 90°, zero means they are perpendicular, and a negative value means they point more than 90° apart. The dot product of a vector with itself gives the square of its length. Dividing a · b by |b| gives the length of a projected onto b.
How do I find the angle between two vectors?
To find the angle between two vectors, use cos θ = (a · b) ⁄ (|a| |b|), then take the inverse cosine. For (1, 0) and (1, 1) that is 1 ⁄ (1 × √2) = 0.7071, so θ = 45°. This calculator does both steps and reports the angle in degrees. The formula fails only if one vector is the zero vector, which has no direction to compare.
Is my data sent anywhere?
Nothing you type is sent anywhere. The dot product calculator runs entirely in your browser with JavaScript, so both vectors never leave your device. There is no account, no upload step and nothing is logged. The page keeps working offline once it has loaded.