Skip to main content

Dot Product Calculator

Compute a·b for 2D, 3D, or any n-dimensional vectors — plus magnitudes, the angle between them, projections, and full step-by-step working.

Which tool do you need? This page is the dot product specialist: it goes deep on a·b — angle via cos θ, scalar/vector projections, orthogonal and parallel checks, and per-component show-your-work. Our vector norm calculator is the broader norm suite (L1/L2/L∞ side-by-side, unit vectors, distance between vectors) where the dot product appears only as a side feature. For everything about a·b itself, stay here.

Enter two vectors

Separate components with commas, spaces, or semicolons. Both vectors must have the same number of components.

Worked examples

Example 1 — 3D dot product. a = (1, 2, 3), b = (4, 5, 6).
a·b = 1×4 + 2×5 + 3×6 = 4 + 10 + 18 = 32.
|a| = √14 ≈ 3.7417, |b| = √77 ≈ 8.7750, cos θ = 32/(√14·√77) ≈ 0.9746, so θ ≈ 12.9332° (acute).
Example 2 — Orthogonal vectors. a = (1, 0), b = (0, 1).
a·b = 1×0 + 0×1 = 0. A zero dot product means the vectors are perpendicular: θ = 90°.
Example 3 — 45° angle. a = (1, 1), b = (1, 0).
a·b = 1×1 + 1×0 = 1. |a| = √2 ≈ 1.4142, |b| = 1, cos θ = 1/√2 ≈ 0.7071, so θ = 45°.
Example 4 — Anti-parallel. a = (3, 0), b = (−6, 0).
a·b = 3×(−6) + 0×0 = −18. cos θ = −1, so θ = 180°: the vectors point in exactly opposite directions.
Example 5 — Obtuse angle with negatives. a = (−1, −2, −3), b = (4, −5, 6).
a·b = (−1)×4 + (−2)×(−5) + (−3)×6 = −4 + 10 − 18 = −12. A negative dot product means an obtuse angle: θ ≈ 111.4376°.

Frequently asked questions

What is the dot product of two vectors?
The dot product (also called the scalar product or inner product) of two vectors a and b is the sum of the products of their matching components: a·b = a1×b1 + a2×b2 + … + an×bn. The result is a single number (a scalar), not a vector. For example, (1, 2, 3)·(4, 5, 6) = 4 + 10 + 18 = 32.
How do you calculate the dot product step by step?
Multiply each pair of matching components, then add the products. For a = (1, 2, 3) and b = (4, 5, 6): step 1, 1×4 = 4; step 2, 2×5 = 10; step 3, 3×6 = 18; step 4, add them: 4 + 10 + 18 = 32. The calculator above shows this per-component working for your own vectors.
What does the dot product tell you geometrically?
It encodes the angle between the vectors through the formula a·b = |a| × |b| × cos θ, so θ = arccos(a·b / (|a||b|)). A positive dot product means an acute angle (under 90°), zero means the vectors are perpendicular, and a negative dot product means an obtuse angle (over 90°). The dot product divided by |b| also gives the scalar projection: how far a reaches along b's direction.
When is the dot product zero or negative?
The dot product is zero exactly when the vectors are orthogonal (perpendicular), for example (1, 0)·(0, 1) = 0, giving θ = 90°. It is negative when the angle between the vectors is obtuse (between 90° and 180°), for example (−1, −2, −3)·(4, −5, 6) = −12, giving θ ≈ 111.44°. It is most negative (−|a||b|) when the vectors point in exactly opposite directions.
What is the difference between the dot product and the cross product?
The dot product takes two vectors and returns a scalar measuring how much they point in the same direction; it works in any dimension. The cross product takes two 3D vectors and returns a new vector perpendicular to both, with magnitude |a||b|sin θ. Use the dot product for angles, projections, and similarity; use the cross product for normals, torque, and oriented areas in 3D.
Can you take the dot product of vectors with different dimensions?
No. The dot product is only defined when both vectors have the same number of components, because each component of a must pair with the matching component of b. If the dimensions differ, the operation is undefined — the calculator above shows a dimension-mismatch error instead of a result.
What is scalar projection, and how is it related to the dot product?
The scalar projection of a onto b is the signed length of a's shadow cast along b's direction, computed as (a·b)/|b|. For a = (1, 2, 3) and b = (4, 5, 6) it is 32/√77 ≈ 3.6467. Multiply it by b's unit vector to get the full vector projection. It is positive when the angle is acute, zero when orthogonal, and negative when obtuse.
What is the difference between this dot product calculator and the vector norm calculator?
This page is the dot product specialist: it focuses entirely on a·b — the angle via cos θ, scalar and vector projections, orthogonal and parallel checks, and per-component show-your-work. The vector norm calculator is the broader norm suite: it compares L1, L2, and L-infinity norms side by side and adds unit vectors and the distance between vectors, with the dot product only as a side feature. Choose this page for anything about a·b itself, and the norm calculator for norm comparisons.

Free tool by NRTechStudio