The dot product is where vector arithmetic starts paying rent: one number that measures how much two vectors agree in direction — the engine inside work calculations, lighting models, and similarity scores. This dot product calculator takes two vectors in 2D or 3D, multiplies them component by component, and returns the dot product, both magnitudes, and the angle between the vectors, with every step visible.
Two Definitions, One Number
The algebraic definition: multiply corresponding components and add — a · b = a₁b₁ + a₂b₂ + a₃b₃. The geometric definition: a · b = |a| |b| cos θ, the product of the magnitudes times the cosine of the angle between them. That these agree is one of linear algebra’s small miracles, and it is what makes the dot product useful in both directions: compute it from components to learn the angle, or use the angle to predict the component result. This calculator does the component computation and then inverts the geometric form to report the angle — both definitions, one pass.
Worked Example: (1, 2, 3) and (4, 5, 6)
Component products: 1×4 = 4, 2×5 = 10, 3×6 = 18, summing to a · b = 32. Magnitudes: |a| = √14 ≈ 3.742 and |b| = √77 ≈ 8.775. The angle: cos θ = 32 ÷ (3.742 × 8.775) = 0.9747, so θ ≈ 12.93° — the vectors are closely aligned, as a strongly positive dot product relative to the magnitudes promised. (The same two vectors feed this site’s cross product calculator, where their cross product (−3, 6, −3) points perpendicular to both — the two products are complementary views of the same pair.)
Reading the Sign and the Zero
The sign of the dot product is a direction verdict: positive means the angle is acute (vectors lean together), negative means obtuse (they lean apart), and zero means exactly perpendicular — orthogonal, in the vocabulary that matters. The zero case is the workhorse test of all geometry: two lines, planes, or force directions are perpendicular if and only if their direction vectors dot to zero. Size matters too, but carefully: a big dot product can mean strong alignment or just long vectors — divide by the magnitudes (the calculator’s angle does this) before calling it agreement.
Work, Projection, and Power
Physics’ work is a dot product: W = F · d counts only the force component along the displacement — push perpendicular to the motion and you do no work on the object, however tired you get. The projection formula (a · b ÷ |b|) extracts how much of a lies along b, the shadow one vector casts on another; it reappears in computer graphics as the core of lighting (surfaces facing a light are bright in proportion to a normal · light dot product) and in machine learning as cosine similarity, the normalized dot product that measures how alike two embedding vectors are. One formula, three industries.
Dot Product vs Cross Product
Students meet them together and confuse them forever: the dot product takes two vectors and returns a scalar (a plain number measuring alignment), while the cross product returns a vector perpendicular to both, measuring the area of the parallelogram they span. Dot cares about the cosine of the angle; cross about the sine. Dot vanishes for perpendicular vectors; cross vanishes for parallel ones. If the answer should be a number, dot; if it should have a direction, cross.
Common Mistakes
Writing the component products and forgetting to add them (the products are not the product) tops the list. Mixing dimensions — dotting a 2D with a 3D vector — is blocked here but common on paper. Reading a large dot product as “nearly parallel” without normalizing by magnitudes misleads whenever the vectors are long. And the angle formula needs the angle between the vectors when placed tail-to-tail; using a diagram’s supplement angle flips the cosine’s sign and the dot product with it.
A Note on Higher Dimensions
Nothing in the component definition stops at three dimensions: data vectors with hundreds of features dot exactly the same way, term by term, and the angle interpretation survives as cosine similarity even where no picture can be drawn. This calculator stops at 3D because that is where geometry homework lives — but the formula it runs is the same one ranking documents and recommending films at industrial scale.
Related Tools
The vector set continues with the Cross Product Calculator in the Math Calculators hub, alongside the Harmonic Mean Calculator and the rest of the algebra family.
Frequently Asked Questions
How do you calculate a dot product?
Multiply corresponding components and add the products. For (1, 2, 3) and (4, 5, 6): 1×4 + 2×5 + 3×6 = 4 + 10 + 18 = 32.
What does a dot product of zero mean?
The vectors are perpendicular (orthogonal) — the angle between them is exactly 90 degrees. It is the standard algebraic test for perpendicularity in geometry, physics and graphics.
How do you find the angle between two vectors?
Use the geometric form solved for the angle: theta = arccos( (a . b) / (|a| |b|) ). For this page’s example: arccos(32 / (3.742 × 8.775)) = 12.93 degrees.
Can a dot product be negative?
Yes — whenever the angle between the vectors is obtuse (over 90 degrees). The vectors point in generally opposite directions, and in physics terms one works against the other.
What is the difference between dot and cross products?
The dot product returns a scalar measuring alignment (cosine-based); the cross product returns a vector perpendicular to both inputs, with magnitude measuring the spanned area (sine-based).
Is the dot product commutative?
Yes: a . b = b . a always — the component sum is symmetric. (The cross product is the opposite case: swapping the order flips the result’s sign.)
Where is the dot product used in real life?
Work and power in physics, projection and shadow calculations, lighting in computer graphics, and cosine similarity in search and machine learning — anywhere “how much do these two directions agree” is the question.