Dot Product Calculator
Calculate the dot product of two vectors: multiply matching components, add the results, and see the exact scalar answer with full steps.
What the dot product is
The dot product (also called the scalar product) is one of the most basic operations in linear algebra. It takes two vectors — ordered lists of numbers of the same length — and combines them into a single number. Unlike adding two vectors (which gives you another vector), the dot product always gives you a scalar.
The formula: a · b = Σ aᵢbᵢ
For two vectors with components each, and , the dot product is:
In words: multiply each pair of matching components, then add all of those products together.
Step by step
Take and :
- Multiply the first components: .
- Multiply the second components: .
- Multiply the third components: .
- Add the products: .
So . The calculator above walks through this same table-then-sum breakdown for whatever numbers you enter.
Component count must match
Because every term in the sum needs a partner, both vectors must have the same number of components. A 3-number vector can only be dotted with another 3-number vector; pairing it with a 2-number or 4-number vector leaves a term without a match, so the operation is undefined. This calculator flags mismatched lengths instead of guessing at a partial answer.
What the result tells you
| Sign of | What it means geometrically |
|---|---|
| Positive | The vectors point in a broadly similar direction (angle under 90°) |
| Zero | The vectors are perpendicular (orthogonal) — e.g. |
| Negative | The vectors point in broadly opposite directions (angle over 90°) |
The dot product is also the building block for vector magnitude (length): dotting a vector with itself and taking the square root gives its length, — the same square-root operation behind the Square Root calculator, and closely related to the "always non-negative" magnitude idea in the Absolute Value calculator.
Worked examples
Example 1 — three components: .
Example 2 — a negative component: .
Example 3 — decimals stay exact: .
Example 4 — perpendicular vectors: , confirming the two vectors are orthogonal.
Where the dot product shows up
The dot product is a gateway idea into linear algebra: it underlies vector length and distance, the angle between two directions, projections (how much of one vector lies along another), and — in higher dimensions — the "similarity" scores used throughout machine learning and search. Physics uses it to compute work (force dotted with displacement); computer graphics uses it for lighting calculations; data science uses it for cosine similarity between feature vectors. Once you're comfortable multiplying matching components and summing the results, you have the core building block for all of these.
Frequently asked questions
- What is the dot product of two vectors?
- The dot product takes two vectors of the same length and combines them into a single number (a scalar). You multiply each pair of matching components together, then add all the products up: . For example, .
- How do you calculate the dot product step by step?
- List the two vectors side by side, component by component. Multiply each pair (first component of with first component of , second with second, and so on), then add every one of those products together. The running total after the last pair is the dot product.
- What if the two vectors have a different number of components?
- The dot product is only defined when both vectors have exactly the same number of components — you need a matching partner for every term in the sum. If vector has 3 numbers and vector has 2, there is no way to pair them up, so the dot product is undefined for that pair.
- Is the dot product a vector or a number?
- A number (a scalar), not a vector. This is what distinguishes it from other vector operations like the cross product, which returns another vector. Every dot product calculation collapses two vectors down to a single value.
- What does a negative dot product mean?
- The sign of the dot product tells you about the angle between the two vectors. A positive dot product means they point in a broadly similar direction (less than 90° apart); a negative dot product means they point in broadly opposite directions (more than 90° apart); a dot product of exactly zero means the vectors are perpendicular.
- What is the dot product used for?
- It shows up throughout physics, engineering, computer graphics, and machine learning: computing the work done by a force, projecting one vector onto another, testing whether two directions are perpendicular, and measuring similarity between data vectors (cosine similarity is built directly from the dot product).