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
\rightarrowRight arrow;
\tois the same symbol.\leftarrowLeft arrow;
\getsis the same.\leftrightarrowLeft-right arrow.
\RightarrowDouble right arrow (implication in logic).
\LeftrightarrowDouble left-right arrow (equivalence).
\impliesLong double arrow with extra space (amsmath);
\ifffor ⟺.\longrightarrowLong right arrow;
\Longrightarrowfor the double version.\mapstoMaps to (x ↦ f(x));
\longmapstofor a long one.\uparrow \downarrow \updownarrowVertical arrows; capitalize for double ones.
\nearrow \searrow \swarrow \nwarrowDiagonal arrows (north-east, south-east, …).
\hookrightarrowHook arrow for an inclusion or embedding.
\rightleftharpoonsHarpoons for a reversible chemical reaction.
\xrightarrow{f}Arrow that stretches under a label (amsmath);
\xleftarrowpoints 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.
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.
Function signature
LaTeXf \colon \mathbb{R} \to \mathbb{R}Limit notation
LaTeX\lim_{x \to \infty} \frac{1}{x} = 0Implication chain
LaTeXx > 2 \implies x^2 > 4 \implies x^2 \neq 0Equivalence
LaTeXa = b \iff b = aLabeled arrow
LaTeXA \xrightarrow{\ \phi\ } B \xrightarrow[\text{onto}]{\ \psi\ } CMaps to
LaTeXx \mapsto x^2 + 1Chemical equilibrium
LaTeX\mathrm{N_2} + 3\,\mathrm{H_2} \rightleftharpoons 2\,\mathrm{NH_3}Vector arrow over letters
LaTeX\overrightarrow{AB} + \overrightarrow{BC} = \overrightarrow{AC}
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.
Step 1 $\rightarrow$ Step 2
Step 1 \textrightarrow{} Step 2Common mistakes
LaTeX prints
->as a minus sign and a greater-than sign, not an arrow.Instead ofA -> BWriteA \to BThe double arrow means implication. A function between sets uses the single arrow
\to.Instead of\Rightarrow % for a function f: A => BWritef \colon A \to BExtensible arrows and
\implies/\iffare amsmath commands and are undefined without it.Instead of\xrightarrow{f} % without amsmathWrite\usepackage{amsmath}\oversetplaces the label over a fixed-length arrow, so long labels overhang.\xrightarrowstretches 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,\xrightarrowand\xleftarrowneed amsmath.\rightleftharpoonsis built in; more chemistry arrows come frommhchem(\ce{A <=> B}).MathJax and KaTeX
MathJax and KaTeX support all arrows in the table, including
\xrightarrow. MathJax also has\longleftrightarrowand the harpoons.tikz-cddiagrams do not work on the web; MathJax offers a simpleramscd(\begin{CD}) instead.Microsoft Word
In a Word equation, Math AutoCorrect converts names like
\rightarrowand\Rightarrowinto 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
\rightarrowor its short form\toin 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;\Rightarrowis 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
\leftrightarrowfor ↔,\Leftrightarrowfor ⇔, and\ifffor the long ⟺ with extra spacing.
Related LaTeX reference
- And Symbol and Logic Symbols in LaTeXLogical and (\land), or, not, implies, iff, for all and there exists, and how to print a literal & instead.
- Vector in LaTeX\vec{v} and \overrightarrow{AB}, bold vectors with \mathbf and \boldsymbol, unit vectors, column and row vectors, and norms.
- Limit in LaTeX\lim_{x \to a}, one-sided limits, limits at infinity, limsup and liminf, and how to keep the condition under lim in running text.
- 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