Skip to content
Buy me a coffee
Web Resources

Complete List of HTML Entities

Complete list of HTML entities with their names, numbers and descriptions, including printable ASCII characters, ISO-8859-1 symbols, math symbols, Greek letters and more.

Encode / decode a character

Paste a character to get its entity forms, or an entity (named, decimal or hexadecimal) to get the character back.
Result
Type something on the left…
Loading… Click an entity to copy it. The HTML5 specification defines 2,231 named character references; this page lists the classic HTML 4.01 set (plus a few HTML5 additions), which every browser has supported for decades.

HTML entities explained

What is a character entity reference?

An HTML entity is a piece of text that starts with an ampersand (&) and ends with a semicolon (;) and that the browser replaces with a single character when it renders the page. Entities exist for two reasons: to write characters that have a special meaning in HTML markup (<, &…) and, historically, to write characters that the document's encoding or the author's keyboard could not produce (©, é, ).

There are three ways to write the same character:

FormSyntaxExample for €Notes
Named (character entity reference)&name;&euro;Case-sensitive: &Eacute; is É, &eacute; is é. Only names defined by the HTML specification work.
Decimal (numeric character reference)&#N;&#8364;N is the Unicode code point in base 10. Works for every character, even those without a name.
Hexadecimal (numeric character reference)&#xH;&#x20AC;Same code point in base 16, matching the U+20AC notation used in Unicode tables. The x and the digits are case-insensitive.

Numeric references always refer to Unicode code points (ISO 10646), whatever the encoding of the page. &#128512; is 😀 even in an ISO-8859-1 document. Code points that are not valid characters (surrogates, most control characters, values above 10FFFF) are errors; browsers replace them with the replacement character U+FFFD, and the C1 range &#128;&#159; is remapped to the windows-1252 characters for compatibility with old pages.

When do you need entities?

Always escape the characters that HTML itself uses, otherwise the browser will interpret them as markup — this is also the basis of protection against cross-site scripting (XSS) when you display user input:

CharacterEntityWhere it is required
&&amp;Everywhere in text and attribute values (?a=1&amp;b=2 inside an href).
<&lt;In text content: a bare < starts a tag.
>&gt;Technically allowed in text, but escaping it avoids confusion and is required inside comments and in some XML contexts.
"&quot;Inside attribute values delimited by double quotes.
'&#39; (or &apos; in HTML5/XML)Inside attribute values delimited by single quotes. &apos; does not work in HTML 4 and old versions of Internet Explorer, hence the numeric form.

Everything else is optional. With a UTF-8 document (<meta charset="utf-8"> — the default and the only encoding you should use today), you can type ©, , é, or emoji directly in the source; entities only make the file harder to read and slightly larger. Entities remain useful for:

  • Characters that are invisible or ambiguous in an editor: the non-breaking space &nbsp;, the soft hyphen &shy;, zero-width joiners &zwj;, directional marks &lrm; / &rlm;, thin spaces &thinsp;.
  • Documents served in a legacy single-byte encoding (ISO-8859-1, windows-1252) that cannot represent the character at all.
  • Source code that travels through tools which might re-encode it incorrectly (e-mail templates, old CMS databases in latin1).
  • Showing literal markup in a page, e.g. &lt;div&gt; in a tutorial. Use the HTML Escape / Unescape tool to convert whole snippets.

Named vs numeric references

  • Named references are readable (&copy; is easier to recognise than &#169;) but only exist for a fixed list of characters: 252 in HTML 4.01, 2,231 in HTML5 (which added things like &check;, &star;, &NewLine; and hundreds of mathematical symbols).
  • Numeric references cover all of Unicode and are the only option for characters without a name (most emoji, CJK ideographs, &#x1F600;).
  • In XML (including XHTML, SVG and RSS feeds) only five names are predefined — amp, lt, gt, quot, apos. &nbsp; or &copy; in an XML file are errors unless a DTD declares them, so use numeric references (&#160;, &#169;) there.
  • Inside <script> and <style> elements entities are not decoded: &lt; in JavaScript is the literal four characters. JavaScript strings use \u00A9 escapes, CSS uses \00A9.
  • HTML5 also tolerates some legacy references without the trailing semicolon (&copy, &amp, &lt), which is why a URL such as ?x=1&copy=2 can unexpectedly render ©. Always write the semicolon and always encode & as &amp; in attribute values.

The non-breaking space (&nbsp;)

&nbsp; (U+00A0) is a space that prevents a line break and is not collapsed with adjacent whitespace. It is the most used — and most misused — entity:

  • Good uses: keeping a unit attached to its number (10&nbsp;km, 25&nbsp;°C), keeping initials or titles with a name (Dr.&nbsp;Smith), French typography before : ; ? !, and preventing a widow word at the end of a paragraph.
  • Bad uses: indenting text or adding horizontal space between words — use CSS (margin, padding, letter-spacing, white-space) instead. A row of &nbsp; breaks responsive layouts and screen readers.
  • Empty table cells and elements are often filled with &nbsp; to give them a height; the CSS empty-cells: show and min-height are cleaner alternatives.
  • Note that trim() in JavaScript and PHP trim() handle U+00A0 differently: JavaScript's String.prototype.trim() removes it, PHP's trim() does not (it only strips ASCII whitespace).

Decoding entities in code

// JavaScript (browser): let the parser decode
const txt = document.createElement('textarea');
txt.innerHTML = '&euro; 5 &amp; &#169;';
console.log(txt.value);                       // "€ 5 & ©"

// PHP
echo html_entity_decode('&euro; 5 &amp; &#169;', ENT_QUOTES | ENT_HTML5, 'UTF-8');
echo htmlspecialchars('<b>"Tom" & Jerry</b>', ENT_QUOTES, 'UTF-8');  // encode the 5 reserved characters

// Python
import html
html.unescape('&euro; 5 &amp; &#169;')       # '€ 5 & ©'
html.escape('<b>"Tom" & Jerry</b>')

Never build your own decoder with a hand-written list of a few names: use the platform function, which knows the full HTML5 table, the legacy no-semicolon forms and the numeric syntax.