HTML Entities

A brief introduction to the concept of HTML entities.

HTML entities (also known as character entity references) enable you to add a wide range of characters to an HTML document. Characters ranging from icons, mathematical operators, geometric shapes, arrows, multilingual scripts, and much more, can be displayed in a web page by adding a small line of text.

For example, you can add a copyright symbol to a web page by typing ©. You could also use its Unicode hexadecimal value (©) or decimal value (©) if you prefer.

Another important example is the less-than and greater-than signs (i.e. < and >. These signs have special meaning in HTML documents. When the browser sees them it thinks it's an HTML tag and tries to interpret it as such.

If one day you actually wanted to display a greater-than sign on your webpage, you would need to use the HTML entity (or one of the numeric values). So, you could type &gt; and it will be displayed to your users instead of being interpreted by the browser.

Entity Examples

Below are some examples of some popular HTML entities.

CharacterEntityHexadecimalDecimalName
©&copy; &COPY;&#x000A9;&#169;COPYRIGHT SIGN
®&reg; &circledR; &REG;&#x000AE;&#174;REGISTERED SIGN
&trade; &TRADE;&#x02122;&#8482;TRADE MARK SIGN
>&gt; &GT;&#x0003E;&#62;GREATER-THAN SIGN
<&lt; &LT;&#x0003C;&#60;LESS-THAN SIGN
;&semi;&#x0003B;&#59;SEMICOLON
&&amp; &AMP;&#x00026;&#38;AMPERSAND
"&quot; &QUOT;&#x00022;&#34;QUOTATION MARK
#&num;&#x00023;&#35;NUMBER SIGN
&starf; &bigstar;&#x02605;&#9733;BLACK STAR
&star;&#x02606;&#9734;WHITE STAR
&#x02702;&#9986;BLACK SCISSORS
&check; &checkmark;&#x02713;&#10003;CHECK MARK
&cross;&#x02717;&#10007;BALLOT X
&#x02729;&#10025;STRESS OUTLINED WHITE STAR
&#x0272A;&#10026;CIRCLED WHITE STAR
&#x0275E;&#10078;HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT
&#x02764;&#10084;HEAVY BLACK HEART
&larr; &leftarrow; &LeftArrow; &slarr; &ShortLeftArrow;&#x02190;&#8592;LEFTWARDS ARROW
&uarr; &uparrow; &UpArrow; &ShortUpArrow;&#x02191;&#8593;UPWARDS ARROW
&rarr; &rightarrow; &RightArrow; &srarr; &ShortRightArrow;&#x02192;&#8594;RIGHTWARDS ARROW
&darr; &downarrow; &DownArrow; &ShortDownArrow;&#x02193;&#8595;DOWNWARDS ARROW
&euro;&#x020AC;&#8364; EURO SIGN
&#x025B6;&#9654;BLACK RIGHT-POINTING TRIANGLE
&xdtri; &bigtriangledown;&#x025BD;&#9661;WHITE DOWN-POINTING TRIANGLE
&#x025C9;&#9673; FISHEYE
&sum; &Sum;&#x02211;&#8721;N-ARY SUMMATION
&#x02139;&#8505; INFORMATION SOURCE
&numero;&#x02116;&#8470;NUMERO SIGN
&copysr;&#x02117;&#8471;SOUND RECORDING COPYRIGHT
&#x02103;&#8451;DEGREE CELSIUS
&#x02109;&#8457;DEGREE FAHRENHEIT

For a longer list of HTML entities, see this extensive list of Unicode characters.

How to Reference an Entity

You can reference an entity either by its name, or by a numeric character reference.

Each method begins with an ampersand (&) and ends with a semicolon (;), but the part in the middle is different.

Entity Names

Entity names use letters to specify which entity to use.

So &copy; is an example of using the entity name.

However, not all Unicode characters have a corresponding entity name (as you can see in the above list). However, all Unicode characters are assigned a hexadecimal number which is unique to that character. So if you don't see an entity name for a character, use the hexadecimal or decimal value instead.

Numeric Character References

You can also use numeric character references to write character entities (as seen by the examples above).

Numeric character references include a hash (#) after the ampersand, followed by some numbers, and ending with a semicolon (;).

Numeric character references can be defined with either a decimal or hexadecimal value. The numeric character reference for the copyright symbol is &#169; (decimal) and &#xA9; (hexadecimal).