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:
& → &, < → <, > → >, " → ", and ' → '.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
€?Yes. The decoder handles both named entities (like
&) and numeric entities (like € for €) by leveraging the browser's built-in HTML parser.