Cross Product in LaTeX

Write the cross product with \times between two vectors in math mode: \mathbf{a} \times \mathbf{b} or \vec{a} \times \vec{b}. To show how it is computed, put the unit vectors and components in a vmatrix determinant.

Cross product notation

  • \mathbf{a} \times \mathbf{b}
    a × b

    Bold vectors with the times sign.

  • \vec{a} \times \vec{b}
    a → × b →

    Arrow vectors with the times sign.

  • \mathbf{i}, \mathbf{j}, \mathbf{k}
    i , j , k

    Bold unit vectors.

  • \hat{\imath}, \hat{\jmath}, \hat{k}
    ı ^ , ȷ ^ , k ^

    Hat unit vectors; \imath and \jmath are dotless i and j.

  • \begin{vmatrix} a & b \\ c & d \end{vmatrix}
    | a b c d |

    Determinant bars for the component formula (amsmath).

  • \|\mathbf{a} \times \mathbf{b}\|
    ∥ a × b ∥

    Magnitude of the cross product.

  • \mathbf{a} \wedge \mathbf{b}
    a ∧ b

    Wedge notation, used in some texts and for the exterior product.

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.

Templates

Cross 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.

  • Determinant form

    a × b = | i j k a 1 a 2 a 3 b 1 b 2 b 3 |
    LaTeX
    \mathbf{a} \times \mathbf{b} = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{vmatrix}
  • Component form

    a × b = ( a 2 b 3 − a 3 b 2 , a 3 b 1 − a 1 b 3 , a 1 b 2 − a 2 b 1 )
    LaTeX
    \mathbf{a} \times \mathbf{b} = (a_2 b_3 - a_3 b_2,\; a_3 b_1 - a_1 b_3,\; a_1 b_2 - a_2 b_1)
  • Magnitude

    ∥ a × b ∥ = ∥ a ∥ ∥ b ∥ sin ⁡ θ
    LaTeX
    \|\mathbf{a} \times \mathbf{b}\| = \|\mathbf{a}\| \, \|\mathbf{b}\| \sin\theta
  • Anticommutativity

    a × b = − b × a
    LaTeX
    \mathbf{a} \times \mathbf{b} = -\,\mathbf{b} \times \mathbf{a}
  • Unit vectors

    ı ^ × ȷ ^ = k ^
    LaTeX
    \hat{\imath} \times \hat{\jmath} = \hat{k}
  • Torque

    τ → = r → × F →
    LaTeX
    \vec{\tau} = \vec{r} \times \vec{F}
  • Scalar triple product

    a ⋅ ( b × c )
    LaTeX
    \mathbf{a} \cdot (\mathbf{b} \times \mathbf{c})

The determinant form

The usual way to show the computation is a 3×3 determinant: unit vectors in the first row, the components of a and b below. vmatrix (from amsmath) draws the vertical bars at the full height of the matrix; hand-typed | characters would stay one line tall.

LaTeX
\[
\mathbf{a} \times \mathbf{b} =
\begin{vmatrix}
  \mathbf{i} & \mathbf{j} & \mathbf{k} \\
  a_1 & a_2 & a_3 \\
  b_1 & b_2 & b_3
\end{vmatrix}
\]

Hats on i and j

A hat over a normal i or j sits above the dot. Use the dotless letters \imath and \jmath under accents: \hat{\imath}, \hat{\jmath}. k has no dot, so \hat{k} is fine.

Other notations

× is the standard symbol. Some older and European texts write a ∧ b (\wedge) for the vector product; in modern mathematics ∧ usually means the exterior (wedge) product. Define which one you mean if your readers may differ.

Common mistakes

  • The letter x is a variable, not an operator, and gets no spacing.

    Instead of
    a x b
    Write
    \mathbf{a} \times \mathbf{b}
  • The hat collides with the dot of i and j; the dotless forms look right.

    Instead of
    \hat{i} \times \hat{j}
    Write
    \hat{\imath} \times \hat{\jmath}
  • Typed bars stay one line tall; vmatrix stretches them to the matrix.

    Instead of
    | \begin{matrix} … \end{matrix} |
    Write
    \begin{vmatrix} … \end{vmatrix}
  • \vec is a short arrow sized for one letter; \overrightarrow spans both.

    Instead of
    \vec{AB} \times \vec{AC}
    Write
    \overrightarrow{AB} \times \overrightarrow{AC}

In Overleaf, MathJax and Word

  • Overleaf and pdfLaTeX

    \times, \vec, \mathbf, \imath and \jmath are built in; vmatrix needs amsmath.

  • MathJax and KaTeX

    MathJax and KaTeX render all of it, vmatrix included, without loading packages.

  • Microsoft Word

    Write the formula here and use Copy for Word; the determinant pastes as an editable Word equation with bars around the matrix.

Cross product in LaTeX: questions

What is the LaTeX command for the cross product?
\times, between two vectors in math mode: $\mathbf{a} \times \mathbf{b}$.
How do I write the i, j, k determinant?
Use vmatrix with the unit vectors in the first row: \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{vmatrix}.
How do I put a hat on i without the dot?
Use the dotless i: \hat{\imath}. For j, \hat{\jmath}.
What is the difference between the dot and cross product symbols?
The dot product uses \cdot (⋅) and gives a number; the cross product uses \times (×) and gives a vector.

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