List of XML and HTML character entity references

In SGML, HTML and XML documents, the logical constructs known as character data and attribute values consist of sequences of characters, in which each character can manifest directly (representing itself), or can be represented by a series of characters called a character reference, of which there are two types: a numeric character reference and a character entity reference. This article lists the character entity references that are valid in HTML and XML documents.
A character entity reference refers to the content of a named entity. An entity declaration is created in XML, SGML and HTML documents (before HTML5) by using the <!ENTITY name "value"> syntax in a document type definition (DTD).
In HTML and XML, a numeric character reference refers to a character by its Universal Coded Character Set/Unicode code point, and uses the format:
or
where the x must be lowercase in XML documents, hhhh is the code point in hexadecimal form, and nnnn is the code point in decimal form. The hhhh (or nnnn) may be any number of hexadecimal (or decimal) digits and may include leading zeros. The hhhh for hexadecimal digits may mix uppercase and lowercase letters, though uppercase is the usual style. However the XML and HTML standards restrict the usable code points to a set of valid values, which is a subset of UCS/Unicode code point values, that excludes all code points assigned to non-characters or to surrogates, and most code points assigned to C0 and C1 controls (with the exception of line separators and tabulations treated as white spaces).
By contrast, a character entity reference refers to a sequence of one or more characters by the name of an entity which has the desired characters as its replacement text. The entity must either be predefined (built into the markup language), or otherwise explicitly declared in a Document Type Definition (DTD) (see ). The format is the same as for any entity reference:
where name is the case-sensitive name of the entity. The semicolon is usually required in the character entity reference, unless marked otherwise in the table below (see ).
Numerous other entity sets have been developed for special requirements, and for major and minority scripts. However, the advent of Unicode has largely superseded them.
The full formal public identifier and system identifier for the DTD entities subset (where the character entity name is defined) is actually mapped from one of the following three defined named entities:
The ISO entities subsets are old (documented) character subsets, which are given SGML character entity names in ISO 8879 and ISO 9573, and which were used in legacy encodings before the unification within ISO 10646. Their full formal public identifiers are as follows:
HTML5 defines many named entities, references to which act as mnemonic aliases for certain Unicode characters. The HTML5 specification does not allow users to define additional entities, as it no longer accepts any DTD to be referenced or extended inside HTML documents (this is still needed in XHTML, which is based on stricter XML parsing rules but allows referencing or defining a DTD in the document header, because XML does not predefine most HTML entities).
In the below table, the "Standard" column indicates the first version of the HTML DTD that defines the character entity reference, and indicates characters that are predefined in XML without needing any DTD. To use one of these character entity references in an HTML or XML document, enter an ampersand (&) followed by the entity name, and a semicolon (mandatory in XML, and strongly recommended in HTML for all entities, even if HTML allows omitting the semicolon only from some entities indicated below by ), e.g., enter &copy; for the copyright symbol ©.
There are no predefined character entities in HTML for characters or sequences of most scripts encoded in the UCS (except a common subset of whitespace, punctuation, mathematical or technical symbols, currency symbols, a few Hebrew symbols used in mathematical notations, and the most common letters in Latin, Greek or Cyrillic). Note also that not all bidirectional controls defined in UCS/Unicode are represented as standard character entities in HTML (not even in HTML5, which defines more general directional elements and attributes for that purpose). Notably, there are no predefined HTML character entities for controls that were added in the UCS/Unicode and formally defined in version 2 of the Unicode Bidi Algorithm.
Most entities are predefined in XML and HTML to reference just one character in the UCS, but there are no predefined entities for isolated combining characters, variation selectors, or characters for private use assignments; however the list includes some predefined entities for character sequences of two characters containing some of them. Since HTML 5.0 (and MathML 3.0 which shares the same set en entities), all entities are encoded in Unicode normalization forms C and KC (this was not the case with older versions of HTML and MathML, so older entities that were initially defined with characters for private use assignments, CJK compatibility forms, or in non-NFC forms were modified).
However, all valid characters and sequences in the UCS, including all bidirectional controls or private-use assignments (but with the exception of non-whitespace C0 and C1 controls, non-characters, and surrogates) are also usable and valid in HTML, XML, XHTML and MathML, either in plain-text values of attributes or in text elements (by encoding them directly as plain text, or using numeric character references when needed).
The XHTML DTDs explicitly declare 253 entities (including the 5 predefined entities of XML 1.0) whose expansion is a single character, which can therefore be informally referred to as "character entities". These (with the exception of the &apos; entity) have the same names and represent the same characters as the 252 character entities in HTML 4.0. Also, by virtue of being XML, XHTML documents may reference the predefined &apos; entity, which is not one of the 252 character entities in HTML 4.0. Additional entities of any size may be defined on a per-document basis. However, the usability of entity references in XHTML is affected by how the document is being processed:
Because of the special &apos; case mentioned above, only &quot;, &amp;, &lt;, and &gt; will work in all XHTML processing situations.