HTML Entity Encoder/Decoder

Encode or decode HTML entities

Input
Output

About HTML Entity Encoder/Decoder

HTML entities are special codes used to represent reserved characters in HTML. Characters like <, >, &, and " have special meaning in HTML and must be encoded to display correctly. This tool converts between raw characters and their HTML entity equivalents.

Q: Which characters get encoded?
The encoder converts the five characters that have special meaning in HTML: &&amp;, <&lt;, >&gt;, "&quot;, and '&#39;.
Q: When should I use HTML entity encoding?
Always encode user-generated content before inserting it into HTML to prevent XSS (Cross-Site Scripting) attacks. It's also needed when displaying code snippets or special characters in web pages.
Q: Does the decoder handle numeric entities like &#8364;?
Yes. The decoder handles both named entities (like &amp;) and numeric entities (like &#8364; for €) by leveraging the browser's built-in HTML parser.