Dot Product Calculator
Calculate the dot product of two vectors used in embeddings and attention scores.
About Dot Product Calculator
The dot product of two vectors is the sum of element-wise products. It equals ||A|| × ||B|| × cos(θ) where θ is the angle between them. It is fundamental in neural network computations, attention mechanisms, and similarity measures.
Formula
Dot Product
a · b = sum(a_i * b_i)
- a, b
- Input vectors of equal dimension
Worked example
With the default values below, Dot Product Calculator returns Dot Product of 32.000000. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Vector A
- 1, 2, 3
- Vector B
- 4, 5, 6
Results
- Dot Product
- 32.000000
- ||A||
- 3.741657
- ||B||
- 8.774964
Step by step
- 1Element-wise products summed= 32.000000
- 2||A||= 3.741657
- 3||B||= 8.774964
Assumptions and limits
- The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
What does the sign of the dot product tell us?
A positive dot product means the vectors point in roughly the same direction (angle < 90°), zero means they are orthogonal, and negative means they point in opposite directions (angle > 90°).
How is the dot product used in neural networks?
Every neuron computes a dot product between its weight vector and the input vector, followed by a bias addition and activation function. Attention mechanisms also rely heavily on dot products between query and key vectors.
