Dot Product Calculator

Dot Product Calculator

Growing AI Skill PRO

Enter Calculation

Leave components blank or 0 for 2D vectors (just fill a₁,a₂,b₁,b₂).

Results

Dot Product (a · b)
32
scalar
Magnitude of a (|a|) 3.7417
Magnitude of b (|b|) 8.775
Angle between vectors 12.93°

Formula

a→·b→=a1b1+a2b2+a3b3\vec{a} \cdot \vec{b} = {{\text{a}_1}}\,{{\text{b}_1}} + {{\text{a}_2}}\,{{\text{b}_2}} + {{\text{a}_3}}\,{{\text{b}_3}}

Example

a→·b→=1·4+2·5+3·6=32\vec{a} \cdot \vec{b} = 1 \cdot 4 + 2 \cdot 5 + 3 \cdot 6 = 32
Show calculation steps (1)
  1. Angle Between Vectors

    θ=arccos⁡(a→·b→‖a→‖‖b→‖)where‖a→‖=a12+a22+a32,‖b→‖=b12+b22+b32\theta = \arccos\!\left( \frac{\vec{a} \cdot \vec{b}}{\lVert\vec{a}\rVert\,\lVert\vec{b}\rVert} \right) \quad \text{where} \quad \lVert\vec{a}\rVert = \sqrt{{{\text{a}_1}}^{2} + {{\text{a}_2}}^{2} + {{\text{a}_3}}^{2}},\; \lVert\vec{b}\rVert = \sqrt{{{\text{b}_1}}^{2} + {{\text{b}_2}}^{2} + {{\text{b}_3}}^{2}}

    Angle from the dot product and magnitudes; result in degrees.

Usage stats

Advertisement

Report an error on this page

What Is the Dot Product?

The dot product (also called the scalar product) takes two vectors and returns a single number. For vectors a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃), it is the sum of the products of their matching components: $$\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3.$$ The result is a scalar, not a vector. It is one of the most fundamental operations in linear algebra, physics, computer graphics, and machine learning.

Two vectors from a common origin with the angle theta between them
The dot product relates two vectors via the angle \(\theta\) between them.

How to Use This Calculator

Enter the components of vector a in the first row and vector b in the second row. For 2D vectors, simply leave the third components (\(a_3\) and \(b_3\)) at 0. Click calculate and you'll get the dot product, the magnitude (length) of each vector, and the angle between them in degrees.

The Formula Explained

Each component of a is multiplied by the corresponding component of b, and the products are added. The angle \(\theta\) between the two vectors comes from the relationship \(\mathbf{a}\cdot\mathbf{b} = \lVert\mathbf{a}\rVert\,\lVert\mathbf{b}\rVert\cos\theta\), where \(\lVert\mathbf{a}\rVert = \sqrt{a_1^2+a_2^2+a_3^2}\). Rearranging gives $$\theta = \arccos\left(\frac{\mathbf{a}\cdot\mathbf{b}}{\lVert\mathbf{a}\rVert\,\lVert\mathbf{b}\rVert}\right).$$

Advertisement
Geometric projection of vector b onto vector a
Geometrically, \(\mathbf{a}\cdot\mathbf{b}\) equals \(\lVert\mathbf{a}\rVert\) times the projection of b onto a.

Worked Example

Let \(\mathbf{a} = (1, 2, 3)\) and \(\mathbf{b} = (4, 5, 6)\). The dot product is $$(1\times 4) + (2\times 5) + (3\times 6) = 4 + 10 + 18 = \mathbf{32}.$$ The magnitudes are \(\lVert\mathbf{a}\rVert = \sqrt{14} \approx 3.742\) and \(\lVert\mathbf{b}\rVert = \sqrt{77} \approx 8.775\). The angle is $$\arccos\left(\frac{32}{3.742 \times 8.775}\right) \approx 12.93°.$$

FAQ

What does a dot product of zero mean? It means the two vectors are perpendicular (orthogonal) — the angle between them is 90°.

Can the dot product be negative? Yes. A negative dot product means the angle between the vectors is greater than 90° (they point in generally opposite directions).

How is it different from the cross product? The dot product returns a scalar, while the cross product returns a vector perpendicular to both inputs and exists only in 3D.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators