Dot Product Calculator
Calculate the dot product of two 3D vectors, with their magnitudes, the angle between them and the scalar projection.
Everything you type here is processed on your own device. No input is sent to a server, logged, or stored.
What the Dot Product Calculator does
This dot product calculator will calculate the dot product of two 3D vectors, with their magnitudes, the angle between them and the scalar projection. Fill in all 6 fields and the result updates as you type — there is no Calculate button to press and no page reload. It is most often used for finding the angle between two vectors or two directions. The companion to this one is our bayes theorem calculator.
How to use it
- Enter the three components of your first vector.
- Enter the three components of the second. For 2D vectors, leave both z values at zero.
- Read the dot product and the angle between the vectors in degrees.
- Use the projection row when you need the component of one vector along the other, as in a work calculation.
How it works
The dot product multiplies matching components and adds the results, giving a single number rather than a vector. Its real meaning comes from the second form of the formula: it equals the product of the two lengths times the cosine of the angle between them. So the dot product measures how much two vectors point in the same direction, scaled by how long they are.
The sign alone is informative. Positive means the angle is acute and the vectors broadly agree; negative means obtuse and they broadly oppose; exactly zero means perpendicular. That last case is the most useful identity in the subject, because testing orthogonality becomes three multiplications and two additions with no trigonometry at all — which is why it is everywhere in graphics, physics engines and machine learning.
The scalar projection on the last row is how much of a lies along b, found by dividing the dot product by the length of b. Physics uses exactly this to compute work: a force of 50 N dragging a crate 10 m at 30° to the floor does 50 × 10 × cos 30° ≈ 433 joules, not 500, because only the component along the motion counts. Lighting models in 3D graphics use the same quantity to decide how brightly a surface faces a light.
When to use it
- Finding the angle between two vectors or two directions.
- Testing whether two vectors are perpendicular.
- Calculating work done by a force at an angle to the motion.
- Computing a diffuse lighting term from a surface normal and a light direction.
Common mistakes to avoid
- Expecting a vector result. The dot product is a scalar; the cross product is the one that returns a vector.
- Forgetting to divide by both magnitudes before taking the inverse cosine, which gives a domain error or a nonsense angle.
- Using the raw dot product as a similarity score without normalising. Longer vectors produce larger dot products regardless of direction.
Frequently asked questions
What does a dot product of zero mean?
The two vectors are perpendicular, assuming neither is the zero vector. It is the standard test for orthogonality and needs no trigonometry.
How do I find the angle between two vectors?
Divide the dot product by the product of the two magnitudes to get cos θ, then take the inverse cosine. This page does all three steps and shows cos θ as well as the angle.
What is the difference between the dot and cross products?
The dot product returns a number measuring alignment, and works in any number of dimensions. The cross product returns a vector perpendicular to both inputs, and is defined only in three dimensions.