Skip to main content

DigitalCalculators.net

Dot Product Calculator

Find the dot product of two vectors in 2D, 3D or more, plus their lengths, the angle between them, whether they are perpendicular and the projection of one onto the other.

Results

ItemValue

Steps

StepWorking
Enter each vector’s components separated by commas or spaces, such as 3, 4 or 1, 2, 3. Both vectors need the same number of components, from 2 to 10. Brackets are ignored.

Quick Answer

The dot product multiplies matching components and adds them: a · b = a₁b₁ + a₂b₂ + a₃b₃. For a = (1, 2, 3) and b = (4, −5, 6), a · b = 4 − 10 + 18 = 12. The angle between them comes from cos θ = a · b ÷ (|a||b|), which gives about 68.56°.

Last updated: 10 November 2026 ·How we calculate this: the component and angle formulas

How This Dot Product Calculator Works

Type the components of two vectors and press Calculate. The calculator multiplies each pair of matching components and adds the results to get the dot product. It also finds the length of each vector, the angle between them, whether they are perpendicular, and the scalar and vector projection of b onto a, with the working shown.

Quick explanation: the dot product is a single number that measures how much two vectors point the same way.

  • Positive: the angle is less than 90°.
  • Zero: the vectors are perpendicular (orthogonal).
  • Negative: the angle is more than 90°.

How to Use the Dot Product Calculator

  1. Enter vector a as numbers separated by commas.
  2. Enter vector b with the same number of components.
  3. Press Calculate.
  4. Read the dot product, lengths and angle.
  5. Check the projection and whether the vectors are perpendicular.

Dot Product Formulas

  • Components: a · b = a₁b₁ + a₂b₂ + … + aₙbₙ
  • Angle form: a · b = |a| |b| cos θ
  • Angle between vectors: θ = arccos(a · b ÷ (|a| |b|))
  • Length: |a| = √(a · a)
  • Scalar projection of b onto a: a · b ÷ |a|
  • Vector projection of b onto a: (a · b ÷ |a|²) × a

Key Terms

  • Vector: a quantity with size and direction, written as components such as (1, 2, 3).
  • Dot product: the sum of the products of matching components; also called the scalar product.
  • Magnitude: the length of a vector, |a| = √(a₁² + a₂² + …).
  • Orthogonal: perpendicular; two vectors whose dot product is 0.
  • Projection: the part of one vector that lies along another.

Worked Example

Find the dot product and angle for a = (2, 0, 1) and b = (1, 3, 2).

  • a · b = 2 × 1 + 0 × 3 + 1 × 2 = 4
  • |a| = √(4 + 0 + 1) = 2.236068, |b| = √(1 + 9 + 4) = 3.741657
  • cos θ = 4 ÷ (2.2361 × 3.7417) = 0.478091, so θ ≈ 61.4392°
  • Scalar projection of b onto a = 4 ÷ 2.2361 = 1.788854

Real-Life Examples

  • Checking perpendicular lines: (3, 4) · (4, −3) = 12 − 12 = 0, so the vectors meet at 90°.
  • Angle between vectors: (1, 2, 3) and (4, −5, 6) meet at about 68.56°.
  • Work in physics: a 50 N force over 10 m at 30° does about 433.0 J of work.
  • Cosine similarity: compare two lists of scores by the cosine of the angle between them.

Dot Product vs Cross Product

  • Dot product: gives a number (a scalar), works in any number of dimensions, and is largest when vectors point the same way.
  • Cross product: gives a new vector perpendicular to both, works in 3D, and is largest when vectors are at 90°.
  • |a · b| = |a||b| cos θ, while |a × b| = |a||b| sin θ.

Dot Product Sign and the Angle

a · bcos θAngle θMeaning
PositiveBetween 0 and 10° to less than 90°Point roughly the same way
Zero090°Perpendicular (orthogonal)
NegativeBetween −1 and 0More than 90° to 180°Point roughly opposite ways
|a||b|10°Same direction (parallel)
−|a||b|−1180°Opposite directions

Properties of the Dot Product

  • Commutative: a · b = b · a.
  • Distributive: a · (b + c) = a · b + a · c.
  • Scalars: (ka) · b = k(a · b).
  • Self dot product: a · a = |a|², the square of the length.
  • Orthogonal test: a · b = 0 for non-zero vectors means they meet at 90°.

Where the Dot Product Is Used

In physics, work is the dot product of force and displacement: W = F · d. Pushing a box 10 m with a 50 N force at 30° to the floor does 50 × 10 × cos 30° ≈ 433 J of work. In computer graphics, the dot product of a surface’s normal and the light direction sets how bright the surface looks.

In data science, cosine similarity between two lists of numbers is the dot product divided by the product of their lengths, which is the cosine of the angle this calculator shows. Machine learning models use dot products constantly to combine inputs with weights.

Common Mistakes to Avoid

  • Multiplying the wrong components. Pair the first with the first, the second with the second, and so on.
  • Expecting a vector. The dot product is a single number; the cross product gives a vector.
  • Different sizes. Both vectors must have the same number of components.
  • Forgetting signs. A negative component changes the total.
  • Mixing degrees and radians. Check which unit the angle is in.

Frequently Asked Questions

Multiply matching components and add them. For (1, 2, 3) · (4, −5, 6): 4 − 10 + 18 = 12.

How much two vectors point in the same direction. It also gives the angle between them.

The vectors are perpendicular, as long as neither is the zero vector.

θ = arccos(a · b ÷ (|a| |b|)).

A scalar, a single number. That is why it is also called the scalar product.

Yes. A negative dot product means the angle is more than 90°.

Yes. a · b = a₁b₁ + a₂b₂ for 2D vectors, and the same pattern for any number of dimensions.

Its length squared: a · a = |a|².

The dot product gives a number; the cross product gives a vector perpendicular to both.

The signed length of b along the direction of a, equal to a · b ÷ |a|.

References & Sources

SourceUsed ForLink
OpenStax, Calculus Volume 3, 2.3 The Dot Product Definition, properties, angle formula and projections. https://openstax.org/books/calculus-volume-3/pages/2-3-the-dot-product