How to Write an Arrow in LaTeX

Arrows are math-mode commands named after their direction: \rightarrow (or \to) gives →, \leftarrow gives ←, \leftrightarrow gives ↔. Capitalize the first letter for a double arrow (\Rightarrow ⇒), add long for a longer one (\longrightarrow), and use \xrightarrow{text} for an arrow with a label.

Arrow commands

  • \rightarrow
    →

    Right arrow; \to is the same symbol.

  • \leftarrow
    ←

    Left arrow; \gets is the same.

  • \leftrightarrow
    ↔

    Left-right arrow.

  • \Rightarrow
    ⇒

    Double right arrow (implication in logic).

  • \Leftrightarrow
    ⇔

    Double left-right arrow (equivalence).

  • \implies
    ⟹

    Long double arrow with extra space (amsmath); \iff for ⟺.

  • \longrightarrow
    ⟶

    Long right arrow; \Longrightarrow for the double version.

  • \mapsto
    ↦

    Maps to (x ↦ f(x)); \longmapsto for a long one.

  • \uparrow \downarrow \updownarrow
    ↑↓↕

    Vertical arrows; capitalize for double ones.

  • \nearrow \searrow \swarrow \nwarrow
    ↗↘↙↖

    Diagonal arrows (north-east, south-east, …).

  • \hookrightarrow
    ↪

    Hook arrow for an inclusion or embedding.

  • \rightleftharpoons
    ⇌

    Harpoons for a reversible chemical reaction.

  • \xrightarrow{f}
    → f

    Arrow that stretches under a label (amsmath); \xleftarrow points left.

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

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

Which arrow to use

Use \to for functions and limits (f: A → B, x → 0), \mapsto for where an element goes (x ↦ x²), \Rightarrow or \implies for logical implication, and \iff or \Leftrightarrow for "if and only if". \implies and \iff come from amsmath and add wider spacing, which reads better between whole statements.

For an arrow with text on it, \xrightarrow{above} and \xrightarrow[below]{above} grow with the label. They are part of amsmath. For commutative diagrams with arrows in several directions, the tikz-cd package is the usual tool.

Arrows in normal text

Arrow commands are math-mode only. In a sentence write $\rightarrow$, or use \textrightarrow (and \textleftarrow, \textuparrow, \textdownarrow) from textcomp, which recent LaTeX loads automatically.

LaTeX
Step 1 $\rightarrow$ Step 2
Step 1 \textrightarrow{} Step 2

Common mistakes

  • LaTeX prints -> as a minus sign and a greater-than sign, not an arrow.

    Instead of
    A -> B
    Write
    A \to B
  • The double arrow means implication. A function between sets uses the single arrow \to.

    Instead of
    \Rightarrow  % for a function f: A => B
    Write
    f \colon A \to B
  • Extensible arrows and \implies / \iff are amsmath commands and are undefined without it.

    Instead of
    \xrightarrow{f}  % without amsmath
    Write
    \usepackage{amsmath}
  • \overset places the label over a fixed-length arrow, so long labels overhang. \xrightarrow stretches the arrow to fit.

    Instead of
    \overset{f}{\rightarrow}
    Write
    \xrightarrow{f}

In Overleaf, MathJax and Word

  • Overleaf and pdfLaTeX

    The basic arrows work without packages; \implies, \iff, \xrightarrow and \xleftarrow need amsmath. \rightleftharpoons is built in; more chemistry arrows come from mhchem (\ce{A <=> B}).

  • MathJax and KaTeX

    MathJax and KaTeX support all arrows in the table, including \xrightarrow. MathJax also has \longleftrightarrow and the harpoons. tikz-cd diagrams do not work on the web; MathJax offers a simpler amscd (\begin{CD}) instead.

  • Microsoft Word

    In a Word equation, Math AutoCorrect converts names like \rightarrow and \Rightarrow into arrows when you press Space. For labeled arrows or longer formulas, build them here and use Copy for Word.

Arrows in LaTeX: questions

How do I write a right arrow in LaTeX?
Use \rightarrow or its short form \to in math mode: $A \to B$. For ⇒ use \Rightarrow.
What is the difference between \Rightarrow and \implies?
They mean the same thing. \implies (amsmath) is a longer arrow with extra space on both sides, meant for implications between statements; \Rightarrow is a normal-width relation symbol.
How do I put text above an arrow?
Use \xrightarrow{text} from amsmath; \xrightarrow[below]{above} adds text underneath too. The arrow grows to fit.
How do I write a double-headed (two-way) arrow?
Use \leftrightarrow for ↔, \Leftrightarrow for ⇔, and \iff for the long ⟺ with extra spacing.

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