Dot Product Calculator
Enter two vectors and get the dot product with component-by-component steps, both magnitudes, and the angle between them in degrees and radians. Free, no signup.
The dot product turns two vectors into a single number that measures how much they point the same way. Enter both vectors above as comma-separated lists and this calculator multiplies the matching components, adds them up, and shows every step. It also works out each vector’s magnitude (its length) and the angle between the two vectors, and tells you outright when the vectors are perpendicular.
How to use this calculator
- Type vector a as a comma-separated list, for example 1, 2, 3.
- Type vector b the same way, with the same number of components, for example 4, 5, 6.
- Press Calculate. You get the dot product with each component multiplication shown, |a| and |b|, and the angle in degrees and radians.
Vectors of any dimension work (2D, 3D, 4D and beyond), as long as both lists have the same length. If they do not match, the calculator stops and tells you exactly how many components each one has.
The formulas
a · b = a₁b₁ + a₂b₂ + … + aₙbₙ
Multiply matching components and add the products. The result is a scalar (a plain number), never another vector. The magnitude of a vector is Pythagoras applied to its components, and the angle θ between the vectors comes from combining the two:
|a| = √(a₁² + a₂² + … + aₙ²) and cos θ = (a · b) ÷ (|a| × |b|)
The sign of the dot product is a direction test: positive means the vectors point mostly the same way (angle under 90°), zero means they are perpendicular (exactly 90°), and negative means they point mostly opposite ways (angle over 90°).
Worked example
Let a = (1, 2, 3) and b = (4, 5, 6).
Dot product: 1×4 + 2×5 + 3×6 = 4 + 10 + 18 = 32.
Magnitudes: |a| = √(1 + 4 + 9) = √14 ≈ 3.7417. |b| = √(16 + 25 + 36) = √77 ≈ 8.7750.
Angle: cos θ = 32 ÷ (3.7417 × 8.7750) ≈ 0.97463, so θ = cos⁻¹(0.97463) ≈ 12.93° (about 0.2257 radians). The vectors point in nearly the same direction, which the small angle confirms.
When is the dot product used?
Physics is the biggest user: work done by a force is force · displacement, which is why pushing at an angle does less work. The perpendicular test (dot product zero) is used constantly in geometry and 3D graphics to check whether lines, surfaces or light rays are at right angles, and projections in data science and machine learning are built on the same formula. If you are working with matrices next, the Matrix Calculator covers multiplication, determinants and inverses with the same step-by-step style.
Frequently asked questions
The dot product of two vectors is what you get by multiplying their matching components and adding the products: (1, 2, 3) · (4, 5, 6) = 4 + 10 + 18 = 32. It is also called the scalar product because the answer is a scalar, a single number, not a vector.
The vectors are perpendicular: they meet at exactly 90°. For example (1, 0) · (0, 1) = 0. One exception needs care: the zero vector (all components 0) also gives a dot product of 0 with everything, but it has no direction, so no angle exists. This calculator flags that case instead of claiming an angle.
Yes. A negative dot product means the vectors point mostly in opposite directions and the angle between them is greater than 90°. Directly opposite vectors give the most negative value possible for their lengths, and an angle of 180°.
Yes. The dot product pairs up matching components, so a 3D vector cannot be dotted with a 2D vector. If the lists differ, this calculator stops with a message showing how many components each vector has, rather than silently dropping the extras.
With cos θ = (a · b) ÷ (|a| × |b|): divide the dot product by the product of the magnitudes, then take the inverse cosine (cos⁻¹). The calculator shows the angle in degrees and radians, and the formula rearranged is also how the geometric form a · b = |a| |b| cos θ arises.