Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Dot Product Calculator

Enter two vectors to get their dot product, magnitudes, the angle between them and the projection of one onto the other, with every multiplication and sum shown.

Components separated by commas or spaces, e.g. 1, -2, 3/4.

Components separated by commas or spaces, e.g. 1, -2, 3/4.

Examples

About the Dot Product Calculator

The dot product is the simplest way to compare two vectors. It multiplies matching components and adds the results, producing a single number that measures how much the vectors point in the same direction. From that number you can find the angle between them, test whether they are perpendicular and project one vector onto another.

This calculator accepts vectors with any number of components, as long as both have the same length. It shows the component products, their sum, both magnitudes, the angle in degrees and the scalar and vector projection of the first vector onto the second. If one vector is the zero vector, it explains why the angle cannot be defined.

What is the dot product?

The dot product, or scalar product, of u=⟨u1,…,un⟩\mathbf{u} = \langle u_1, \dots, u_n \rangle and v=⟨v1,…,vn⟩\mathbf{v} = \langle v_1, \dots, v_n \rangle is u⋅v=u1v1+u2v2+⋯+unvn\mathbf{u} \cdot \mathbf{v} = u_1v_1 + u_2v_2 + \dots + u_nv_n. Unlike the cross product, the result is a number, not a vector.

Geometrically, u⋅v=∣u∣ ∣v∣cos⁡θ\mathbf{u} \cdot \mathbf{v} = |\mathbf{u}|\,|\mathbf{v}|\cos\theta, where θ\theta is the angle between the vectors. The dot product is positive when the angle is acute, zero when the vectors are perpendicular and negative when the angle is obtuse.

How to use the Dot Product Calculator

  1. Enter the components of the first vector separated by commas, for example 1, 2, 3.
  2. Enter the second vector with the same number of components.
  3. Press Calculate.
  4. Read the dot product, the magnitudes and the angle between the vectors.
  5. Use the projection step if you need the component of one vector along the other.

Formulas

Dot product

u⋅v=∑i=1nuivi\mathbf{u} \cdot \mathbf{v} = \sum_{i=1}^{n} u_i v_i

Magnitude

∣u∣=u⋅u|\mathbf{u}| = \sqrt{\mathbf{u} \cdot \mathbf{u}}

Angle between vectors

cos⁡θ=u⋅v∣u∣ ∣v∣\cos\theta = \frac{\mathbf{u} \cdot \mathbf{v}}{|\mathbf{u}|\,|\mathbf{v}|}

Projection of u onto v

proj⁡vu=u⋅v∣v∣2 v\operatorname{proj}_{\mathbf{v}}\mathbf{u} = \frac{\mathbf{u} \cdot \mathbf{v}}{|\mathbf{v}|^2}\,\mathbf{v}

Worked example: ⟨1,2,3⟩ · ⟨4,−5,6⟩

The example uses u=⟨1,2,3⟩\mathbf{u} = \langle 1, 2, 3 \rangle and v=⟨4,−5,6⟩\mathbf{v} = \langle 4, -5, 6 \rangle. The component products are 4, −10-10 and 18, which add to 12.

The magnitudes are 14\sqrt{14} and 77\sqrt{77}, so cos⁡θ=121477\cos\theta = \frac{12}{\sqrt{14}\sqrt{77}} and the angle is about 68.56°68.56°. The positive dot product confirms that the angle is acute.

The solution below is generated by the same engine that powers the calculator above.

Final answer

uv=12u v = 12

How we read your problem

Dot product of two 3-dimensional vectors.

⟨1,2,3⟩⋅⟨4,−5,6⟩\langle 1, 2, 3 \rangle \cdot \langle 4, -5, 6 \rangle

Step-by-step solution

  1. Multiply matching components

    (1)(4)+(2)(−5)+(3)(6)(1)(4) + (2)(-5) + (3)(6)
  2. Add the products

    uv=4−10+18=12u v = 4 - 10 + 18 = 12
  3. Find the magnitudes

    ∣u∣=14=14≈3.741657387,∣v∣=77=77≈8.774964387|u| = \sqrt{14} = \sqrt{14} \approx 3.741657387,\quad |v| = \sqrt{77} = \sqrt{77} \approx 8.774964387
  4. Angle between the vectors

    cos⁡θ=uv∣u∣∣v∣=1232.83291≈0.36548694⇒θ≈68.562447° (1.1966404 rad)\cos\theta = \frac{u v}{|u||v|} = \frac{12}{32.83291} \approx 0.36548694 \Rightarrow \theta \approx 68.562447° \ (1.1966404\text{ rad})
  5. Scalar and vector projection of u onto v

    comp⁡vu=uv∣v∣≈1.3675269,proj⁡vu=uv∣v∣2v=⟨4877,−6077,7277⟩\operatorname{comp}_v u = \frac{u v}{|v|} \approx 1.3675269,\quad \operatorname{proj}_v u = \frac{u v}{|v|^2}v = \langle \frac{48}{77}, -\frac{60}{77}, \frac{72}{77} \rangle

Formulas used

  • Dot product

    u⋅v=∑uivi=∣u∣∣v∣cos⁡θu \cdot v = \sum u_i v_i = |u||v|\cos\theta

The dot product is positive, so the angle between the vectors is acute.

Verification

  • Computed exactly; the dot product is symmetric, so v·u gives the same value.

Detailed explanation

Measuring angles and perpendicularity

Rearranging the geometric formula gives the angle between any two nonzero vectors. Because only the sign of cos⁡θ\cos\theta decides whether an angle is acute or obtuse, the sign of the dot product alone tells you which it is, before you compute any magnitudes.

Two vectors are orthogonal exactly when their dot product is zero. For ⟨1,0⟩\langle 1, 0 \rangle and ⟨0,1⟩\langle 0, 1 \rangle the dot product is 0 and the angle is 90°90°. This test works in any dimension, which is why orthogonality is defined through the dot product in four or more dimensions, where angles cannot be drawn.

Projections

The scalar projection u⋅v∣v∣\frac{\mathbf{u} \cdot \mathbf{v}}{|\mathbf{v}|} is the signed length of the shadow that u\mathbf{u} casts on the line through v\mathbf{v}. The vector projection multiplies the unit vector in the direction of v\mathbf{v} by that length. Subtracting the projection from u\mathbf{u} leaves the component perpendicular to v\mathbf{v}, the idea behind the Gram-Schmidt process and least-squares fitting.

In physics, the work done by a constant force F\mathbf{F} moving an object along a displacement d\mathbf{d} is W=F⋅dW = \mathbf{F} \cdot \mathbf{d}: only the component of the force along the motion does work.

Properties

The dot product is commutative, u⋅v=v⋅u\mathbf{u} \cdot \mathbf{v} = \mathbf{v} \cdot \mathbf{u}, and distributes over addition. The dot product of a vector with itself is the square of its length, which is how magnitudes are computed. Scaling one vector by kk scales the dot product by kk but leaves the angle unchanged when kk is positive.

The dot product also connects to the law of cosines. Expanding ∣u−v∣2=(u−v)⋅(u−v)|\mathbf{u} - \mathbf{v}|^2 = (\mathbf{u} - \mathbf{v}) \cdot (\mathbf{u} - \mathbf{v}) gives ∣u∣2+∣v∣2−2 u⋅v|\mathbf{u}|^2 + |\mathbf{v}|^2 - 2\,\mathbf{u} \cdot \mathbf{v}, which is exactly the law of cosines for the triangle formed by the two vectors and their difference. That identity is the reason the angle formula works.

Common mistakes

  • Expecting a vector as the answer; the dot product is a single number.
  • Multiplying mismatched components or vectors of different lengths.
  • Forgetting to take the square root when computing magnitudes.
  • Leaving a calculator in radians when the angle is wanted in degrees.
  • Projecting onto the wrong vector; proj⁡vu\operatorname{proj}_{\mathbf{v}}\mathbf{u} and proj⁡uv\operatorname{proj}_{\mathbf{u}}\mathbf{v} differ.

Tips

  • Check orthogonality first: a zero dot product means a right angle.
  • Use the sign of the dot product to predict whether the angle is acute or obtuse.
  • Normalise vectors to length 1 first and the dot product equals cos⁡θ\cos\theta directly.
  • Use the cross product calculator when you need a vector perpendicular to both.
  • Use the matrix calculator to compute many dot products at once as a matrix product.
  • Write each vector as a column next to the other so matching components line up before you multiply.

Frequently asked questions

How do you calculate the dot product?

Multiply the matching components of the two vectors and add the products. For ⟨1, 2, 3⟩ and ⟨4, −5, 6⟩ this gives 4 − 10 + 18 = 12.

How do I find the angle between two vectors?

Divide the dot product by the product of the magnitudes and take the inverse cosine. The calculator shows this in degrees.

What does a dot product of zero mean?

The vectors are perpendicular (orthogonal), provided neither is the zero vector.

Can the dot product be negative?

Yes. A negative dot product means the angle between the vectors is greater than 90°.

Does the calculator work in more than three dimensions?

Yes. Vectors can have any number of components, as long as both vectors have the same number.

What is the difference between the dot product and the cross product?

The dot product gives a number that measures alignment and works in any dimension. The cross product gives a vector perpendicular to both inputs and is defined for three-dimensional vectors.

What happens if one vector is zero?

The dot product is 0, but the angle is undefined because the zero vector has no direction. The calculator states this instead of giving an angle.

Compute your dot product

Enter two vectors above to get their dot product, the angle between them and the projection.

More math calculators