HTML Entities and Symbols

Entities

Some characters are reserved in HTML.

If you use the less than (<) or greater than (>) signs in your text, the browser might mix them with tags.

Character entities are used to display reserved characters in HTML.

Note: Advantage of using an entity name: An entity name is easy to remember.

Note: Disadvantage of using an entity name: Browsers may not support all entity names, but the support for numbers is good.

HTML Code:

<p>Entity: < </p> <p>Code: &lt; or &#60; </p>

Result:

Entity: <

Code: &lt; or &#60;

Some Entities

Result Description Entity Name Entity Number
  non-breaking space &nbsp; &#160;
< less than &lt; &#60;
> less than &gt; &#62;
& ampersand &amp; &#38;
" double quotation mark &quot; &#34;
' single quotation mark (apostrophe) &apos; &#39;
¢ cent &cent; &#162;
£ pound &pound; &#163;
¥ yen &yen; &#165;
euro &euro; &#8364;
© copyright &copy; &#169;
® registered trademark &reg; &#174;

Symbols

Many mathematical, technical, and currency symbols, are not present on a normal keyboard.

To add such symbols to an HTML page, you can use an HTML entity name.

If no entity name exists, you can use an entity number, a decimal, or hexadecimal reference.

HTML Code:

<p>I will display &euro;</p> <p>I will display &#8364;</p> <p>I will display &#x20AC;</p>

Result:

I will display €

I will display €

I will display €

More symbols here

HTML Index

This page is only a summary of the material from W3Schools. Definitions, Examples and Codes are exclusive property of W3Schools.