Dot Product in LaTeX
Write the dot product with \cdot between two vectors in math mode: \mathbf{u} \cdot \mathbf{v} or \vec{u} \cdot \vec{v}. For inner-product notation use angle brackets \langle \mathbf{u}, \mathbf{v} \rangle, not the less-than and greater-than keys.
Dot product notation
\mathbf{u} \cdot \mathbf{v}Bold vectors with a centered dot.
\vec{u} \cdot \vec{v}Arrow vectors with a centered dot.
\langle \mathbf{u}, \mathbf{v} \rangleInner-product (angle bracket) notation.
\mathbf{u}^\top \mathbf{v}Matrix form: row vector times column vector.
\|\mathbf{u}\|Length (norm) of a vector, used with the dot product.
\sum_{i=1}^{n} u_i v_iComponent form.
\boldsymbol{\alpha} \cdot \boldsymbol{\beta}Bold Greek vectors need
\boldsymbol(amsmath), not\mathbf.
Try it live
Change the formula and the preview redraws as you type. Copy the LaTeX, download a PNG or SVG, copy it for Word, or use Edit here on any example below to load it.
Dot product examples
Each result below is drawn from the LaTeX under it. Copy the code, edit it on this page, or open it in the full editor.
Definition
LaTeX\mathbf{a} \cdot \mathbf{b} = \sum_{i=1}^{n} a_i b_iIn three dimensions
LaTeX\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3With numbers
LaTeX(1, 2, 3) \cdot (4, 5, 6) = 4 + 10 + 18 = 32Geometric form
LaTeX\mathbf{a} \cdot \mathbf{b} = \|\mathbf{a}\| \, \|\mathbf{b}\| \cos\thetaAngle between vectors
LaTeX\cos\theta = \frac{\vec{u} \cdot \vec{v}}{\|\vec{u}\| \, \|\vec{v}\|}Orthogonality
LaTeX\vec{u} \cdot \vec{v} = 0 \iff \vec{u} \perp \vec{v}Inner product of functions
LaTeX\langle f, g \rangle = \int_{a}^{b} f(x) \, g(x) \, dx
Which dot to use
\cdot is a binary operator: it sits at mid-height and gets space on both sides, which is what a dot product needs. A period . sits on the baseline with no spacing, and \bullet is a heavy round dot that looks out of place between vectors.
Angle brackets for inner products
Use \langle and \rangle for ⟨ ⟩. The keyboard < and > are relations: they are the wrong shape and LaTeX spaces them as comparisons. For tall contents, \left\langle … \right\rangle stretches the brackets.
Writing the vectors
Choose one vector style and keep it: \vec{u} (arrow), \mathbf{u} (upright bold, common in print) or \boldsymbol{u} (bold italic). \mathbf does not work on Greek letters; use \boldsymbol{\alpha} from amsmath (or \bm from the bm package in LaTeX).
Common mistakes
< and > are comparison signs with relation spacing, not brackets.
Instead of<u, v>Write\langle u, v \rangleA period sits on the baseline and gets no operator spacing.
Instead ofu.vWriteu \cdot v\mathbfleaves lowercase Greek letters unchanged, so the vectors do not look bold.Instead of\mathbf{\alpha} \cdot \mathbf{\beta}Write\boldsymbol{\alpha} \cdot \boldsymbol{\beta}Two single bars are spaced as separate symbols;
\|is the norm delimiter.Instead of||u||Write\|u\|
In Overleaf, MathJax and Word
Overleaf and pdfLaTeX
\cdot,\vec,\mathbf,\langle,\rangleand\|are built in;\boldsymbolneeds amsmath,\bmneeds the bm package.MathJax and KaTeX
MathJax and KaTeX support all the notation above, including
\boldsymbol.\bmis not available in MathJax by default, so prefer\boldsymbolfor text that will be shown on the web.Microsoft Word
Write the formula in the editor on this page and use Copy for Word: the vectors, dot and brackets paste as an editable Word equation.
Dot product in LaTeX: questions
- What is the LaTeX command for the dot product?
\cdot, placed between the vectors in math mode:$\mathbf{u} \cdot \mathbf{v}$.- How do I write ⟨u, v⟩ in LaTeX?
- Use
\langle u, v \rangle. For larger contents,\left\langle … \right\ranglescales the brackets. - How do I write vectors with arrows in a dot product?
- Use
\vec{u} \cdot \vec{v}. For an arrow over two letters, such as AB, use\overrightarrow{AB}. - Should I use \cdot or \bullet?
\cdot. It is the standard dot-product symbol;\bulletis a larger dot that is rarely used for products.
Related LaTeX reference
- Cross Product in LaTeX\times between vectors, the i, j, k determinant with vmatrix, dotless-i unit vectors and the magnitude formula.
- Vector in LaTeX\vec{v} and \overrightarrow{AB}, bold vectors with \mathbf and \boldsymbol, unit vectors, column and row vectors, and norms.
- Dot in LaTeX\cdot, \ldots, \cdots, \vdots, \ddots, \dot{x} and \bullet, and which dot fits which context.
- LaTeX equation editorSymbol panel, live preview, and PNG, SVG, MathML or Word export.
- All LaTeX reference pagesSymbols, math structures and text formatting in one list.
Have the formula as a picture?
Paste a screenshot or photo of the equation and get its LaTeX, ready to copy or open in the editor.
Convert an image to LaTeX