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
No entity matches your search. Any Unicode character can still be written as a numeric reference: use the encoder at the top of the page.
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:
| Form | Syntax | Example for € | Notes |
|---|---|---|---|
| Named (character entity reference) | &name; | € | Case-sensitive: É is É, é is é. Only names defined by the HTML specification work. |
| Decimal (numeric character reference) | &#N; | € | N is the Unicode code point in base 10. Works for every character, even those without a name. |
| Hexadecimal (numeric character reference) | &#xH; | € | 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. 😀 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 €–Ÿ 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:
| Character | Entity | Where it is required |
|---|---|---|
& | & | Everywhere in text and attribute values (?a=1&b=2 inside an href). |
< | < | In text content: a bare < starts a tag. |
> | > | Technically allowed in text, but escaping it avoids confusion and is required inside comments and in some XML contexts. |
" | " | Inside attribute values delimited by double quotes. |
' | ' (or ' in HTML5/XML) | Inside attribute values delimited by single quotes. ' 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
, the soft hyphen­, zero-width joiners‍, directional marks‎/‏, thin spaces . - 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.
<div>in a tutorial. Use the HTML Escape / Unescape tool to convert whole snippets.
Named vs numeric references
- Named references are readable (
©is easier to recognise than©) but only exist for a fixed list of characters: 252 in HTML 4.01, 2,231 in HTML5 (which added things like✓,☆,
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,
😀). - In XML (including XHTML, SVG and RSS feeds) only five names are predefined —
amp,lt,gt,quot,apos. or©in an XML file are errors unless a DTD declares them, so use numeric references ( ,©) there. - Inside
<script>and<style>elements entities are not decoded:<in JavaScript is the literal four characters. JavaScript strings use\u00A9escapes, CSS uses\00A9. - HTML5 also tolerates some legacy references without the trailing semicolon (
©,&,<), which is why a URL such as?x=1©=2can unexpectedly render ©. Always write the semicolon and always encode&as&in attribute values.
The non-breaking space ( )
(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 km,25 °C), keeping initials or titles with a name (Dr. 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 breaks responsive layouts and screen readers. - Empty table cells and elements are often filled with
to give them a height; the CSSempty-cells: showandmin-heightare cleaner alternatives. - Note that
trim()in JavaScript and PHPtrim()handle U+00A0 differently: JavaScript'sString.prototype.trim()removes it, PHP'strim()does not (it only strips ASCII whitespace).
Decoding entities in code
// JavaScript (browser): let the parser decode
const txt = document.createElement('textarea');
txt.innerHTML = '€ 5 & ©';
console.log(txt.value); // "€ 5 & ©"
// PHP
echo html_entity_decode('€ 5 & ©', 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('€ 5 & ©') # '€ 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.