HTML Entities

What is HTML Entity?

In HTML, some characters are reserved. For example, you can’t use less than (<) or greater than (>) or angle brackets in your text, as the browser might misinterpret them as markup. Some characters are not available on the keyboard, such as copyright symbol ©, so you need to replace them with character entities.

You need to replace these characters with the character entities to show them. Character entity references (or entities for short) allow you to use characters that are not available in your document’s character encoding or that you can’t type on a keyboard.

Frequently Used HTML Character Entities

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

 

Numerical character references can be used instead of Entity names. One of the main advantages of using a numeric character reference is that they have better browser support and can specify any Unicode character, whereas Entity names can only specify a subset of characters in Unicode.

Note: Case-sensitive HTML Entity Names. See the HTML character entities Reference for a full list of special character entities and symbols.

Tip: Nonbreaking space (&nbsp;) creates an empty space between two objects that cannot be separated with a line break. It is also used to show multiple spaces as web browsers only show one space when multiple spaces are created with the spacebar key.