</>
character.codes
← Back to Learn

HTML Entities: A Complete Guide

Published March 1, 2025

What are HTML entities?

HTML entities are special sequences of characters that represent symbols which cannot be typed directly into HTML source code, or which would be interpreted as HTML markup. They start with an ampersand (&) and end with a semicolon (;).

Why do they exist?

Certain characters are reserved in HTML. The less-than sign (<) starts a tag, the ampersand begins an entity reference, and the greater-than sign closes a tag. If you want to display these characters as text rather than HTML markup, you need entities.

Entities also let you insert characters that don't exist on your keyboard — like the copyright symbol (©), em dashes (—), or mathematical operators (±).

Named vs. numeric entities

There are two ways to write an entity:

  • Named entities use a human-readable name: &copy; renders as ©
  • Numeric entities use a Unicode code point: &#169; (decimal) or &#xA9; (hexadecimal) also render as ©

Named entities are easier to read, but not every Unicode character has a named entity. Numeric entities work for any Unicode code point.

Most commonly used entities

CharacterEntityDescription
&&amp;Ampersand
<&lt;Less than
>&gt;Greater than
"&quot;Double quote
'&apos;Apostrophe
 &nbsp;Non-breaking space
©&copy;Copyright
&mdash;Em dash

When to use entities

In modern UTF-8 encoded documents, you only need entities for the five reserved characters (&, <, >, ", '). However, entities remain useful for readability and for inserting characters that are hard to distinguish visually (like non-breaking spaces).