Guide HTML & CSS

Arrow Symbols in HTML and CSS

How to add arrows to web pages with named entities, numeric codes, CSS pseudo-elements and JavaScript.

Tap to copy:

Arrow HTML codes: → →, ← ←, ↑ ↑, ↓ ↓, ↔ ↔, ⇒ ⇒
Arrow HTML codes (cheat sheet) · Download image

Three ways to write an arrow in HTML

  • Paste the arrow directly: Next →. This works as long as your page uses UTF-8 (<meta charset="UTF-8">).
  • Named entity: &rarr; for →. Easy to read in code.
  • Numeric code: &#8594; (decimal) or &#x2192; (hex). Works for every arrow, even ones without a name.

Named arrow entities

ArrowEntityDecimal
←&larr;&#8592;
↑&uarr;&#8593;
→&rarr;&#8594;
↓&darr;&#8595;
↔&harr;&#8596;
⇐&lArr;&#8656;
⇒&rArr;&#8658;
⇔&hArr;&#8660;
↵&crarr;&#8629;
»&raquo;&#187;

Arrows with CSS

Add an arrow after a link without changing the HTML, using the hex code with a backslash:

.more::after {
  content: " \2192";
}

You can rotate one arrow instead of using four: transform: rotate(90deg) turns → into ↓.

Arrows in JavaScript

const next = "\u2192";        // →
const emoji = "\u{1F449}";    // 👉
el.textContent = "Next " + next;

Accessibility

Screen readers may read arrows aloud, like “rightwards arrow”. When an arrow is only decoration, wrap it: <span aria-hidden="true">→</span>. If the arrow is the only content of a button, add a label: <button aria-label="Next">→</button>.

Frequently Asked Questions

What is the HTML code for a right arrow?

Use &rarr;, &#8594; or &#x2192;.

How do I add an arrow with CSS?

Use content with the hex code, for example .link::after { content: "\2192"; }.

More guides

→Copied