Entity References in HTML

Dated: 23 Aug, 2010 11:05:20 AM
Entity references are used in HTML to display characters that cannot be typed using keyboard or that has special meanings.

For example:
  • We cannot type '<' in an html document as it denotes the starting of a tag. If we put '<' in out page's text, it will change the layout of our page.
  • Likewise, © 'The copyright symbol' cannot be typed using the keyboard.
For these characters and symbols, we have entity references available at our disposal. We can use these entity references in out document and when the document is displayed on the browser, the entity references will be converted to the symbol it represents.

Entity references starts with & and end with ;

Below is a list of entity references that i had used in the past. You may find some symbols like α (alpha), β (beta) etc as not frequently used, but I think they can be useful in some sort of technical stuff.

SymbolEntity ReferenceDescription
&apos; &apos; apostrophe (&apos; does not work in IE, use ' instead)
" &quot; double quotes (quotation mark)
& &amp; ampersand
< &lt; less than
> &gt; greater than
  &nbsp; single space (non-breaking space)
&thinsp; thin space
¡ &iexcl inverted exclamation mark
« &laquo left pointing double less than (guillemet)
» &raquo right pointing double greater than (guillemet)
¢ &cent; cent symbol
£ &pound; pound symbol
&euro; euro symbol
¥ &yen; yen symbol
© &copy; copyright symbol
® &reg; registered symbol
&trade; trademark symbol
° &deg; degree symbol
± &plusmn; plus minus sign
&para; paragraph marker symbol
α &alpha; alpha symbol
β &beta; beta symbol
γ &gamma; gamma symbol
δ &delta; delta symbol
η &eta; eta symbol
ζ &zeta; zeta symbol
θ &theta; theta symbol
λ &lambda; lambda symbol
π &pi; pi symbol
σ &sigma; sigma symbol
µ &micro; micor sign
&ne; not equal to symbol
&le; less than equal to symbol
&ge; greater than equal to symbol
&sum; summation sign
&infin; infinity symbol
&asymp; asymptotic to (almost equal to) symbol
&equiv; equivalent to symbol
&larr; left (single) arrow symbol
&rarr; right (single) arrow symbol
&uarr; up (single) arrow symbol
&darr; down (single) arrow symbol
&lArr; left double arrow symbol
&rArr; right double arrow symbol
&uArr; up double arrow symbol
&dArr; down double arrow symbol
&crarr; carriage return symbol

The list above is not exhaustive. For a complete list, search for ISO 8859-1 symbols and characters.
Like this article? Now share it with your friends

 

1 Comment.....

Matt Hidinger
8/28/2010 11:50:41 AM

Nice compilation of useful entity references. I already knew most of them. There are some that i didn't knew earlier but are regularly required. Instead of searching for the symbol using a different font, we can use entity reference



Post Comment

Name:  
Email:  
You will receive an email to approve your comment.

Comment:  


Free subscriptions
Provide your email address to recieve my articles by email. I will never share your address, and there is a link to unsubscribe in every mail.



Follow me on twitter @mndworld

Popular Articles

Recent Articles