HTML Entity Converter

Convert special characters to HTML entities or decode entities back to regular characters.

About HTML Entities

HTML entities are codes used to represent characters that have special meaning in HTML or that can't be easily typed on a keyboard. They ensure proper display of characters in web browsers.

Common HTML Entities

CharacterEntity NameEntity Number
<&lt;&#60;
>&gt;&#62;
&&amp;&#38;
"&quot;&#34;
'&apos;&#39;
©&copy;&#169;

When to Use HTML Entities

  • Special characters - For characters that have special meaning in HTML like <, >, and &
  • Non-ASCII characters - For characters not in the ASCII character set to ensure proper display across different systems
  • Security - To prevent XSS (Cross-Site Scripting) attacks by encoding user input
  • Reserved characters - For characters that would otherwise be interpreted as HTML code

Encoding vs. Decoding

Encoding

Converts special characters to their HTML entity equivalents. For example:

<script> becomes &lt;script&gt;

Decoding

Converts HTML entities back to their original characters. For example:

&copy; becomes ©

Example

Original text:

"Hello" & 'World'

Encoded (HTML entities):

&quot;Hello&quot; &amp; &apos;World&apos; &lt;script&gt;&lt;/script&gt;

When decoded, it returns to the original text.